@berthojoris/mcp-mysql-server 1.4.0 → 1.4.2
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 +81 -0
- package/README.md +34 -0
- package/dist/mcp-server.js +29 -29
- package/manifest.json +247 -247
- package/package.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the MySQL MCP Server will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.4.2] - 2025-01-04
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Re-published package to ensure README.md displays correctly on npmjs.com
|
|
12
|
+
- No functional changes from version 1.4.1
|
|
13
|
+
|
|
14
|
+
## [1.4.1] - 2025-01-04
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- **Critical Parameter Validation Fix**: Fixed "Invalid parameters: must be object" error that occurred when AI agents called MCP tools without parameters
|
|
18
|
+
- Applied defensive parameter handling to all 27 tools that accept parameters
|
|
19
|
+
- Tools now properly handle cases where MCP SDK passes `undefined` or `null` instead of empty object `{}`
|
|
20
|
+
- Pattern applied: `(args || {})` ensures parameters are always objects before validation
|
|
21
|
+
- No breaking changes - existing valid calls continue to work exactly as before
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Enhanced parameter handling in `mcp-server.ts` for all tool handlers:
|
|
25
|
+
- Database Tools: `list_tables`, `read_table_schema`, `get_table_relationships`
|
|
26
|
+
- CRUD Tools: `create_record`, `read_records`, `update_record`, `delete_record`, `bulk_insert`, `bulk_update`, `bulk_delete`
|
|
27
|
+
- Query Tools: `run_query`, `execute_sql`, `execute_ddl`
|
|
28
|
+
- DDL Tools: `create_table`, `alter_table`, `drop_table`
|
|
29
|
+
- Transaction Tools: `begin_transaction`, `commit_transaction`, `rollback_transaction`, `execute_in_transaction`
|
|
30
|
+
- Stored Procedure Tools: `list_stored_procedures`, `get_stored_procedure_info`, `execute_stored_procedure`, `create_stored_procedure`, `drop_stored_procedure`, `show_create_procedure`
|
|
31
|
+
- Data Export Tools: `export_table_to_csv`, `export_query_to_csv`
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
- Added troubleshooting section in README.md for parameter validation errors
|
|
35
|
+
- Created CHANGELOG.md to track version changes
|
|
36
|
+
- Documented the fix and upgrade path for users experiencing this issue
|
|
37
|
+
|
|
38
|
+
## [1.4.0] - 2024-12-XX
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- Data Export Tools (`export_table_to_csv`, `export_query_to_csv`)
|
|
42
|
+
- Bulk Operations (`bulk_insert`, `bulk_update`, `bulk_delete`)
|
|
43
|
+
- Transaction Management (5 tools)
|
|
44
|
+
- Stored Procedure Support (5 tools)
|
|
45
|
+
- Enhanced permission error messages
|
|
46
|
+
- Per-project permission configuration
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
- Improved security with fine-grained permission system
|
|
50
|
+
- Better error handling and user feedback
|
|
51
|
+
- Performance optimizations for bulk operations
|
|
52
|
+
|
|
53
|
+
## [1.3.0] - 2024-XX-XX
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
- DDL Operations (Create, Alter, Drop Table)
|
|
57
|
+
- Schema Management Tools
|
|
58
|
+
- Permission-based access control
|
|
59
|
+
- MCP protocol support
|
|
60
|
+
|
|
61
|
+
## [1.2.0] - 2024-XX-XX
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
- REST API mode
|
|
65
|
+
- Connection testing utilities
|
|
66
|
+
- Foreign key relationship discovery
|
|
67
|
+
|
|
68
|
+
## [1.1.0] - 2024-XX-XX
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
- CRUD operations
|
|
72
|
+
- Custom SQL query execution
|
|
73
|
+
- Parameterized queries
|
|
74
|
+
|
|
75
|
+
## [1.0.0] - 2024-XX-XX
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
- Initial release
|
|
79
|
+
- Basic database listing
|
|
80
|
+
- Table schema inspection
|
|
81
|
+
- MySQL connection support
|
package/README.md
CHANGED
|
@@ -1364,6 +1364,40 @@ FLUSH PRIVILEGES;
|
|
|
1364
1364
|
}
|
|
1365
1365
|
```
|
|
1366
1366
|
|
|
1367
|
+
### Parameter Validation Errors
|
|
1368
|
+
|
|
1369
|
+
**Problem:** "Invalid parameters: must be object" error
|
|
1370
|
+
|
|
1371
|
+
**Symptoms:**
|
|
1372
|
+
- Tools fail when called without parameters
|
|
1373
|
+
- Error message: `Error: Invalid parameters: [{"instancePath":"","schemaPath":"#/type","keyword":"type","params":{"type":"object"},"message":"must be object"}]`
|
|
1374
|
+
- Occurs especially with tools that have optional parameters like `list_tables`, `begin_transaction`, `list_stored_procedures`
|
|
1375
|
+
|
|
1376
|
+
**Cause:**
|
|
1377
|
+
This error occurred in earlier versions (< 1.4.1) when AI agents called MCP tools without providing parameters. The MCP SDK sometimes passes `undefined` or `null` instead of an empty object `{}`, causing JSON schema validation to fail.
|
|
1378
|
+
|
|
1379
|
+
**Solution:**
|
|
1380
|
+
✅ **Fixed in version 1.4.1+** - All 33 tools now include defensive parameter handling that automatically converts `undefined`/`null` to empty objects.
|
|
1381
|
+
|
|
1382
|
+
**If you're still experiencing this issue:**
|
|
1383
|
+
1. Update to the latest version:
|
|
1384
|
+
```bash
|
|
1385
|
+
npx -y @berthojoris/mcp-mysql-server@latest mysql://user:pass@localhost:3306/db "permissions"
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
2. If using global installation:
|
|
1389
|
+
```bash
|
|
1390
|
+
npm update -g @berthojoris/mcp-mysql-server
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
3. Restart your AI agent after updating
|
|
1394
|
+
|
|
1395
|
+
**Technical Details:**
|
|
1396
|
+
- All tool handlers now use defensive pattern: `(args || {})` to ensure parameters are always objects
|
|
1397
|
+
- This fix applies to all 27 tools that accept parameters
|
|
1398
|
+
- Tools with no parameters (like `list_databases`, `test_connection`) were not affected
|
|
1399
|
+
- No breaking changes - existing valid calls continue to work exactly as before
|
|
1400
|
+
|
|
1367
1401
|
---
|
|
1368
1402
|
|
|
1369
1403
|
## 📄 License
|
package/dist/mcp-server.js
CHANGED
|
@@ -770,7 +770,7 @@ const TOOLS = [
|
|
|
770
770
|
// Create the MCP server
|
|
771
771
|
const server = new index_js_1.Server({
|
|
772
772
|
name: 'mysql-mcp-server',
|
|
773
|
-
version: '1.
|
|
773
|
+
version: '1.4.2',
|
|
774
774
|
}, {
|
|
775
775
|
capabilities: {
|
|
776
776
|
tools: {},
|
|
@@ -792,49 +792,49 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
792
792
|
result = await mysqlMCP.listDatabases();
|
|
793
793
|
break;
|
|
794
794
|
case 'list_tables':
|
|
795
|
-
result = await mysqlMCP.listTables(args);
|
|
795
|
+
result = await mysqlMCP.listTables((args || {}));
|
|
796
796
|
break;
|
|
797
797
|
case 'read_table_schema':
|
|
798
|
-
result = await mysqlMCP.readTableSchema(args);
|
|
798
|
+
result = await mysqlMCP.readTableSchema((args || {}));
|
|
799
799
|
break;
|
|
800
800
|
case 'create_record':
|
|
801
|
-
result = await mysqlMCP.createRecord(args);
|
|
801
|
+
result = await mysqlMCP.createRecord((args || {}));
|
|
802
802
|
break;
|
|
803
803
|
case 'read_records':
|
|
804
|
-
result = await mysqlMCP.readRecords(args);
|
|
804
|
+
result = await mysqlMCP.readRecords((args || {}));
|
|
805
805
|
break;
|
|
806
806
|
case 'update_record':
|
|
807
|
-
result = await mysqlMCP.updateRecord(args);
|
|
807
|
+
result = await mysqlMCP.updateRecord((args || {}));
|
|
808
808
|
break;
|
|
809
809
|
case 'delete_record':
|
|
810
|
-
result = await mysqlMCP.deleteRecord(args);
|
|
810
|
+
result = await mysqlMCP.deleteRecord((args || {}));
|
|
811
811
|
break;
|
|
812
812
|
case 'bulk_insert':
|
|
813
|
-
result = await mysqlMCP.bulkInsert(args);
|
|
813
|
+
result = await mysqlMCP.bulkInsert((args || {}));
|
|
814
814
|
break;
|
|
815
815
|
case 'bulk_update':
|
|
816
|
-
result = await mysqlMCP.bulkUpdate(args);
|
|
816
|
+
result = await mysqlMCP.bulkUpdate((args || {}));
|
|
817
817
|
break;
|
|
818
818
|
case 'bulk_delete':
|
|
819
|
-
result = await mysqlMCP.bulkDelete(args);
|
|
819
|
+
result = await mysqlMCP.bulkDelete((args || {}));
|
|
820
820
|
break;
|
|
821
821
|
case 'run_query':
|
|
822
|
-
result = await mysqlMCP.runQuery(args);
|
|
822
|
+
result = await mysqlMCP.runQuery((args || {}));
|
|
823
823
|
break;
|
|
824
824
|
case 'execute_sql':
|
|
825
|
-
result = await mysqlMCP.executeSql(args);
|
|
825
|
+
result = await mysqlMCP.executeSql((args || {}));
|
|
826
826
|
break;
|
|
827
827
|
case 'create_table':
|
|
828
|
-
result = await mysqlMCP.createTable(args);
|
|
828
|
+
result = await mysqlMCP.createTable(args || {});
|
|
829
829
|
break;
|
|
830
830
|
case 'alter_table':
|
|
831
|
-
result = await mysqlMCP.alterTable(args);
|
|
831
|
+
result = await mysqlMCP.alterTable(args || {});
|
|
832
832
|
break;
|
|
833
833
|
case 'drop_table':
|
|
834
|
-
result = await mysqlMCP.dropTable(args);
|
|
834
|
+
result = await mysqlMCP.dropTable(args || {});
|
|
835
835
|
break;
|
|
836
836
|
case 'execute_ddl':
|
|
837
|
-
result = await mysqlMCP.executeDdl(args);
|
|
837
|
+
result = await mysqlMCP.executeDdl((args || {}));
|
|
838
838
|
break;
|
|
839
839
|
case 'describe_connection':
|
|
840
840
|
result = await mysqlMCP.describeConnection();
|
|
@@ -843,49 +843,49 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
843
843
|
result = await mysqlMCP.testConnection();
|
|
844
844
|
break;
|
|
845
845
|
case 'get_table_relationships':
|
|
846
|
-
result = await mysqlMCP.getTableRelationships(args);
|
|
846
|
+
result = await mysqlMCP.getTableRelationships((args || {}));
|
|
847
847
|
break;
|
|
848
848
|
// Transaction Tools
|
|
849
849
|
case 'begin_transaction':
|
|
850
|
-
result = await mysqlMCP.beginTransaction(args);
|
|
850
|
+
result = await mysqlMCP.beginTransaction((args || {}));
|
|
851
851
|
break;
|
|
852
852
|
case 'commit_transaction':
|
|
853
|
-
result = await mysqlMCP.commitTransaction(args);
|
|
853
|
+
result = await mysqlMCP.commitTransaction((args || {}));
|
|
854
854
|
break;
|
|
855
855
|
case 'rollback_transaction':
|
|
856
|
-
result = await mysqlMCP.rollbackTransaction(args);
|
|
856
|
+
result = await mysqlMCP.rollbackTransaction((args || {}));
|
|
857
857
|
break;
|
|
858
858
|
case 'get_transaction_status':
|
|
859
859
|
result = await mysqlMCP.getTransactionStatus();
|
|
860
860
|
break;
|
|
861
861
|
case 'execute_in_transaction':
|
|
862
|
-
result = await mysqlMCP.executeInTransaction(args);
|
|
862
|
+
result = await mysqlMCP.executeInTransaction((args || {}));
|
|
863
863
|
break;
|
|
864
864
|
// Stored Procedure Tools
|
|
865
865
|
case 'list_stored_procedures':
|
|
866
|
-
result = await mysqlMCP.listStoredProcedures(args);
|
|
866
|
+
result = await mysqlMCP.listStoredProcedures((args || {}));
|
|
867
867
|
break;
|
|
868
868
|
case 'get_stored_procedure_info':
|
|
869
|
-
result = await mysqlMCP.getStoredProcedureInfo(args);
|
|
869
|
+
result = await mysqlMCP.getStoredProcedureInfo((args || {}));
|
|
870
870
|
break;
|
|
871
871
|
case 'execute_stored_procedure':
|
|
872
|
-
result = await mysqlMCP.executeStoredProcedure(args);
|
|
872
|
+
result = await mysqlMCP.executeStoredProcedure((args || {}));
|
|
873
873
|
break;
|
|
874
874
|
case 'create_stored_procedure':
|
|
875
|
-
result = await mysqlMCP.createStoredProcedure(args);
|
|
875
|
+
result = await mysqlMCP.createStoredProcedure((args || {}));
|
|
876
876
|
break;
|
|
877
877
|
case 'drop_stored_procedure':
|
|
878
|
-
result = await mysqlMCP.dropStoredProcedure(args);
|
|
878
|
+
result = await mysqlMCP.dropStoredProcedure((args || {}));
|
|
879
879
|
break;
|
|
880
880
|
case 'show_create_procedure':
|
|
881
|
-
result = await mysqlMCP.showCreateProcedure(args);
|
|
881
|
+
result = await mysqlMCP.showCreateProcedure((args || {}));
|
|
882
882
|
break;
|
|
883
883
|
// Data Export Tools
|
|
884
884
|
case 'export_table_to_csv':
|
|
885
|
-
result = await mysqlMCP.exportTableToCSV(args);
|
|
885
|
+
result = await mysqlMCP.exportTableToCSV((args || {}));
|
|
886
886
|
break;
|
|
887
887
|
case 'export_query_to_csv':
|
|
888
|
-
result = await mysqlMCP.exportQueryToCSV(args);
|
|
888
|
+
result = await mysqlMCP.exportQueryToCSV((args || {}));
|
|
889
889
|
break;
|
|
890
890
|
default:
|
|
891
891
|
throw new Error(`Unknown tool: ${name}`);
|
package/manifest.json
CHANGED
|
@@ -1,248 +1,248 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mysql-mcp",
|
|
3
|
-
"description": "A Model Context Protocol for MySQL database interaction",
|
|
4
|
-
"version": "1.2.6",
|
|
5
|
-
"tools": [
|
|
6
|
-
{
|
|
7
|
-
"name": "list_databases",
|
|
8
|
-
"description": "Lists all databases available on the MySQL server.",
|
|
9
|
-
"input_schema": {},
|
|
10
|
-
"output_schema": {
|
|
11
|
-
"type": "array",
|
|
12
|
-
"items": { "type": "string" }
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "list_tables",
|
|
17
|
-
"description": "Lists all tables in the connected MySQL database.",
|
|
18
|
-
"input_schema": {},
|
|
19
|
-
"output_schema": {
|
|
20
|
-
"type": "array",
|
|
21
|
-
"items": { "type": "string" }
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "read_table_schema",
|
|
26
|
-
"description": "Reads the schema of a specified table.",
|
|
27
|
-
"input_schema": {
|
|
28
|
-
"type": "object",
|
|
29
|
-
"properties": {
|
|
30
|
-
"table_name": { "type": "string" }
|
|
31
|
-
},
|
|
32
|
-
"required": ["table_name"]
|
|
33
|
-
},
|
|
34
|
-
"output_schema": {
|
|
35
|
-
"type": "object",
|
|
36
|
-
"properties": {
|
|
37
|
-
"columns": {
|
|
38
|
-
"type": "array",
|
|
39
|
-
"items": {
|
|
40
|
-
"type": "object",
|
|
41
|
-
"properties": {
|
|
42
|
-
"name": { "type": "string" },
|
|
43
|
-
"type": { "type": "string" },
|
|
44
|
-
"nullable": { "type": "boolean" },
|
|
45
|
-
"default": { "type": ["string", "null"] },
|
|
46
|
-
"primary_key": { "type": "boolean" }
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"primary_key": { "type": ["string", "null"] },
|
|
51
|
-
"indexes": {
|
|
52
|
-
"type": "array",
|
|
53
|
-
"items": { "type": "string" }
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "create_record",
|
|
60
|
-
"description": "Creates a new record in the specified table.",
|
|
61
|
-
"input_schema": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"properties": {
|
|
64
|
-
"table_name": { "type": "string" },
|
|
65
|
-
"data": { "type": "object" }
|
|
66
|
-
},
|
|
67
|
-
"required": ["table_name", "data"]
|
|
68
|
-
},
|
|
69
|
-
"output_schema": {
|
|
70
|
-
"type": "object",
|
|
71
|
-
"properties": {
|
|
72
|
-
"success": { "type": "boolean" },
|
|
73
|
-
"id": { "type": ["string", "number"] },
|
|
74
|
-
"affected_rows": { "type": "number" }
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "read_records",
|
|
80
|
-
"description": "Reads records from the specified table with optional filtering, pagination, and sorting.",
|
|
81
|
-
"input_schema": {
|
|
82
|
-
"type": "object",
|
|
83
|
-
"properties": {
|
|
84
|
-
"table_name": { "type": "string" },
|
|
85
|
-
"filters": { "type": "object" },
|
|
86
|
-
"limit": { "type": "number" },
|
|
87
|
-
"offset": { "type": "number" },
|
|
88
|
-
"sort_by": { "type": "string" },
|
|
89
|
-
"sort_direction": { "type": "string", "enum": ["ASC", "DESC"] }
|
|
90
|
-
},
|
|
91
|
-
"required": ["table_name"]
|
|
92
|
-
},
|
|
93
|
-
"output_schema": {
|
|
94
|
-
"type": "object",
|
|
95
|
-
"properties": {
|
|
96
|
-
"records": { "type": "array" },
|
|
97
|
-
"total": { "type": "number" }
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "update_record",
|
|
103
|
-
"description": "Updates an existing record in the specified table.",
|
|
104
|
-
"input_schema": {
|
|
105
|
-
"type": "object",
|
|
106
|
-
"properties": {
|
|
107
|
-
"table_name": { "type": "string" },
|
|
108
|
-
"id_field": { "type": "string" },
|
|
109
|
-
"id": { "type": ["string", "number"] },
|
|
110
|
-
"data": { "type": "object" }
|
|
111
|
-
},
|
|
112
|
-
"required": ["table_name", "id", "data"]
|
|
113
|
-
},
|
|
114
|
-
"output_schema": {
|
|
115
|
-
"type": "object",
|
|
116
|
-
"properties": {
|
|
117
|
-
"success": { "type": "boolean" },
|
|
118
|
-
"affected_rows": { "type": "number" }
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"name": "delete_record",
|
|
124
|
-
"description": "Deletes a record from the specified table.",
|
|
125
|
-
"input_schema": {
|
|
126
|
-
"type": "object",
|
|
127
|
-
"properties": {
|
|
128
|
-
"table_name": { "type": "string" },
|
|
129
|
-
"id_field": { "type": "string" },
|
|
130
|
-
"id": { "type": ["string", "number"] }
|
|
131
|
-
},
|
|
132
|
-
"required": ["table_name", "id"]
|
|
133
|
-
},
|
|
134
|
-
"output_schema": {
|
|
135
|
-
"type": "object",
|
|
136
|
-
"properties": {
|
|
137
|
-
"success": { "type": "boolean" },
|
|
138
|
-
"affected_rows": { "type": "number" }
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"name": "run_query",
|
|
144
|
-
"description": "Runs a read-only SQL query with optional parameters.",
|
|
145
|
-
"input_schema": {
|
|
146
|
-
"type": "object",
|
|
147
|
-
"properties": {
|
|
148
|
-
"query": { "type": "string" },
|
|
149
|
-
"params": { "type": "array" }
|
|
150
|
-
},
|
|
151
|
-
"required": ["query"]
|
|
152
|
-
},
|
|
153
|
-
"output_schema": {
|
|
154
|
-
"type": "object",
|
|
155
|
-
"properties": {
|
|
156
|
-
"results": { "type": "array" },
|
|
157
|
-
"fields": { "type": "array" }
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"name": "execute_sql",
|
|
163
|
-
"description": "Executes a write SQL operation (INSERT, UPDATE, DELETE) with optional parameters.",
|
|
164
|
-
"input_schema": {
|
|
165
|
-
"type": "object",
|
|
166
|
-
"properties": {
|
|
167
|
-
"query": { "type": "string" },
|
|
168
|
-
"params": { "type": "array" }
|
|
169
|
-
},
|
|
170
|
-
"required": ["query"]
|
|
171
|
-
},
|
|
172
|
-
"output_schema": {
|
|
173
|
-
"type": "object",
|
|
174
|
-
"properties": {
|
|
175
|
-
"success": { "type": "boolean" },
|
|
176
|
-
"affected_rows": { "type": "number" },
|
|
177
|
-
"insert_id": { "type": ["number", "null"] }
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"name": "describe_connection",
|
|
183
|
-
"description": "Returns information about the current database connection.",
|
|
184
|
-
"input_schema": {},
|
|
185
|
-
"output_schema": {
|
|
186
|
-
"type": "object",
|
|
187
|
-
"properties": {
|
|
188
|
-
"host": { "type": "string" },
|
|
189
|
-
"port": { "type": "number" },
|
|
190
|
-
"database": { "type": "string" },
|
|
191
|
-
"user": { "type": "string" },
|
|
192
|
-
"connected": { "type": "boolean" }
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"name": "test_connection",
|
|
198
|
-
"description": "Tests the database connection and returns latency information.",
|
|
199
|
-
"input_schema": {},
|
|
200
|
-
"output_schema": {
|
|
201
|
-
"type": "object",
|
|
202
|
-
"properties": {
|
|
203
|
-
"success": { "type": "boolean" },
|
|
204
|
-
"latency_ms": { "type": "number" },
|
|
205
|
-
"message": { "type": "string" }
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"name": "get_table_relationships",
|
|
211
|
-
"description": "Returns foreign key relationships for a specified table.",
|
|
212
|
-
"input_schema": {
|
|
213
|
-
"type": "object",
|
|
214
|
-
"properties": {
|
|
215
|
-
"table_name": { "type": "string" }
|
|
216
|
-
},
|
|
217
|
-
"required": ["table_name"]
|
|
218
|
-
},
|
|
219
|
-
"output_schema": {
|
|
220
|
-
"type": "object",
|
|
221
|
-
"properties": {
|
|
222
|
-
"as_parent": {
|
|
223
|
-
"type": "array",
|
|
224
|
-
"items": {
|
|
225
|
-
"type": "object",
|
|
226
|
-
"properties": {
|
|
227
|
-
"table": { "type": "string" },
|
|
228
|
-
"column": { "type": "string" },
|
|
229
|
-
"referenced_column": { "type": "string" }
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"as_child": {
|
|
234
|
-
"type": "array",
|
|
235
|
-
"items": {
|
|
236
|
-
"type": "object",
|
|
237
|
-
"properties": {
|
|
238
|
-
"table": { "type": "string" },
|
|
239
|
-
"column": { "type": "string" },
|
|
240
|
-
"referenced_column": { "type": "string" }
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "mysql-mcp",
|
|
3
|
+
"description": "A Model Context Protocol for MySQL database interaction",
|
|
4
|
+
"version": "1.2.6",
|
|
5
|
+
"tools": [
|
|
6
|
+
{
|
|
7
|
+
"name": "list_databases",
|
|
8
|
+
"description": "Lists all databases available on the MySQL server.",
|
|
9
|
+
"input_schema": {},
|
|
10
|
+
"output_schema": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": { "type": "string" }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "list_tables",
|
|
17
|
+
"description": "Lists all tables in the connected MySQL database.",
|
|
18
|
+
"input_schema": {},
|
|
19
|
+
"output_schema": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": { "type": "string" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "read_table_schema",
|
|
26
|
+
"description": "Reads the schema of a specified table.",
|
|
27
|
+
"input_schema": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"table_name": { "type": "string" }
|
|
31
|
+
},
|
|
32
|
+
"required": ["table_name"]
|
|
33
|
+
},
|
|
34
|
+
"output_schema": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"properties": {
|
|
37
|
+
"columns": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"name": { "type": "string" },
|
|
43
|
+
"type": { "type": "string" },
|
|
44
|
+
"nullable": { "type": "boolean" },
|
|
45
|
+
"default": { "type": ["string", "null"] },
|
|
46
|
+
"primary_key": { "type": "boolean" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"primary_key": { "type": ["string", "null"] },
|
|
51
|
+
"indexes": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": { "type": "string" }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "create_record",
|
|
60
|
+
"description": "Creates a new record in the specified table.",
|
|
61
|
+
"input_schema": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"table_name": { "type": "string" },
|
|
65
|
+
"data": { "type": "object" }
|
|
66
|
+
},
|
|
67
|
+
"required": ["table_name", "data"]
|
|
68
|
+
},
|
|
69
|
+
"output_schema": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"success": { "type": "boolean" },
|
|
73
|
+
"id": { "type": ["string", "number"] },
|
|
74
|
+
"affected_rows": { "type": "number" }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "read_records",
|
|
80
|
+
"description": "Reads records from the specified table with optional filtering, pagination, and sorting.",
|
|
81
|
+
"input_schema": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"table_name": { "type": "string" },
|
|
85
|
+
"filters": { "type": "object" },
|
|
86
|
+
"limit": { "type": "number" },
|
|
87
|
+
"offset": { "type": "number" },
|
|
88
|
+
"sort_by": { "type": "string" },
|
|
89
|
+
"sort_direction": { "type": "string", "enum": ["ASC", "DESC"] }
|
|
90
|
+
},
|
|
91
|
+
"required": ["table_name"]
|
|
92
|
+
},
|
|
93
|
+
"output_schema": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"properties": {
|
|
96
|
+
"records": { "type": "array" },
|
|
97
|
+
"total": { "type": "number" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "update_record",
|
|
103
|
+
"description": "Updates an existing record in the specified table.",
|
|
104
|
+
"input_schema": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"table_name": { "type": "string" },
|
|
108
|
+
"id_field": { "type": "string" },
|
|
109
|
+
"id": { "type": ["string", "number"] },
|
|
110
|
+
"data": { "type": "object" }
|
|
111
|
+
},
|
|
112
|
+
"required": ["table_name", "id", "data"]
|
|
113
|
+
},
|
|
114
|
+
"output_schema": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"properties": {
|
|
117
|
+
"success": { "type": "boolean" },
|
|
118
|
+
"affected_rows": { "type": "number" }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "delete_record",
|
|
124
|
+
"description": "Deletes a record from the specified table.",
|
|
125
|
+
"input_schema": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"table_name": { "type": "string" },
|
|
129
|
+
"id_field": { "type": "string" },
|
|
130
|
+
"id": { "type": ["string", "number"] }
|
|
131
|
+
},
|
|
132
|
+
"required": ["table_name", "id"]
|
|
133
|
+
},
|
|
134
|
+
"output_schema": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {
|
|
137
|
+
"success": { "type": "boolean" },
|
|
138
|
+
"affected_rows": { "type": "number" }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "run_query",
|
|
144
|
+
"description": "Runs a read-only SQL query with optional parameters.",
|
|
145
|
+
"input_schema": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"query": { "type": "string" },
|
|
149
|
+
"params": { "type": "array" }
|
|
150
|
+
},
|
|
151
|
+
"required": ["query"]
|
|
152
|
+
},
|
|
153
|
+
"output_schema": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"results": { "type": "array" },
|
|
157
|
+
"fields": { "type": "array" }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "execute_sql",
|
|
163
|
+
"description": "Executes a write SQL operation (INSERT, UPDATE, DELETE) with optional parameters.",
|
|
164
|
+
"input_schema": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"properties": {
|
|
167
|
+
"query": { "type": "string" },
|
|
168
|
+
"params": { "type": "array" }
|
|
169
|
+
},
|
|
170
|
+
"required": ["query"]
|
|
171
|
+
},
|
|
172
|
+
"output_schema": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"properties": {
|
|
175
|
+
"success": { "type": "boolean" },
|
|
176
|
+
"affected_rows": { "type": "number" },
|
|
177
|
+
"insert_id": { "type": ["number", "null"] }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "describe_connection",
|
|
183
|
+
"description": "Returns information about the current database connection.",
|
|
184
|
+
"input_schema": {},
|
|
185
|
+
"output_schema": {
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"host": { "type": "string" },
|
|
189
|
+
"port": { "type": "number" },
|
|
190
|
+
"database": { "type": "string" },
|
|
191
|
+
"user": { "type": "string" },
|
|
192
|
+
"connected": { "type": "boolean" }
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "test_connection",
|
|
198
|
+
"description": "Tests the database connection and returns latency information.",
|
|
199
|
+
"input_schema": {},
|
|
200
|
+
"output_schema": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"success": { "type": "boolean" },
|
|
204
|
+
"latency_ms": { "type": "number" },
|
|
205
|
+
"message": { "type": "string" }
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "get_table_relationships",
|
|
211
|
+
"description": "Returns foreign key relationships for a specified table.",
|
|
212
|
+
"input_schema": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"properties": {
|
|
215
|
+
"table_name": { "type": "string" }
|
|
216
|
+
},
|
|
217
|
+
"required": ["table_name"]
|
|
218
|
+
},
|
|
219
|
+
"output_schema": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"properties": {
|
|
222
|
+
"as_parent": {
|
|
223
|
+
"type": "array",
|
|
224
|
+
"items": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"properties": {
|
|
227
|
+
"table": { "type": "string" },
|
|
228
|
+
"column": { "type": "string" },
|
|
229
|
+
"referenced_column": { "type": "string" }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"as_child": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"table": { "type": "string" },
|
|
239
|
+
"column": { "type": "string" },
|
|
240
|
+
"referenced_column": { "type": "string" }
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
248
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@berthojoris/mcp-mysql-server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions and data export capabilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dist",
|
|
50
50
|
"bin",
|
|
51
51
|
"README.md",
|
|
52
|
+
"CHANGELOG.md",
|
|
52
53
|
"LICENSE",
|
|
53
54
|
"manifest.json"
|
|
54
55
|
],
|