@berthojoris/mcp-mysql-server 1.40.1 → 1.40.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,48 @@ All notable changes to the MySQL MCP Server will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.40.3] - 2026-03-07
9
+
10
+ ### Fixed
11
+ - Added missing tool-category mappings for snake_case and camelCase variants in `src/config/featureConfig.ts`
12
+ - Resolved unmapped tools: `get_schema_erd`, `repair_query`, `export_table_to_csv`, `export_query_to_csv`, `analyze_query`, `get_optimization_hints`
13
+ - Ensured dual-layer filtering recognizes all registered MCP tools from `src/mcp-server.ts`
14
+
15
+ ### Changed
16
+ - Synchronized versions to `1.40.3` in `package.json`, `src/mcp-server.ts`, and `manifest.json`
17
+ - Updated `README.md` and `DOCUMENTATIONS.md` Last Updated metadata
18
+
19
+ ## [1.40.2] - 2026-03-07
20
+
21
+ ### Removed
22
+ - **Functions Management Category**: Removed category `functions_management` and all 6 tools
23
+ - `list_functions` - List user-defined functions
24
+ - `get_function_info` - Get function details
25
+ - `create_function` - Create function
26
+ - `drop_function` - Drop function
27
+ - `show_create_function` - Show CREATE FUNCTION statement
28
+ - `execute_function` - Execute function
29
+ - **Backup & Restore Category**: Removed category `backup_restore` and all 5 tools
30
+ - `backup_table` - Backup a single table
31
+ - `backup_database` - Backup entire database
32
+ - `restore_from_sql` - Restore from SQL dump
33
+ - `get_create_table_statement` - Get CREATE TABLE statement
34
+ - `get_database_schema` - Get complete schema snapshot
35
+ - Removed tool modules `src/tools/functionTools.ts` and `src/tools/backupRestoreTools.ts`
36
+
37
+ ### Changed
38
+ - Updated tool count: 73 → 62 tools (-11 tools)
39
+ - Updated category count: 15 → 13 categories (removed `functions_management`, `backup_restore`)
40
+ - Updated `src/mcp-server.ts` to remove tool schemas and call routing for all 11 tools
41
+ - Updated `src/index.ts` to remove MySQLMCP imports, fields, initialization, and methods for removed tool sets
42
+ - Updated `src/config/featureConfig.ts` to remove enum values and category mappings for both categories
43
+ - Updated CLI category help in `bin/mcp-mysql.js`
44
+ - Updated `README.md` and `DOCUMENTATIONS.md` to reflect new category list and tool totals
45
+ - Synchronized versions to `1.40.2` in `package.json`, `src/mcp-server.ts`, and `manifest.json`
46
+
47
+ ### Fixed
48
+ - Updated procedure permission example in docs to reference `execute_stored_procedure` instead of removed function execution tool
49
+
8
50
  ## [1.40.1] - 2026-03-06
9
51
 
10
52
  ### Changed
package/DOCUMENTATIONS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # MySQL MCP Server - Documentation
2
2
 
3
- **Last Updated:** 2026-03-06 17:30:00
4
- **Version:** 1.40.1
5
- **Total Tools:** 73
3
+ **Last Updated:** 2026-03-07 11:05:00
4
+ **Version:** 1.40.3
5
+ **Total Tools:** 62
6
6
 
7
7
  Comprehensive documentation for the MySQL MCP Server. For quick start, see [README.md](README.md).
8
8
 
@@ -80,7 +80,7 @@ Configure MySQL MCP with two access-control layers:
80
80
  | `ddl` | Schema changes | `create_table`, `alter_table` |
81
81
  | `utility` | Utility operations | `test_connection`, `analyze_table` |
82
82
  | `transaction` | Transaction management | `begin_transaction`, `commit_transaction` |
83
- | `procedure` | Stored procedures | `create_stored_procedure`, `execute_function` |
83
+ | `procedure` | Stored procedures | `create_stored_procedure`, `execute_stored_procedure` |
84
84
 
85
85
  ### Filtering Logic
86
86
 
@@ -169,15 +169,7 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
169
169
  - `drop_trigger` - Remove triggers
170
170
  - `show_create_trigger` - Show CREATE statement
171
171
 
172
- ### 11. Functions Management (6 tools)
173
- - `list_functions` - List functions
174
- - `get_function_info` - Get function details
175
- - `create_function` - Create functions
176
- - `drop_function` - Remove functions
177
- - `show_create_function` - Show CREATE statement
178
- - `execute_function` - Execute functions
179
-
180
- ### 12. Table Maintenance (8 tools)
172
+ ### 11. Table Maintenance (8 tools)
181
173
  - `analyze_table` - Update statistics
182
174
  - `optimize_table` - Reclaim space
183
175
  - `check_table` - Check for errors
@@ -187,19 +179,19 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
187
179
  - `flush_table` - Close/reopen table
188
180
  - `get_table_size` - Get size information
189
181
 
190
- ### 13. Transaction Management (5 tools)
182
+ ### 12. Transaction Management (5 tools)
191
183
  - `begin_transaction` - Start transaction
192
184
  - `commit_transaction` - Commit transaction
193
185
  - `rollback_transaction` - Rollback transaction
194
186
  - `get_transaction_status` - Check transaction state
195
187
  - `execute_in_transaction` - Execute within transaction
196
188
 
197
- ### 14. Query Optimization (3 tools)
189
+ ### 13. Query Optimization (3 tools)
198
190
  - `analyze_query` - Analyze query performance
199
191
  - `get_optimization_hints` - Get optimizer hints
200
192
  - `repair_query` - Repair broken SQL queries
201
193
 
202
- ### 15. Utilities (4 tools)
194
+ ### 14. Utilities (4 tools)
203
195
  - `test_connection` - Test connectivity
204
196
  - `describe_connection` - Connection info
205
197
  - `read_changelog` - Read changelog
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **A production-ready Model Context Protocol (MCP) server for MySQL database integration with AI agents**
6
6
 
7
- **Last Updated:** 2026-03-06 17:30:00
7
+ **Last Updated:** 2026-03-07 11:05:00
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@berthojoris/mcp-mysql-server)](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/@berthojoris/mcp-mysql-server)](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
@@ -255,19 +255,17 @@ Use documentation categories to fine-tune which tools are exposed (Layer 2):
255
255
  | `stored_procedures` | Create, execute, and manage stored procedures | `create_stored_procedure, drop_stored_procedure, execute_stored_procedure, get_stored_procedure_info, list_stored_procedures, show_create_procedure` |
256
256
  | `views_management` | Create and manage database views | `alter_view, create_view, drop_view, get_view_info, list_views, show_create_view` |
257
257
  | `triggers_management` | Create and manage database triggers | `create_trigger, drop_trigger, get_trigger_info, list_triggers, show_create_trigger` |
258
- | `functions_management` | Create and manage database functions | `create_function, drop_function, execute_function, get_function_info, list_functions, show_create_function` |
259
258
  | `index_management` | Optimize performance with index management | `analyze_index, create_index, drop_index, get_index_info, list_indexes` |
260
259
  | `constraint_management` | Manage data integrity constraints | `add_check_constraint, add_foreign_key, add_unique_constraint, drop_constraint, drop_foreign_key, list_constraints, list_foreign_keys` |
261
260
  | `table_maintenance` | Table optimization, repair, and maintenance | `analyze_table, check_table, flush_table, get_table_size, get_table_status, optimize_table, repair_table, truncate_table` |
262
261
  | `query_optimization` | Analyze and optimize SQL queries | `analyze_query, get_optimization_hints` |
263
- | `backup_restore` | Create backups and restore databases | `backup_database, backup_table, get_create_table_statement, get_database_schema, restore_from_sql` |
264
262
  | `analysis` | Data analysis and reporting tools | `get_column_statistics, get_database_summary, get_schema_erd, get_schema_rag_context` |
265
263
 
266
264
  <details>
267
265
  <summary>Copy/paste list (comma-separated, no spaces)</summary>
268
266
 
269
267
  ```text
270
- database_discovery,crud_operations,bulk_operations,custom_queries,schema_management,utilities,transaction_management,stored_procedures,views_management,triggers_management,functions_management,index_management,constraint_management,table_maintenance,query_optimization,backup_restore,analysis
268
+ database_discovery,crud_operations,bulk_operations,custom_queries,schema_management,utilities,transaction_management,stored_procedures,views_management,triggers_management,index_management,constraint_management,table_maintenance,query_optimization,analysis
271
269
  ```
272
270
 
273
271
  </details>
@@ -278,7 +276,7 @@ Full category → tool mapping (and examples) lives in **[DOCUMENTATIONS.md →
278
276
 
279
277
  ## Available Tools
280
278
 
281
- The server exposes **73 tools** organized into categories (CRUD, schema, and utilities).
279
+ The server exposes **62 tools** organized into categories (CRUD, schema, and utilities).
282
280
 
283
281
  - Complete list of tools: **[DOCUMENTATIONS.md → Complete Tools Reference](DOCUMENTATIONS.md#🔧-complete-tools-reference)**
284
282
 
@@ -291,7 +289,6 @@ For comprehensive documentation, see **[DOCUMENTATIONS.md](DOCUMENTATIONS.md)**:
291
289
  - **DDL Operations** - Create, alter, and drop tables
292
290
  - **Data Export Tools** - Export to CSV, JSON, and SQL formats
293
291
  - **Data Import Tools** - Import from CSV and JSON sources
294
- - **Database Backup & Restore** - Full backup/restore with SQL dumps
295
292
  - **Data Migration Tools** - Copy, move, clone, compare, and sync data
296
293
  - **Schema Versioning** - Version control for database schema changes
297
294
  - **Transaction Management** - ACID transactions
package/bin/mcp-mysql.js CHANGED
@@ -66,13 +66,13 @@ if (!mysqlUrl) {
66
66
  " schema_management, utilities, transaction_management, stored_procedures,",
67
67
  );
68
68
  console.error(
69
- " views_management, triggers_management, functions_management, index_management,",
69
+ " views_management, triggers_management, index_management,",
70
70
  );
71
71
  console.error(
72
72
  " constraint_management, table_maintenance, query_optimization,",
73
73
  );
74
74
  console.error(
75
- " backup_restore, analysis",
75
+ " analysis",
76
76
  );
77
77
  console.error("");
78
78
  console.error("Filtering Logic:");
@@ -14,7 +14,7 @@ export declare enum ToolCategory {
14
14
  PROCEDURE = "procedure"
15
15
  }
16
16
  /**
17
- * Documentation categories from README (15 categories)
17
+ * Documentation categories from README (13 categories)
18
18
  * More intuitive and matches user mental model
19
19
  */
20
20
  export declare enum DocCategory {
@@ -28,12 +28,10 @@ export declare enum DocCategory {
28
28
  STORED_PROCEDURES = "stored_procedures",
29
29
  VIEWS_MANAGEMENT = "views_management",
30
30
  TRIGGERS_MANAGEMENT = "triggers_management",
31
- FUNCTIONS_MANAGEMENT = "functions_management",
32
31
  INDEX_MANAGEMENT = "index_management",
33
32
  CONSTRAINT_MANAGEMENT = "constraint_management",
34
33
  TABLE_MAINTENANCE = "table_maintenance",
35
34
  QUERY_OPTIMIZATION = "query_optimization",
36
- BACKUP_RESTORE = "backup_restore",
37
35
  ANALYSIS = "analysis"
38
36
  }
39
37
  /**
@@ -24,7 +24,7 @@ var ToolCategory;
24
24
  ToolCategory["PROCEDURE"] = "procedure";
25
25
  })(ToolCategory || (exports.ToolCategory = ToolCategory = {}));
26
26
  /**
27
- * Documentation categories from README (15 categories)
27
+ * Documentation categories from README (13 categories)
28
28
  * More intuitive and matches user mental model
29
29
  */
30
30
  var DocCategory;
@@ -39,12 +39,10 @@ var DocCategory;
39
39
  DocCategory["STORED_PROCEDURES"] = "stored_procedures";
40
40
  DocCategory["VIEWS_MANAGEMENT"] = "views_management";
41
41
  DocCategory["TRIGGERS_MANAGEMENT"] = "triggers_management";
42
- DocCategory["FUNCTIONS_MANAGEMENT"] = "functions_management";
43
42
  DocCategory["INDEX_MANAGEMENT"] = "index_management";
44
43
  DocCategory["CONSTRAINT_MANAGEMENT"] = "constraint_management";
45
44
  DocCategory["TABLE_MAINTENANCE"] = "table_maintenance";
46
45
  DocCategory["QUERY_OPTIMIZATION"] = "query_optimization";
47
- DocCategory["BACKUP_RESTORE"] = "backup_restore";
48
46
  DocCategory["ANALYSIS"] = "analysis";
49
47
  })(DocCategory || (exports.DocCategory = DocCategory = {}));
50
48
  /**
@@ -59,6 +57,8 @@ exports.toolCategoryMap = {
59
57
  // Analysis tools (added here to group with database tools)
60
58
  getDatabaseSummary: ToolCategory.LIST,
61
59
  getSchemaERD: ToolCategory.LIST,
60
+ getSchemaErd: ToolCategory.LIST,
61
+ get_schema_erd: ToolCategory.LIST,
62
62
  getSchemaRagContext: ToolCategory.LIST,
63
63
  // CRUD tools
64
64
  createRecord: ToolCategory.CREATE,
@@ -84,7 +84,11 @@ exports.toolCategoryMap = {
84
84
  testConnection: ToolCategory.UTILITY,
85
85
  getAllTablesRelationships: ToolCategory.UTILITY,
86
86
  exportTableToCSV: ToolCategory.UTILITY,
87
+ exportTableToCsv: ToolCategory.UTILITY,
88
+ export_table_to_csv: ToolCategory.UTILITY,
87
89
  exportQueryToCSV: ToolCategory.UTILITY,
90
+ exportQueryToCsv: ToolCategory.UTILITY,
91
+ export_query_to_csv: ToolCategory.UTILITY,
88
92
  read_changelog: ToolCategory.UTILITY,
89
93
  // Transaction tools
90
94
  beginTransaction: ToolCategory.TRANSACTION,
@@ -112,13 +116,6 @@ exports.toolCategoryMap = {
112
116
  createTrigger: ToolCategory.DDL,
113
117
  dropTrigger: ToolCategory.DDL,
114
118
  showCreateTrigger: ToolCategory.LIST,
115
- // Function tools
116
- listFunctions: ToolCategory.LIST,
117
- getFunctionInfo: ToolCategory.LIST,
118
- createFunction: ToolCategory.PROCEDURE,
119
- dropFunction: ToolCategory.PROCEDURE,
120
- showCreateFunction: ToolCategory.LIST,
121
- executeFunction: ToolCategory.PROCEDURE,
122
119
  // Index tools
123
120
  listIndexes: ToolCategory.LIST,
124
121
  getIndexInfo: ToolCategory.LIST,
@@ -142,12 +139,13 @@ exports.toolCategoryMap = {
142
139
  getTableStatus: ToolCategory.LIST,
143
140
  flushTable: ToolCategory.UTILITY,
144
141
  getTableSize: ToolCategory.LIST,
145
- // Backup and restore tools
146
- backupTable: ToolCategory.UTILITY,
147
- backupDatabase: ToolCategory.UTILITY,
148
- restoreFromSql: ToolCategory.UTILITY,
149
- getCreateTableStatement: ToolCategory.UTILITY,
150
- getDatabaseSchema: ToolCategory.UTILITY,
142
+ // Query optimization tools
143
+ analyzeQuery: ToolCategory.UTILITY,
144
+ analyze_query: ToolCategory.UTILITY,
145
+ getOptimizationHints: ToolCategory.UTILITY,
146
+ get_optimization_hints: ToolCategory.UTILITY,
147
+ repairQuery: ToolCategory.UTILITY,
148
+ repair_query: ToolCategory.UTILITY,
151
149
  // Full-Text Search Tools
152
150
  createFulltextIndex: ToolCategory.DDL,
153
151
  fulltextSearch: ToolCategory.READ,
@@ -186,7 +184,11 @@ exports.toolDocCategoryMap = {
186
184
  testConnection: DocCategory.UTILITIES,
187
185
  describeConnection: DocCategory.UTILITIES,
188
186
  exportTableToCSV: DocCategory.UTILITIES,
187
+ exportTableToCsv: DocCategory.UTILITIES,
188
+ export_table_to_csv: DocCategory.UTILITIES,
189
189
  exportQueryToCSV: DocCategory.UTILITIES,
190
+ exportQueryToCsv: DocCategory.UTILITIES,
191
+ export_query_to_csv: DocCategory.UTILITIES,
190
192
  read_changelog: DocCategory.UTILITIES,
191
193
  list_all_tools: DocCategory.UTILITIES,
192
194
  // Transaction Management
@@ -215,13 +217,6 @@ exports.toolDocCategoryMap = {
215
217
  createTrigger: DocCategory.TRIGGERS_MANAGEMENT,
216
218
  dropTrigger: DocCategory.TRIGGERS_MANAGEMENT,
217
219
  showCreateTrigger: DocCategory.TRIGGERS_MANAGEMENT,
218
- // Functions Management
219
- listFunctions: DocCategory.FUNCTIONS_MANAGEMENT,
220
- getFunctionInfo: DocCategory.FUNCTIONS_MANAGEMENT,
221
- createFunction: DocCategory.FUNCTIONS_MANAGEMENT,
222
- dropFunction: DocCategory.FUNCTIONS_MANAGEMENT,
223
- showCreateFunction: DocCategory.FUNCTIONS_MANAGEMENT,
224
- executeFunction: DocCategory.FUNCTIONS_MANAGEMENT,
225
220
  // Index Management
226
221
  listIndexes: DocCategory.INDEX_MANAGEMENT,
227
222
  getIndexInfo: DocCategory.INDEX_MANAGEMENT,
@@ -247,17 +242,16 @@ exports.toolDocCategoryMap = {
247
242
  getTableSize: DocCategory.TABLE_MAINTENANCE,
248
243
  // Query Optimization
249
244
  analyzeQuery: DocCategory.QUERY_OPTIMIZATION,
245
+ analyze_query: DocCategory.QUERY_OPTIMIZATION,
250
246
  getOptimizationHints: DocCategory.QUERY_OPTIMIZATION,
247
+ get_optimization_hints: DocCategory.QUERY_OPTIMIZATION,
251
248
  repairQuery: DocCategory.QUERY_OPTIMIZATION,
252
- // Backup & Restore
253
- backupTable: DocCategory.BACKUP_RESTORE,
254
- backupDatabase: DocCategory.BACKUP_RESTORE,
255
- restoreFromSql: DocCategory.BACKUP_RESTORE,
256
- getCreateTableStatement: DocCategory.BACKUP_RESTORE,
257
- getDatabaseSchema: DocCategory.BACKUP_RESTORE,
249
+ repair_query: DocCategory.QUERY_OPTIMIZATION,
258
250
  // Analysis
259
251
  getDatabaseSummary: DocCategory.ANALYSIS,
260
252
  getSchemaERD: DocCategory.ANALYSIS,
253
+ getSchemaErd: DocCategory.ANALYSIS,
254
+ get_schema_erd: DocCategory.ANALYSIS,
261
255
  getColumnStatistics: DocCategory.ANALYSIS,
262
256
  getSchemaRagContext: DocCategory.ANALYSIS,
263
257
  // Full-Text Search
@@ -278,7 +272,6 @@ const legacyToDocCategoryMap = {
278
272
  DocCategory.STORED_PROCEDURES,
279
273
  DocCategory.VIEWS_MANAGEMENT,
280
274
  DocCategory.TRIGGERS_MANAGEMENT,
281
- DocCategory.FUNCTIONS_MANAGEMENT,
282
275
  DocCategory.INDEX_MANAGEMENT,
283
276
  DocCategory.CONSTRAINT_MANAGEMENT,
284
277
  DocCategory.TABLE_MAINTENANCE,
@@ -306,16 +299,14 @@ const legacyToDocCategoryMap = {
306
299
  DocCategory.INDEX_MANAGEMENT,
307
300
  DocCategory.CONSTRAINT_MANAGEMENT,
308
301
  DocCategory.TABLE_MAINTENANCE,
309
- DocCategory.BACKUP_RESTORE,
310
302
  ],
311
303
  utility: [
312
304
  DocCategory.UTILITIES,
313
305
  DocCategory.TABLE_MAINTENANCE,
314
306
  DocCategory.QUERY_OPTIMIZATION,
315
- DocCategory.BACKUP_RESTORE,
316
307
  ],
317
308
  transaction: [DocCategory.TRANSACTION_MANAGEMENT],
318
- procedure: [DocCategory.STORED_PROCEDURES, DocCategory.FUNCTIONS_MANAGEMENT],
309
+ procedure: [DocCategory.STORED_PROCEDURES],
319
310
  };
320
311
  /**
321
312
  * Class to manage feature configuration based on runtime or environment variables
package/dist/index.d.ts CHANGED
@@ -13,11 +13,9 @@ export declare class MySQLMCP {
13
13
  private dataExportTools;
14
14
  private viewTools;
15
15
  private triggerTools;
16
- private functionTools;
17
16
  private indexTools;
18
17
  private constraintTools;
19
18
  private maintenanceTools;
20
- private backupRestoreTools;
21
19
  private analysisTools;
22
20
  private aiTools;
23
21
  private macroTools;
@@ -510,52 +508,6 @@ export declare class MySQLMCP {
510
508
  data?: any;
511
509
  error?: string;
512
510
  }>;
513
- listFunctions(params: {
514
- database?: string;
515
- }): Promise<{
516
- status: string;
517
- data?: any[];
518
- error?: string;
519
- }>;
520
- getFunctionInfo(params: {
521
- function_name: string;
522
- database?: string;
523
- }): Promise<{
524
- status: string;
525
- data?: any;
526
- error?: string;
527
- }>;
528
- createFunction(params: any): Promise<{
529
- status: string;
530
- data?: any;
531
- error?: string;
532
- }>;
533
- dropFunction(params: {
534
- function_name: string;
535
- if_exists?: boolean;
536
- database?: string;
537
- }): Promise<{
538
- status: string;
539
- message?: string;
540
- error?: string;
541
- }>;
542
- showCreateFunction(params: {
543
- function_name: string;
544
- database?: string;
545
- }): Promise<{
546
- status: string;
547
- data?: any;
548
- error?: string;
549
- }>;
550
- executeFunction(params: {
551
- function_name: string;
552
- parameters?: any[];
553
- database?: string;
554
- }): Promise<{
555
- status: string;
556
- data?: any;
557
- error?: string;
558
- }>;
559
511
  listIndexes(params: {
560
512
  table_name: string;
561
513
  database?: string;
package/dist/index.js CHANGED
@@ -14,11 +14,9 @@ const storedProcedureTools_1 = require("./tools/storedProcedureTools");
14
14
  const dataExportTools_1 = require("./tools/dataExportTools");
15
15
  const viewTools_1 = require("./tools/viewTools");
16
16
  const triggerTools_1 = require("./tools/triggerTools");
17
- const functionTools_1 = require("./tools/functionTools");
18
17
  const indexTools_1 = require("./tools/indexTools");
19
18
  const constraintTools_1 = require("./tools/constraintTools");
20
19
  const maintenanceTools_1 = require("./tools/maintenanceTools");
21
- const backupRestoreTools_1 = require("./tools/backupRestoreTools");
22
20
  const analysisTools_1 = require("./tools/analysisTools");
23
21
  const aiTools_1 = require("./tools/aiTools");
24
22
  const macroTools_1 = require("./tools/macroTools");
@@ -45,11 +43,9 @@ class MySQLMCP {
45
43
  this.dataExportTools = new dataExportTools_1.DataExportTools(this.security);
46
44
  this.viewTools = new viewTools_1.ViewTools(this.security);
47
45
  this.triggerTools = new triggerTools_1.TriggerTools(this.security);
48
- this.functionTools = new functionTools_1.FunctionTools(this.security);
49
46
  this.indexTools = new indexTools_1.IndexTools(this.security);
50
47
  this.constraintTools = new constraintTools_1.ConstraintTools(this.security);
51
48
  this.maintenanceTools = new maintenanceTools_1.MaintenanceTools(this.security);
52
- this.backupRestoreTools = new backupRestoreTools_1.BackupRestoreTools(this.security);
53
49
  this.analysisTools = new analysisTools_1.AnalysisTools(this.security);
54
50
  this.aiTools = new aiTools_1.AiTools(this.security);
55
51
  this.macroTools = new macroTools_1.MacroTools(this.security);
@@ -515,45 +511,6 @@ class MySQLMCP {
515
511
  return await this.triggerTools.showCreateTrigger(params);
516
512
  }
517
513
  // ==========================================
518
- // Function Tools
519
- // ==========================================
520
- async listFunctions(params) {
521
- const check = this.checkToolEnabled("listFunctions");
522
- if (!check.enabled)
523
- return { status: "error", error: check.error };
524
- return await this.functionTools.listFunctions(params);
525
- }
526
- async getFunctionInfo(params) {
527
- const check = this.checkToolEnabled("getFunctionInfo");
528
- if (!check.enabled)
529
- return { status: "error", error: check.error };
530
- return await this.functionTools.getFunctionInfo(params);
531
- }
532
- async createFunction(params) {
533
- const check = this.checkToolEnabled("createFunction");
534
- if (!check.enabled)
535
- return { status: "error", error: check.error };
536
- return await this.functionTools.createFunction(params);
537
- }
538
- async dropFunction(params) {
539
- const check = this.checkToolEnabled("dropFunction");
540
- if (!check.enabled)
541
- return { status: "error", error: check.error };
542
- return await this.functionTools.dropFunction(params);
543
- }
544
- async showCreateFunction(params) {
545
- const check = this.checkToolEnabled("showCreateFunction");
546
- if (!check.enabled)
547
- return { status: "error", error: check.error };
548
- return await this.functionTools.showCreateFunction(params);
549
- }
550
- async executeFunction(params) {
551
- const check = this.checkToolEnabled("executeFunction");
552
- if (!check.enabled)
553
- return { status: "error", error: check.error };
554
- return await this.functionTools.executeFunction(params);
555
- }
556
- // ==========================================
557
514
  // Index Tools
558
515
  // ==========================================
559
516
  async listIndexes(params) {
@@ -603,7 +603,7 @@ const TOOLS = [
603
603
  },
604
604
  {
605
605
  name: "drop_table",
606
- description: '🗑️ DESTRUCTIVE: Permanently deletes a table and ALL its data. Cannot be undone! Consider backup_table first. Requires "ddl" permission. ⚠️ WARNING: IRREVERSIBLE!',
606
+ description: '🗑️ DESTRUCTIVE: Permanently deletes a table and ALL its data. Cannot be undone! Requires "ddl" permission. ⚠️ WARNING: IRREVERSIBLE!',
607
607
  inputSchema: {
608
608
  type: "object",
609
609
  properties: {
@@ -1253,139 +1253,6 @@ const TOOLS = [
1253
1253
  required: ["trigger_name"],
1254
1254
  },
1255
1255
  },
1256
- // Function Tools
1257
- {
1258
- name: "list_functions",
1259
- description: "Lists all user-defined functions in the database.",
1260
- inputSchema: {
1261
- type: "object",
1262
- properties: {
1263
- database: {
1264
- type: "string",
1265
- description: "Optional: specific database name",
1266
- },
1267
- },
1268
- },
1269
- },
1270
- {
1271
- name: "get_function_info",
1272
- description: "Gets detailed information about a specific function including parameters.",
1273
- inputSchema: {
1274
- type: "object",
1275
- properties: {
1276
- function_name: { type: "string", description: "Name of the function" },
1277
- database: {
1278
- type: "string",
1279
- description: "Optional: specific database name",
1280
- },
1281
- },
1282
- required: ["function_name"],
1283
- },
1284
- },
1285
- {
1286
- name: "create_function",
1287
- description: "Creates a new user-defined function. Requires 'ddl' permission.",
1288
- inputSchema: {
1289
- type: "object",
1290
- properties: {
1291
- function_name: { type: "string", description: "Name of the function" },
1292
- parameters: {
1293
- type: "array",
1294
- description: "Array of parameter definitions",
1295
- items: {
1296
- type: "object",
1297
- properties: {
1298
- name: { type: "string" },
1299
- data_type: { type: "string" },
1300
- },
1301
- required: ["name", "data_type"],
1302
- },
1303
- },
1304
- returns: { type: "string", description: "Return data type" },
1305
- body: { type: "string", description: "Function body (SQL statements)" },
1306
- deterministic: {
1307
- type: "boolean",
1308
- description: "Whether function always returns same result for same input",
1309
- },
1310
- data_access: {
1311
- type: "string",
1312
- enum: [
1313
- "CONTAINS SQL",
1314
- "NO SQL",
1315
- "READS SQL DATA",
1316
- "MODIFIES SQL DATA",
1317
- ],
1318
- },
1319
- security: { type: "string", enum: ["DEFINER", "INVOKER"] },
1320
- comment: { type: "string", description: "Optional comment" },
1321
- database: {
1322
- type: "string",
1323
- description: "Optional: specific database name",
1324
- },
1325
- },
1326
- required: ["function_name", "returns", "body"],
1327
- },
1328
- },
1329
- {
1330
- name: "drop_function",
1331
- description: "Drops a user-defined function. Requires 'ddl' permission.",
1332
- inputSchema: {
1333
- type: "object",
1334
- properties: {
1335
- function_name: {
1336
- type: "string",
1337
- description: "Name of the function to drop",
1338
- },
1339
- if_exists: {
1340
- type: "boolean",
1341
- description: "If true, will not error if function does not exist",
1342
- },
1343
- database: {
1344
- type: "string",
1345
- description: "Optional: specific database name",
1346
- },
1347
- },
1348
- required: ["function_name"],
1349
- },
1350
- },
1351
- {
1352
- name: "show_create_function",
1353
- description: "Shows the CREATE statement for a function.",
1354
- inputSchema: {
1355
- type: "object",
1356
- properties: {
1357
- function_name: { type: "string", description: "Name of the function" },
1358
- database: {
1359
- type: "string",
1360
- description: "Optional: specific database name",
1361
- },
1362
- },
1363
- required: ["function_name"],
1364
- },
1365
- },
1366
- {
1367
- name: "execute_function",
1368
- description: "Executes a user-defined function and returns its result.",
1369
- inputSchema: {
1370
- type: "object",
1371
- properties: {
1372
- function_name: {
1373
- type: "string",
1374
- description: "Name of the function to execute",
1375
- },
1376
- parameters: {
1377
- type: "array",
1378
- description: "Array of parameter values",
1379
- items: {},
1380
- },
1381
- database: {
1382
- type: "string",
1383
- description: "Optional: specific database name",
1384
- },
1385
- },
1386
- required: ["function_name"],
1387
- },
1388
- },
1389
1256
  // Index Tools
1390
1257
  {
1391
1258
  name: "list_indexes",
@@ -1738,7 +1605,7 @@ const TOOLS = [
1738
1605
  },
1739
1606
  {
1740
1607
  name: "truncate_table",
1741
- description: "🗑️ DESTRUCTIVE: Removes ALL rows from a table instantly (faster than DELETE). Resets auto-increment counters. Cannot be undone! Consider backup_table first. Requires 'ddl' permission. ⚠️ WARNING: IRREVERSIBLE!",
1608
+ description: "🗑️ DESTRUCTIVE: Removes ALL rows from a table instantly (faster than DELETE). Resets auto-increment counters. Cannot be undone! Requires 'ddl' permission. ⚠️ WARNING: IRREVERSIBLE!",
1742
1609
  inputSchema: {
1743
1610
  type: "object",
1744
1611
  properties: {
@@ -1809,128 +1676,6 @@ const TOOLS = [
1809
1676
  },
1810
1677
  },
1811
1678
  },
1812
- // Backup and Restore Tools
1813
- {
1814
- name: "backup_table",
1815
- description: "Backup a single table to SQL dump format including structure and optionally data.",
1816
- inputSchema: {
1817
- type: "object",
1818
- properties: {
1819
- table_name: {
1820
- type: "string",
1821
- description: "Name of the table to backup",
1822
- },
1823
- include_data: {
1824
- type: "boolean",
1825
- description: "Include table data in the backup (default: true)",
1826
- },
1827
- include_drop: {
1828
- type: "boolean",
1829
- description: "Include DROP TABLE IF EXISTS statement (default: true)",
1830
- },
1831
- database: {
1832
- type: "string",
1833
- description: "Optional: specific database name",
1834
- },
1835
- },
1836
- required: ["table_name"],
1837
- },
1838
- },
1839
- {
1840
- name: "backup_database",
1841
- description: "💾 Creates SQL dump backup of entire database or specific tables. Includes structure and optionally data. Returns backup as SQL text. Use before major schema changes or migrations.",
1842
- inputSchema: {
1843
- type: "object",
1844
- properties: {
1845
- include_data: {
1846
- type: "boolean",
1847
- description: "Include table data in the backup (default: true)",
1848
- },
1849
- include_drop: {
1850
- type: "boolean",
1851
- description: "Include DROP TABLE IF EXISTS statements (default: true)",
1852
- },
1853
- tables: {
1854
- type: "array",
1855
- items: { type: "string" },
1856
- description: "Optional: specific tables to backup (default: all tables)",
1857
- },
1858
- database: {
1859
- type: "string",
1860
- description: "Optional: specific database name",
1861
- },
1862
- },
1863
- },
1864
- },
1865
- {
1866
- name: "restore_from_sql",
1867
- description: "Restore database from SQL dump content. Executes SQL statements from the provided dump. Requires 'ddl' permission.",
1868
- inputSchema: {
1869
- type: "object",
1870
- properties: {
1871
- sql_dump: {
1872
- type: "string",
1873
- description: "SQL dump content to restore",
1874
- },
1875
- stop_on_error: {
1876
- type: "boolean",
1877
- description: "Stop execution on first error (default: true)",
1878
- },
1879
- database: {
1880
- type: "string",
1881
- description: "Optional: specific database name",
1882
- },
1883
- },
1884
- required: ["sql_dump"],
1885
- },
1886
- },
1887
- {
1888
- name: "get_create_table_statement",
1889
- description: "Get the CREATE TABLE statement for a specific table.",
1890
- inputSchema: {
1891
- type: "object",
1892
- properties: {
1893
- table_name: {
1894
- type: "string",
1895
- description: "Name of the table",
1896
- },
1897
- database: {
1898
- type: "string",
1899
- description: "Optional: specific database name",
1900
- },
1901
- },
1902
- required: ["table_name"],
1903
- },
1904
- },
1905
- {
1906
- name: "get_database_schema",
1907
- description: "Get complete database schema including tables, views, procedures, functions, and triggers.",
1908
- inputSchema: {
1909
- type: "object",
1910
- properties: {
1911
- database: {
1912
- type: "string",
1913
- description: "Optional: specific database name",
1914
- },
1915
- include_views: {
1916
- type: "boolean",
1917
- description: "Include views in schema (default: true)",
1918
- },
1919
- include_procedures: {
1920
- type: "boolean",
1921
- description: "Include stored procedures in schema (default: true)",
1922
- },
1923
- include_functions: {
1924
- type: "boolean",
1925
- description: "Include functions in schema (default: true)",
1926
- },
1927
- include_triggers: {
1928
- type: "boolean",
1929
- description: "Include triggers in schema (default: true)",
1930
- },
1931
- },
1932
- },
1933
- },
1934
1679
  {
1935
1680
  name: "create_fulltext_index",
1936
1681
  description: "Creates a FULLTEXT index on one or more text columns in a table. Supports ngram and mecab parsers for advanced text search capabilities (useful for languages like Chinese, Japanese, Korean). Use this to enable full-text search on text columns.",
@@ -2105,7 +1850,7 @@ const TOOLS = [
2105
1850
  // Create the MCP server
2106
1851
  const server = new index_js_1.Server({
2107
1852
  name: "mysql-mcp-server",
2108
- version: "1.40.1",
1853
+ version: "1.40.3",
2109
1854
  }, {
2110
1855
  capabilities: {
2111
1856
  tools: {},
@@ -2299,25 +2044,6 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
2299
2044
  case "show_create_trigger":
2300
2045
  result = await mysqlMCP.showCreateTrigger((args || {}));
2301
2046
  break;
2302
- // Function Tools
2303
- case "list_functions":
2304
- result = await mysqlMCP.listFunctions((args || {}));
2305
- break;
2306
- case "get_function_info":
2307
- result = await mysqlMCP.getFunctionInfo((args || {}));
2308
- break;
2309
- case "create_function":
2310
- result = await mysqlMCP.createFunction((args || {}));
2311
- break;
2312
- case "drop_function":
2313
- result = await mysqlMCP.dropFunction((args || {}));
2314
- break;
2315
- case "show_create_function":
2316
- result = await mysqlMCP.showCreateFunction((args || {}));
2317
- break;
2318
- case "execute_function":
2319
- result = await mysqlMCP.executeFunction((args || {}));
2320
- break;
2321
2047
  // Index Tools
2322
2048
  case "list_indexes":
2323
2049
  result = await mysqlMCP.listIndexes((args || {}));
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mysql-mcp",
3
3
  "description": "A Model Context Protocol for MySQL database interaction",
4
- "version": "1.40.1",
4
+ "version": "1.40.3",
5
5
  "tools": [
6
6
  {
7
7
  "name": "list_databases",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@berthojoris/mcp-mysql-server",
3
- "version": "1.40.1",
4
- "description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions, backup/restore capabilities",
3
+ "version": "1.40.3",
4
+ "description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "commonjs",