@berthojoris/mcp-mysql-server 1.2.5 → 1.4.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/LICENSE +21 -21
- package/README.md +290 -81
- package/dist/auth/authService.d.ts +29 -0
- package/dist/auth/authService.js +114 -0
- package/dist/config/featureConfig.d.ts +5 -0
- package/dist/config/featureConfig.js +59 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +18 -1
- package/dist/mcp-server.js +95 -1
- package/dist/tools/dataExportTools.d.ts +33 -0
- package/dist/tools/dataExportTools.js +240 -0
- package/dist/tools/databaseTools.js +14 -14
- package/dist/tools/utilityTools.js +25 -25
- package/dist/validation/schemas.d.ts +87 -0
- package/dist/validation/schemas.js +62 -2
- package/manifest.json +247 -247
- package/package.json +2 -2
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.
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@berthojoris/mcp-mysql-server",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions",
|
|
3
|
+
"version": "1.4.0",
|
|
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",
|
|
7
7
|
"bin": {
|