@berthojoris/mcp-mysql-server 1.12.0 → 1.14.0
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 +56 -40
- package/DOCUMENTATIONS.md +94 -12
- package/README.md +12 -9
- package/dist/index.d.ts +11 -0
- package/dist/index.js +10 -0
- package/dist/mcp-server.js +22 -31
- package/dist/optimization/explainAnalyzer.d.ts +21 -0
- package/dist/optimization/explainAnalyzer.js +147 -0
- package/dist/security/maskingLayer.d.ts +37 -0
- package/dist/security/maskingLayer.js +131 -0
- package/dist/security/securityLayer.d.ts +2 -0
- package/dist/security/securityLayer.js +4 -0
- package/dist/tools/aiTools.d.ts +22 -0
- package/dist/tools/aiTools.js +80 -0
- package/dist/tools/crudTools.js +2 -2
- package/dist/tools/queryTools.js +2 -1
- package/manifest.json +312 -82
- package/package.json +2 -2
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.
|
|
4
|
+
"version": "1.13.0",
|
|
5
5
|
"tools": [
|
|
6
6
|
{
|
|
7
7
|
"name": "list_databases",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"input_schema": {},
|
|
10
10
|
"output_schema": {
|
|
11
11
|
"type": "array",
|
|
12
|
-
"items": {
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
17
|
{
|
|
@@ -18,7 +20,9 @@
|
|
|
18
20
|
"input_schema": {},
|
|
19
21
|
"output_schema": {
|
|
20
22
|
"type": "array",
|
|
21
|
-
"items": {
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
{
|
|
@@ -27,9 +31,13 @@
|
|
|
27
31
|
"input_schema": {
|
|
28
32
|
"type": "object",
|
|
29
33
|
"properties": {
|
|
30
|
-
"table_name": {
|
|
34
|
+
"table_name": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
}
|
|
31
37
|
},
|
|
32
|
-
"required": [
|
|
38
|
+
"required": [
|
|
39
|
+
"table_name"
|
|
40
|
+
]
|
|
33
41
|
},
|
|
34
42
|
"output_schema": {
|
|
35
43
|
"type": "object",
|
|
@@ -39,18 +47,38 @@
|
|
|
39
47
|
"items": {
|
|
40
48
|
"type": "object",
|
|
41
49
|
"properties": {
|
|
42
|
-
"name": {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
50
|
+
"name": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"type": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"nullable": {
|
|
57
|
+
"type": "boolean"
|
|
58
|
+
},
|
|
59
|
+
"default": {
|
|
60
|
+
"type": [
|
|
61
|
+
"string",
|
|
62
|
+
"null"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"primary_key": {
|
|
66
|
+
"type": "boolean"
|
|
67
|
+
}
|
|
47
68
|
}
|
|
48
69
|
}
|
|
49
70
|
},
|
|
50
|
-
"primary_key": {
|
|
71
|
+
"primary_key": {
|
|
72
|
+
"type": [
|
|
73
|
+
"string",
|
|
74
|
+
"null"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
51
77
|
"indexes": {
|
|
52
78
|
"type": "array",
|
|
53
|
-
"items": {
|
|
79
|
+
"items": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
54
82
|
}
|
|
55
83
|
}
|
|
56
84
|
}
|
|
@@ -61,17 +89,33 @@
|
|
|
61
89
|
"input_schema": {
|
|
62
90
|
"type": "object",
|
|
63
91
|
"properties": {
|
|
64
|
-
"table_name": {
|
|
65
|
-
|
|
92
|
+
"table_name": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"data": {
|
|
96
|
+
"type": "object"
|
|
97
|
+
}
|
|
66
98
|
},
|
|
67
|
-
"required": [
|
|
99
|
+
"required": [
|
|
100
|
+
"table_name",
|
|
101
|
+
"data"
|
|
102
|
+
]
|
|
68
103
|
},
|
|
69
104
|
"output_schema": {
|
|
70
105
|
"type": "object",
|
|
71
106
|
"properties": {
|
|
72
|
-
"success": {
|
|
73
|
-
|
|
74
|
-
|
|
107
|
+
"success": {
|
|
108
|
+
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"id": {
|
|
111
|
+
"type": [
|
|
112
|
+
"string",
|
|
113
|
+
"number"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"affected_rows": {
|
|
117
|
+
"type": "number"
|
|
118
|
+
}
|
|
75
119
|
}
|
|
76
120
|
}
|
|
77
121
|
},
|
|
@@ -81,20 +125,42 @@
|
|
|
81
125
|
"input_schema": {
|
|
82
126
|
"type": "object",
|
|
83
127
|
"properties": {
|
|
84
|
-
"table_name": {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
128
|
+
"table_name": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"filters": {
|
|
132
|
+
"type": "object"
|
|
133
|
+
},
|
|
134
|
+
"limit": {
|
|
135
|
+
"type": "number"
|
|
136
|
+
},
|
|
137
|
+
"offset": {
|
|
138
|
+
"type": "number"
|
|
139
|
+
},
|
|
140
|
+
"sort_by": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"sort_direction": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"enum": [
|
|
146
|
+
"ASC",
|
|
147
|
+
"DESC"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
90
150
|
},
|
|
91
|
-
"required": [
|
|
151
|
+
"required": [
|
|
152
|
+
"table_name"
|
|
153
|
+
]
|
|
92
154
|
},
|
|
93
155
|
"output_schema": {
|
|
94
156
|
"type": "object",
|
|
95
157
|
"properties": {
|
|
96
|
-
"records": {
|
|
97
|
-
|
|
158
|
+
"records": {
|
|
159
|
+
"type": "array"
|
|
160
|
+
},
|
|
161
|
+
"total": {
|
|
162
|
+
"type": "number"
|
|
163
|
+
}
|
|
98
164
|
}
|
|
99
165
|
}
|
|
100
166
|
},
|
|
@@ -104,18 +170,37 @@
|
|
|
104
170
|
"input_schema": {
|
|
105
171
|
"type": "object",
|
|
106
172
|
"properties": {
|
|
107
|
-
"table_name": {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
173
|
+
"table_name": {
|
|
174
|
+
"type": "string"
|
|
175
|
+
},
|
|
176
|
+
"id_field": {
|
|
177
|
+
"type": "string"
|
|
178
|
+
},
|
|
179
|
+
"id": {
|
|
180
|
+
"type": [
|
|
181
|
+
"string",
|
|
182
|
+
"number"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"data": {
|
|
186
|
+
"type": "object"
|
|
187
|
+
}
|
|
111
188
|
},
|
|
112
|
-
"required": [
|
|
189
|
+
"required": [
|
|
190
|
+
"table_name",
|
|
191
|
+
"id",
|
|
192
|
+
"data"
|
|
193
|
+
]
|
|
113
194
|
},
|
|
114
195
|
"output_schema": {
|
|
115
196
|
"type": "object",
|
|
116
197
|
"properties": {
|
|
117
|
-
"success": {
|
|
118
|
-
|
|
198
|
+
"success": {
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
},
|
|
201
|
+
"affected_rows": {
|
|
202
|
+
"type": "number"
|
|
203
|
+
}
|
|
119
204
|
}
|
|
120
205
|
}
|
|
121
206
|
},
|
|
@@ -125,17 +210,33 @@
|
|
|
125
210
|
"input_schema": {
|
|
126
211
|
"type": "object",
|
|
127
212
|
"properties": {
|
|
128
|
-
"table_name": {
|
|
129
|
-
|
|
130
|
-
|
|
213
|
+
"table_name": {
|
|
214
|
+
"type": "string"
|
|
215
|
+
},
|
|
216
|
+
"id_field": {
|
|
217
|
+
"type": "string"
|
|
218
|
+
},
|
|
219
|
+
"id": {
|
|
220
|
+
"type": [
|
|
221
|
+
"string",
|
|
222
|
+
"number"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
131
225
|
},
|
|
132
|
-
"required": [
|
|
226
|
+
"required": [
|
|
227
|
+
"table_name",
|
|
228
|
+
"id"
|
|
229
|
+
]
|
|
133
230
|
},
|
|
134
231
|
"output_schema": {
|
|
135
232
|
"type": "object",
|
|
136
233
|
"properties": {
|
|
137
|
-
"success": {
|
|
138
|
-
|
|
234
|
+
"success": {
|
|
235
|
+
"type": "boolean"
|
|
236
|
+
},
|
|
237
|
+
"affected_rows": {
|
|
238
|
+
"type": "number"
|
|
239
|
+
}
|
|
139
240
|
}
|
|
140
241
|
}
|
|
141
242
|
},
|
|
@@ -145,16 +246,26 @@
|
|
|
145
246
|
"input_schema": {
|
|
146
247
|
"type": "object",
|
|
147
248
|
"properties": {
|
|
148
|
-
"query": {
|
|
149
|
-
|
|
249
|
+
"query": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
},
|
|
252
|
+
"params": {
|
|
253
|
+
"type": "array"
|
|
254
|
+
}
|
|
150
255
|
},
|
|
151
|
-
"required": [
|
|
256
|
+
"required": [
|
|
257
|
+
"query"
|
|
258
|
+
]
|
|
152
259
|
},
|
|
153
260
|
"output_schema": {
|
|
154
261
|
"type": "object",
|
|
155
262
|
"properties": {
|
|
156
|
-
"results": {
|
|
157
|
-
|
|
263
|
+
"results": {
|
|
264
|
+
"type": "array"
|
|
265
|
+
},
|
|
266
|
+
"fields": {
|
|
267
|
+
"type": "array"
|
|
268
|
+
}
|
|
158
269
|
}
|
|
159
270
|
}
|
|
160
271
|
},
|
|
@@ -164,17 +275,32 @@
|
|
|
164
275
|
"input_schema": {
|
|
165
276
|
"type": "object",
|
|
166
277
|
"properties": {
|
|
167
|
-
"query": {
|
|
168
|
-
|
|
278
|
+
"query": {
|
|
279
|
+
"type": "string"
|
|
280
|
+
},
|
|
281
|
+
"params": {
|
|
282
|
+
"type": "array"
|
|
283
|
+
}
|
|
169
284
|
},
|
|
170
|
-
"required": [
|
|
285
|
+
"required": [
|
|
286
|
+
"query"
|
|
287
|
+
]
|
|
171
288
|
},
|
|
172
289
|
"output_schema": {
|
|
173
290
|
"type": "object",
|
|
174
291
|
"properties": {
|
|
175
|
-
"success": {
|
|
176
|
-
|
|
177
|
-
|
|
292
|
+
"success": {
|
|
293
|
+
"type": "boolean"
|
|
294
|
+
},
|
|
295
|
+
"affected_rows": {
|
|
296
|
+
"type": "number"
|
|
297
|
+
},
|
|
298
|
+
"insert_id": {
|
|
299
|
+
"type": [
|
|
300
|
+
"number",
|
|
301
|
+
"null"
|
|
302
|
+
]
|
|
303
|
+
}
|
|
178
304
|
}
|
|
179
305
|
}
|
|
180
306
|
},
|
|
@@ -185,11 +311,21 @@
|
|
|
185
311
|
"output_schema": {
|
|
186
312
|
"type": "object",
|
|
187
313
|
"properties": {
|
|
188
|
-
"host": {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"
|
|
192
|
-
|
|
314
|
+
"host": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"port": {
|
|
318
|
+
"type": "number"
|
|
319
|
+
},
|
|
320
|
+
"database": {
|
|
321
|
+
"type": "string"
|
|
322
|
+
},
|
|
323
|
+
"user": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"connected": {
|
|
327
|
+
"type": "boolean"
|
|
328
|
+
}
|
|
193
329
|
}
|
|
194
330
|
}
|
|
195
331
|
},
|
|
@@ -200,9 +336,15 @@
|
|
|
200
336
|
"output_schema": {
|
|
201
337
|
"type": "object",
|
|
202
338
|
"properties": {
|
|
203
|
-
"success": {
|
|
204
|
-
|
|
205
|
-
|
|
339
|
+
"success": {
|
|
340
|
+
"type": "boolean"
|
|
341
|
+
},
|
|
342
|
+
"latency_ms": {
|
|
343
|
+
"type": "number"
|
|
344
|
+
},
|
|
345
|
+
"message": {
|
|
346
|
+
"type": "string"
|
|
347
|
+
}
|
|
206
348
|
}
|
|
207
349
|
}
|
|
208
350
|
},
|
|
@@ -212,9 +354,13 @@
|
|
|
212
354
|
"input_schema": {
|
|
213
355
|
"type": "object",
|
|
214
356
|
"properties": {
|
|
215
|
-
"table_name": {
|
|
357
|
+
"table_name": {
|
|
358
|
+
"type": "string"
|
|
359
|
+
}
|
|
216
360
|
},
|
|
217
|
-
"required": [
|
|
361
|
+
"required": [
|
|
362
|
+
"table_name"
|
|
363
|
+
]
|
|
218
364
|
},
|
|
219
365
|
"output_schema": {
|
|
220
366
|
"type": "object",
|
|
@@ -224,9 +370,15 @@
|
|
|
224
370
|
"items": {
|
|
225
371
|
"type": "object",
|
|
226
372
|
"properties": {
|
|
227
|
-
"table": {
|
|
228
|
-
|
|
229
|
-
|
|
373
|
+
"table": {
|
|
374
|
+
"type": "string"
|
|
375
|
+
},
|
|
376
|
+
"column": {
|
|
377
|
+
"type": "string"
|
|
378
|
+
},
|
|
379
|
+
"referenced_column": {
|
|
380
|
+
"type": "string"
|
|
381
|
+
}
|
|
230
382
|
}
|
|
231
383
|
}
|
|
232
384
|
},
|
|
@@ -235,9 +387,15 @@
|
|
|
235
387
|
"items": {
|
|
236
388
|
"type": "object",
|
|
237
389
|
"properties": {
|
|
238
|
-
"table": {
|
|
239
|
-
|
|
240
|
-
|
|
390
|
+
"table": {
|
|
391
|
+
"type": "string"
|
|
392
|
+
},
|
|
393
|
+
"column": {
|
|
394
|
+
"type": "string"
|
|
395
|
+
},
|
|
396
|
+
"referenced_column": {
|
|
397
|
+
"type": "string"
|
|
398
|
+
}
|
|
241
399
|
}
|
|
242
400
|
}
|
|
243
401
|
}
|
|
@@ -250,18 +408,36 @@
|
|
|
250
408
|
"input_schema": {
|
|
251
409
|
"type": "object",
|
|
252
410
|
"properties": {
|
|
253
|
-
"database": {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
411
|
+
"database": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"description": "Optional specific database name"
|
|
414
|
+
},
|
|
415
|
+
"max_tables": {
|
|
416
|
+
"type": "number",
|
|
417
|
+
"description": "Max tables to include (default 50, max 200)"
|
|
418
|
+
},
|
|
419
|
+
"max_columns": {
|
|
420
|
+
"type": "number",
|
|
421
|
+
"description": "Max columns per table (default 12, max 200)"
|
|
422
|
+
},
|
|
423
|
+
"include_relationships": {
|
|
424
|
+
"type": "boolean",
|
|
425
|
+
"description": "Whether to include FK relationships (default true)"
|
|
426
|
+
}
|
|
257
427
|
}
|
|
258
428
|
},
|
|
259
429
|
"output_schema": {
|
|
260
430
|
"type": "object",
|
|
261
431
|
"properties": {
|
|
262
|
-
"database": {
|
|
263
|
-
|
|
264
|
-
|
|
432
|
+
"database": {
|
|
433
|
+
"type": "string"
|
|
434
|
+
},
|
|
435
|
+
"total_tables": {
|
|
436
|
+
"type": "number"
|
|
437
|
+
},
|
|
438
|
+
"context_text": {
|
|
439
|
+
"type": "string"
|
|
440
|
+
}
|
|
265
441
|
}
|
|
266
442
|
}
|
|
267
443
|
},
|
|
@@ -289,23 +465,77 @@
|
|
|
289
465
|
"items": {
|
|
290
466
|
"type": "object",
|
|
291
467
|
"properties": {
|
|
292
|
-
"table_name": {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
"
|
|
296
|
-
|
|
468
|
+
"table_name": {
|
|
469
|
+
"type": "string"
|
|
470
|
+
},
|
|
471
|
+
"row_count": {
|
|
472
|
+
"type": "number"
|
|
473
|
+
},
|
|
474
|
+
"data_size_bytes": {
|
|
475
|
+
"type": "number"
|
|
476
|
+
},
|
|
477
|
+
"index_size_bytes": {
|
|
478
|
+
"type": "number"
|
|
479
|
+
},
|
|
480
|
+
"total_size_mb": {
|
|
481
|
+
"type": "string"
|
|
482
|
+
}
|
|
297
483
|
}
|
|
298
484
|
}
|
|
299
485
|
},
|
|
300
486
|
"summary": {
|
|
301
487
|
"type": "object",
|
|
302
488
|
"properties": {
|
|
303
|
-
"total_tables": {
|
|
304
|
-
|
|
489
|
+
"total_tables": {
|
|
490
|
+
"type": "number"
|
|
491
|
+
},
|
|
492
|
+
"total_size_mb": {
|
|
493
|
+
"type": "string"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "repair_query",
|
|
502
|
+
"description": "Analyzes a SQL query (and optional error) to suggest repairs or optimizations using EXPLAIN and heuristics.",
|
|
503
|
+
"input_schema": {
|
|
504
|
+
"type": "object",
|
|
505
|
+
"properties": {
|
|
506
|
+
"query": {
|
|
507
|
+
"type": "string",
|
|
508
|
+
"description": "The SQL query to analyze or repair"
|
|
509
|
+
},
|
|
510
|
+
"error_message": {
|
|
511
|
+
"type": "string",
|
|
512
|
+
"description": "Optional error message received when executing the query"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"required": [
|
|
516
|
+
"query"
|
|
517
|
+
]
|
|
518
|
+
},
|
|
519
|
+
"output_schema": {
|
|
520
|
+
"type": "object",
|
|
521
|
+
"properties": {
|
|
522
|
+
"status": {
|
|
523
|
+
"type": "string"
|
|
524
|
+
},
|
|
525
|
+
"analysis": {
|
|
526
|
+
"type": "object"
|
|
527
|
+
},
|
|
528
|
+
"fixed_query": {
|
|
529
|
+
"type": "string"
|
|
530
|
+
},
|
|
531
|
+
"suggestions": {
|
|
532
|
+
"type": "array",
|
|
533
|
+
"items": {
|
|
534
|
+
"type": "string"
|
|
305
535
|
}
|
|
306
536
|
}
|
|
307
537
|
}
|
|
308
538
|
}
|
|
309
539
|
}
|
|
310
540
|
]
|
|
311
|
-
}
|
|
541
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@berthojoris/mcp-mysql-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions, backup/restore, data import/export, and data migration capabilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -86,4 +86,4 @@
|
|
|
86
86
|
"ts-node": "^10.9.1",
|
|
87
87
|
"typescript": "^5.2.2"
|
|
88
88
|
}
|
|
89
|
-
}
|
|
89
|
+
}
|