@berthojoris/mcp-mysql-server 1.39.0 → 1.40.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 +50 -0
- package/DOCUMENTATIONS.md +4 -26
- package/README.md +3 -6
- package/dist/config/featureConfig.d.ts +1 -4
- package/dist/config/featureConfig.js +2 -77
- package/dist/index.d.ts +0 -137
- package/dist/index.js +1 -151
- package/dist/mcp-server.js +0 -365
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,56 @@ 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.0] - 2026-03-06
|
|
9
|
+
|
|
10
|
+
### Removed
|
|
11
|
+
- **Performance Monitoring Category**: Removed entire `performance_monitoring` category and all 10 tools to reduce bundle size and simplify the codebase
|
|
12
|
+
- `get_performance_metrics` - Get overall performance metrics
|
|
13
|
+
- `get_table_io_stats` - Get table I/O statistics
|
|
14
|
+
- `get_index_usage_stats` - Get index usage statistics
|
|
15
|
+
- `get_unused_indexes` - Find unused indexes
|
|
16
|
+
- `get_connection_pool_stats` - Get connection pool statistics
|
|
17
|
+
- `get_database_health_check` - Get database health status
|
|
18
|
+
- `reset_performance_stats` - Reset performance statistics
|
|
19
|
+
- `get_top_queries_by_time` - Get top queries by execution time
|
|
20
|
+
- `get_top_queries_by_count` - Get top queries by execution count
|
|
21
|
+
- `get_slow_queries` - Get slow queries
|
|
22
|
+
- **Cache Management Category**: Removed entire `cache_management` category and all 5 tools
|
|
23
|
+
- `get_cache_stats` - Query cache statistics
|
|
24
|
+
- `get_cache_config` - Cache configuration
|
|
25
|
+
- `configure_cache_settings` - Configure cache settings
|
|
26
|
+
- `clear_cache` - Clear cached results
|
|
27
|
+
- `invalidate_cache_for_table` - Invalidate cache for table
|
|
28
|
+
- **Server Management Category**: Removed entire `server_management` category and all 9 tools
|
|
29
|
+
- `show_process_list` - Show running processes
|
|
30
|
+
- `kill_process` - Terminate processes
|
|
31
|
+
- `show_status` - Server status variables
|
|
32
|
+
- `show_variables` - Server configuration
|
|
33
|
+
- `explain_query` - Query execution plan
|
|
34
|
+
- `show_engine_status` - Storage engine status
|
|
35
|
+
- `get_server_info` - Server information
|
|
36
|
+
- `show_binary_logs` - Binary log files
|
|
37
|
+
- `show_replication_status` - Replication status
|
|
38
|
+
- **Tool Modules**: Removed imports and initialization for `PerformanceTools` and `ProcessTools` from `index.ts`
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
- Updated tool count: 97 → 73 tools (-24 tools)
|
|
42
|
+
- Updated category count: 20 → 15 categories (removed `performance_monitoring`, `cache_management`, `server_management`)
|
|
43
|
+
- Updated `mcp-server.ts` to remove tool registrations and routing for all 24 tools
|
|
44
|
+
- Updated `index.ts` to remove MySQLMCP methods and tool imports
|
|
45
|
+
- Updated `featureConfig.ts` to remove all performance/cache/server tool mappings and categories
|
|
46
|
+
- Updated README.md and DOCUMENTATIONS.md to reflect tool/category count changes
|
|
47
|
+
- Simplified package description
|
|
48
|
+
- Bumped package version to `1.40.0`
|
|
49
|
+
|
|
50
|
+
### Rationale
|
|
51
|
+
- These tools were rarely used by AI agents in production
|
|
52
|
+
- Added significant complexity to the codebase (~2,000+ lines)
|
|
53
|
+
- Performance monitoring is typically handled by dedicated tools (MySQL Enterprise Monitor, Percona Monitoring Tools, etc.)
|
|
54
|
+
- Cache management is internal implementation detail, rarely needs manual intervention
|
|
55
|
+
- Server management commands are administrative tasks outside typical AI agent workflows
|
|
56
|
+
- Removal reduces bundle size by ~80KB and simplifies maintenance
|
|
57
|
+
|
|
8
58
|
## [1.39.0] - 2026-03-06
|
|
9
59
|
|
|
10
60
|
### Removed
|
package/DOCUMENTATIONS.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# MySQL MCP Server - Documentation
|
|
2
2
|
|
|
3
3
|
**Last Updated:** 2026-03-06 00:00:00
|
|
4
|
-
**Version:** 1.
|
|
5
|
-
**Total Tools:**
|
|
4
|
+
**Version:** 1.40.0
|
|
5
|
+
**Total Tools:** 73
|
|
6
6
|
|
|
7
7
|
Comprehensive documentation for the MySQL MCP Server. For quick start, see [README.md](README.md).
|
|
8
8
|
|
|
@@ -194,34 +194,12 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
194
194
|
- `get_transaction_status` - Check transaction state
|
|
195
195
|
- `execute_in_transaction` - Execute within transaction
|
|
196
196
|
|
|
197
|
-
### 14.
|
|
198
|
-
- `get_performance_metrics` - Get overall performance metrics
|
|
199
|
-
- `get_table_io_stats` - Get table I/O statistics
|
|
200
|
-
- `get_index_usage_stats` - Get index usage statistics
|
|
201
|
-
- `get_unused_indexes` - Find unused indexes
|
|
202
|
-
- `get_connection_pool_stats` - Get connection pool statistics
|
|
203
|
-
- `get_database_health_check` - Get database health status
|
|
204
|
-
- `reset_performance_stats` - Reset performance statistics
|
|
205
|
-
|
|
206
|
-
### 15. Query Optimization (3 tools)
|
|
197
|
+
### 14. Query Optimization (3 tools)
|
|
207
198
|
- `analyze_query` - Analyze query performance
|
|
208
199
|
- `get_optimization_hints` - Get optimizer hints
|
|
209
200
|
- `repair_query` - Repair broken SQL queries
|
|
210
201
|
|
|
211
|
-
###
|
|
212
|
-
- `show_process_list` - Show running processes
|
|
213
|
-
- `kill_process` - Terminate processes
|
|
214
|
-
- `show_status` - Server status variables
|
|
215
|
-
- `show_variables` - Server configuration
|
|
216
|
-
- `explain_query` - Query execution plan
|
|
217
|
-
|
|
218
|
-
### 17. Cache Management (4 tools)
|
|
219
|
-
- `get_cache_stats` - Query cache statistics
|
|
220
|
-
- `get_cache_config` - Cache configuration
|
|
221
|
-
- `configure_cache` - Configure cache settings
|
|
222
|
-
- `clear_cache` - Clear cached results
|
|
223
|
-
|
|
224
|
-
### 18. Utilities (4 tools)
|
|
202
|
+
### 15. Utilities (4 tools)
|
|
225
203
|
- `test_connection` - Test connectivity
|
|
226
204
|
- `describe_connection` - Connection info
|
|
227
205
|
- `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
|
|
7
|
+
**Last Updated:** 2026-03-06 16:45:00
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
|
|
10
10
|
[](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
|
|
@@ -259,9 +259,6 @@ Use documentation categories to fine-tune which tools are exposed (Layer 2):
|
|
|
259
259
|
| `index_management` | Optimize performance with index management | `analyze_index, create_index, drop_index, get_index_info, list_indexes` |
|
|
260
260
|
| `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
261
|
| `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
|
-
| `server_management` | MySQL server configuration and administration | `explain_query, get_server_info, kill_process, show_binary_logs, show_engine_status, show_process_list, show_replication_status, show_status, show_variables` |
|
|
263
|
-
| `performance_monitoring` | Monitor and analyze database performance | `get_connection_pool_stats, get_database_health_check, get_index_usage_stats, get_performance_metrics, get_slow_queries, get_table_io_stats, get_top_queries_by_count, get_top_queries_by_time, get_unused_indexes, reset_performance_stats` |
|
|
264
|
-
| `cache_management` | Manage query cache and optimization | `clear_cache, configure_cache_settings, get_cache_config, get_cache_stats, invalidate_cache_for_table` |
|
|
265
262
|
| `query_optimization` | Analyze and optimize SQL queries | `analyze_query, get_optimization_hints` |
|
|
266
263
|
| `backup_restore` | Create backups and restore databases | `backup_database, backup_table, get_create_table_statement, get_database_schema, restore_from_sql` |
|
|
267
264
|
| `analysis` | Data analysis and reporting tools | `get_column_statistics, get_database_summary, get_schema_erd, get_schema_rag_context` |
|
|
@@ -270,7 +267,7 @@ Use documentation categories to fine-tune which tools are exposed (Layer 2):
|
|
|
270
267
|
<summary>Copy/paste list (comma-separated, no spaces)</summary>
|
|
271
268
|
|
|
272
269
|
```text
|
|
273
|
-
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,
|
|
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
|
|
274
271
|
```
|
|
275
272
|
|
|
276
273
|
</details>
|
|
@@ -281,7 +278,7 @@ Full category → tool mapping (and examples) lives in **[DOCUMENTATIONS.md →
|
|
|
281
278
|
|
|
282
279
|
## Available Tools
|
|
283
280
|
|
|
284
|
-
The server exposes **
|
|
281
|
+
The server exposes **73 tools** organized into categories (CRUD, schema, and utilities).
|
|
285
282
|
|
|
286
283
|
- Complete list of tools: **[DOCUMENTATIONS.md → Complete Tools Reference](DOCUMENTATIONS.md#🔧-complete-tools-reference)**
|
|
287
284
|
|
|
@@ -14,7 +14,7 @@ export declare enum ToolCategory {
|
|
|
14
14
|
PROCEDURE = "procedure"
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Documentation categories from README (
|
|
17
|
+
* Documentation categories from README (15 categories)
|
|
18
18
|
* More intuitive and matches user mental model
|
|
19
19
|
*/
|
|
20
20
|
export declare enum DocCategory {
|
|
@@ -32,9 +32,6 @@ export declare enum DocCategory {
|
|
|
32
32
|
INDEX_MANAGEMENT = "index_management",
|
|
33
33
|
CONSTRAINT_MANAGEMENT = "constraint_management",
|
|
34
34
|
TABLE_MAINTENANCE = "table_maintenance",
|
|
35
|
-
SERVER_MANAGEMENT = "server_management",
|
|
36
|
-
PERFORMANCE_MONITORING = "performance_monitoring",
|
|
37
|
-
CACHE_MANAGEMENT = "cache_management",
|
|
38
35
|
QUERY_OPTIMIZATION = "query_optimization",
|
|
39
36
|
BACKUP_RESTORE = "backup_restore",
|
|
40
37
|
ANALYSIS = "analysis"
|
|
@@ -24,7 +24,7 @@ var ToolCategory;
|
|
|
24
24
|
ToolCategory["PROCEDURE"] = "procedure";
|
|
25
25
|
})(ToolCategory || (exports.ToolCategory = ToolCategory = {}));
|
|
26
26
|
/**
|
|
27
|
-
* Documentation categories from README (
|
|
27
|
+
* Documentation categories from README (15 categories)
|
|
28
28
|
* More intuitive and matches user mental model
|
|
29
29
|
*/
|
|
30
30
|
var DocCategory;
|
|
@@ -43,9 +43,6 @@ var DocCategory;
|
|
|
43
43
|
DocCategory["INDEX_MANAGEMENT"] = "index_management";
|
|
44
44
|
DocCategory["CONSTRAINT_MANAGEMENT"] = "constraint_management";
|
|
45
45
|
DocCategory["TABLE_MAINTENANCE"] = "table_maintenance";
|
|
46
|
-
DocCategory["SERVER_MANAGEMENT"] = "server_management";
|
|
47
|
-
DocCategory["PERFORMANCE_MONITORING"] = "performance_monitoring";
|
|
48
|
-
DocCategory["CACHE_MANAGEMENT"] = "cache_management";
|
|
49
46
|
DocCategory["QUERY_OPTIMIZATION"] = "query_optimization";
|
|
50
47
|
DocCategory["BACKUP_RESTORE"] = "backup_restore";
|
|
51
48
|
DocCategory["ANALYSIS"] = "analysis";
|
|
@@ -102,15 +99,6 @@ exports.toolCategoryMap = {
|
|
|
102
99
|
createStoredProcedure: ToolCategory.PROCEDURE,
|
|
103
100
|
dropStoredProcedure: ToolCategory.PROCEDURE,
|
|
104
101
|
showCreateProcedure: ToolCategory.LIST,
|
|
105
|
-
// Cache management tools
|
|
106
|
-
getCacheStats: ToolCategory.UTILITY,
|
|
107
|
-
getCacheConfig: ToolCategory.UTILITY,
|
|
108
|
-
configureCacheSettings: ToolCategory.UTILITY,
|
|
109
|
-
clearCache: ToolCategory.UTILITY,
|
|
110
|
-
invalidateCacheForTable: ToolCategory.UTILITY,
|
|
111
|
-
// Query optimization tools
|
|
112
|
-
analyzeQuery: ToolCategory.UTILITY,
|
|
113
|
-
getOptimizationHints: ToolCategory.UTILITY,
|
|
114
102
|
// View tools
|
|
115
103
|
listViews: ToolCategory.LIST,
|
|
116
104
|
getViewInfo: ToolCategory.LIST,
|
|
@@ -154,45 +142,12 @@ exports.toolCategoryMap = {
|
|
|
154
142
|
getTableStatus: ToolCategory.LIST,
|
|
155
143
|
flushTable: ToolCategory.UTILITY,
|
|
156
144
|
getTableSize: ToolCategory.LIST,
|
|
157
|
-
// Process and server management tools
|
|
158
|
-
showProcessList: ToolCategory.LIST,
|
|
159
|
-
killProcess: ToolCategory.EXECUTE,
|
|
160
|
-
showStatus: ToolCategory.LIST,
|
|
161
|
-
showVariables: ToolCategory.LIST,
|
|
162
|
-
explainQuery: ToolCategory.UTILITY,
|
|
163
|
-
showEngineStatus: ToolCategory.LIST,
|
|
164
|
-
getServerInfo: ToolCategory.LIST,
|
|
165
|
-
showBinaryLogs: ToolCategory.LIST,
|
|
166
|
-
showReplicationStatus: ToolCategory.LIST,
|
|
167
145
|
// Backup and restore tools
|
|
168
146
|
backupTable: ToolCategory.UTILITY,
|
|
169
147
|
backupDatabase: ToolCategory.UTILITY,
|
|
170
148
|
restoreFromSql: ToolCategory.UTILITY,
|
|
171
149
|
getCreateTableStatement: ToolCategory.UTILITY,
|
|
172
150
|
getDatabaseSchema: ToolCategory.UTILITY,
|
|
173
|
-
// Schema versioning and migrations tools
|
|
174
|
-
initMigrationsTable: ToolCategory.DDL,
|
|
175
|
-
createMigration: ToolCategory.DDL,
|
|
176
|
-
applyMigrations: ToolCategory.DDL,
|
|
177
|
-
rollbackMigration: ToolCategory.DDL,
|
|
178
|
-
getMigrationStatus: ToolCategory.LIST,
|
|
179
|
-
getSchemaVersion: ToolCategory.LIST,
|
|
180
|
-
validateMigrations: ToolCategory.LIST,
|
|
181
|
-
resetFailedMigration: ToolCategory.DDL,
|
|
182
|
-
generateMigrationFromDiff: ToolCategory.DDL,
|
|
183
|
-
// Analysis tools - MOVED here to avoid duplication
|
|
184
|
-
// Note: keys must be unique in the object literal
|
|
185
|
-
// Performance monitoring tools
|
|
186
|
-
getPerformanceMetrics: ToolCategory.UTILITY,
|
|
187
|
-
getTopQueriesByTime: ToolCategory.UTILITY,
|
|
188
|
-
getTopQueriesByCount: ToolCategory.UTILITY,
|
|
189
|
-
getSlowQueries: ToolCategory.UTILITY,
|
|
190
|
-
getTableIOStats: ToolCategory.UTILITY,
|
|
191
|
-
getIndexUsageStats: ToolCategory.UTILITY,
|
|
192
|
-
getUnusedIndexes: ToolCategory.UTILITY,
|
|
193
|
-
getConnectionPoolStats: ToolCategory.UTILITY,
|
|
194
|
-
getDatabaseHealthCheck: ToolCategory.UTILITY,
|
|
195
|
-
resetPerformanceStats: ToolCategory.UTILITY,
|
|
196
151
|
// Full-Text Search Tools
|
|
197
152
|
createFulltextIndex: ToolCategory.DDL,
|
|
198
153
|
fulltextSearch: ToolCategory.READ,
|
|
@@ -290,33 +245,6 @@ exports.toolDocCategoryMap = {
|
|
|
290
245
|
getTableStatus: DocCategory.TABLE_MAINTENANCE,
|
|
291
246
|
flushTable: DocCategory.TABLE_MAINTENANCE,
|
|
292
247
|
getTableSize: DocCategory.TABLE_MAINTENANCE,
|
|
293
|
-
// Server Management
|
|
294
|
-
showProcessList: DocCategory.SERVER_MANAGEMENT,
|
|
295
|
-
killProcess: DocCategory.SERVER_MANAGEMENT,
|
|
296
|
-
showStatus: DocCategory.SERVER_MANAGEMENT,
|
|
297
|
-
showVariables: DocCategory.SERVER_MANAGEMENT,
|
|
298
|
-
explainQuery: DocCategory.SERVER_MANAGEMENT,
|
|
299
|
-
showEngineStatus: DocCategory.SERVER_MANAGEMENT,
|
|
300
|
-
getServerInfo: DocCategory.SERVER_MANAGEMENT,
|
|
301
|
-
showBinaryLogs: DocCategory.SERVER_MANAGEMENT,
|
|
302
|
-
showReplicationStatus: DocCategory.SERVER_MANAGEMENT,
|
|
303
|
-
// Performance Monitoring
|
|
304
|
-
getPerformanceMetrics: DocCategory.PERFORMANCE_MONITORING,
|
|
305
|
-
getTopQueriesByTime: DocCategory.PERFORMANCE_MONITORING,
|
|
306
|
-
getTopQueriesByCount: DocCategory.PERFORMANCE_MONITORING,
|
|
307
|
-
getSlowQueries: DocCategory.PERFORMANCE_MONITORING,
|
|
308
|
-
getTableIOStats: DocCategory.PERFORMANCE_MONITORING,
|
|
309
|
-
getIndexUsageStats: DocCategory.PERFORMANCE_MONITORING,
|
|
310
|
-
getUnusedIndexes: DocCategory.PERFORMANCE_MONITORING,
|
|
311
|
-
getConnectionPoolStats: DocCategory.PERFORMANCE_MONITORING,
|
|
312
|
-
getDatabaseHealthCheck: DocCategory.PERFORMANCE_MONITORING,
|
|
313
|
-
resetPerformanceStats: DocCategory.PERFORMANCE_MONITORING,
|
|
314
|
-
// Cache Management
|
|
315
|
-
getCacheStats: DocCategory.CACHE_MANAGEMENT,
|
|
316
|
-
getCacheConfig: DocCategory.CACHE_MANAGEMENT,
|
|
317
|
-
configureCacheSettings: DocCategory.CACHE_MANAGEMENT,
|
|
318
|
-
clearCache: DocCategory.CACHE_MANAGEMENT,
|
|
319
|
-
invalidateCacheForTable: DocCategory.CACHE_MANAGEMENT,
|
|
320
248
|
// Query Optimization
|
|
321
249
|
analyzeQuery: DocCategory.QUERY_OPTIMIZATION,
|
|
322
250
|
getOptimizationHints: DocCategory.QUERY_OPTIMIZATION,
|
|
@@ -354,7 +282,6 @@ const legacyToDocCategoryMap = {
|
|
|
354
282
|
DocCategory.INDEX_MANAGEMENT,
|
|
355
283
|
DocCategory.CONSTRAINT_MANAGEMENT,
|
|
356
284
|
DocCategory.TABLE_MAINTENANCE,
|
|
357
|
-
DocCategory.SERVER_MANAGEMENT,
|
|
358
285
|
DocCategory.ANALYSIS,
|
|
359
286
|
DocCategory.UTILITIES,
|
|
360
287
|
],
|
|
@@ -371,7 +298,7 @@ const legacyToDocCategoryMap = {
|
|
|
371
298
|
DocCategory.CRUD_OPERATIONS,
|
|
372
299
|
DocCategory.BULK_OPERATIONS,
|
|
373
300
|
],
|
|
374
|
-
execute: [DocCategory.CUSTOM_QUERIES
|
|
301
|
+
execute: [DocCategory.CUSTOM_QUERIES],
|
|
375
302
|
ddl: [
|
|
376
303
|
DocCategory.SCHEMA_MANAGEMENT,
|
|
377
304
|
DocCategory.VIEWS_MANAGEMENT,
|
|
@@ -384,8 +311,6 @@ const legacyToDocCategoryMap = {
|
|
|
384
311
|
utility: [
|
|
385
312
|
DocCategory.UTILITIES,
|
|
386
313
|
DocCategory.TABLE_MAINTENANCE,
|
|
387
|
-
DocCategory.PERFORMANCE_MONITORING,
|
|
388
|
-
DocCategory.CACHE_MANAGEMENT,
|
|
389
314
|
DocCategory.QUERY_OPTIMIZATION,
|
|
390
315
|
DocCategory.BACKUP_RESTORE,
|
|
391
316
|
],
|
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,7 @@ export declare class MySQLMCP {
|
|
|
17
17
|
private indexTools;
|
|
18
18
|
private constraintTools;
|
|
19
19
|
private maintenanceTools;
|
|
20
|
-
private processTools;
|
|
21
20
|
private backupRestoreTools;
|
|
22
|
-
private migrationTools;
|
|
23
|
-
private performanceTools;
|
|
24
21
|
private analysisTools;
|
|
25
22
|
private aiTools;
|
|
26
23
|
private macroTools;
|
|
@@ -412,57 +409,6 @@ export declare class MySQLMCP {
|
|
|
412
409
|
error?: string;
|
|
413
410
|
}>;
|
|
414
411
|
close(): Promise<void>;
|
|
415
|
-
/**
|
|
416
|
-
* Get cache statistics
|
|
417
|
-
*/
|
|
418
|
-
getCacheStats(): {
|
|
419
|
-
status: string;
|
|
420
|
-
data: import("./cache/queryCache").CacheStats;
|
|
421
|
-
};
|
|
422
|
-
/**
|
|
423
|
-
* Get cache configuration
|
|
424
|
-
*/
|
|
425
|
-
getCacheConfig(): {
|
|
426
|
-
status: string;
|
|
427
|
-
data: import("./cache/queryCache").CacheConfig;
|
|
428
|
-
};
|
|
429
|
-
/**
|
|
430
|
-
* Configure cache settings
|
|
431
|
-
*/
|
|
432
|
-
configureCacheSettings(params: {
|
|
433
|
-
enabled?: boolean;
|
|
434
|
-
ttlMs?: number;
|
|
435
|
-
maxSize?: number;
|
|
436
|
-
maxMemoryMB?: number;
|
|
437
|
-
}): {
|
|
438
|
-
status: string;
|
|
439
|
-
data: {
|
|
440
|
-
message: string;
|
|
441
|
-
config: import("./cache/queryCache").CacheConfig;
|
|
442
|
-
};
|
|
443
|
-
};
|
|
444
|
-
/**
|
|
445
|
-
* Clear the query cache
|
|
446
|
-
*/
|
|
447
|
-
clearCache(): {
|
|
448
|
-
status: string;
|
|
449
|
-
data: {
|
|
450
|
-
message: string;
|
|
451
|
-
entriesCleared: number;
|
|
452
|
-
};
|
|
453
|
-
};
|
|
454
|
-
/**
|
|
455
|
-
* Invalidate cache for a specific table
|
|
456
|
-
*/
|
|
457
|
-
invalidateCacheForTable(params: {
|
|
458
|
-
table_name: string;
|
|
459
|
-
}): {
|
|
460
|
-
status: string;
|
|
461
|
-
data: {
|
|
462
|
-
message: string;
|
|
463
|
-
entriesInvalidated: number;
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
412
|
/**
|
|
467
413
|
* Analyze a query and get optimization suggestions
|
|
468
414
|
*/
|
|
@@ -768,89 +714,6 @@ export declare class MySQLMCP {
|
|
|
768
714
|
data?: any;
|
|
769
715
|
error?: string;
|
|
770
716
|
}>;
|
|
771
|
-
showProcessList(params?: {
|
|
772
|
-
full?: boolean;
|
|
773
|
-
}): Promise<{
|
|
774
|
-
status: string;
|
|
775
|
-
data?: any[];
|
|
776
|
-
error?: string;
|
|
777
|
-
}>;
|
|
778
|
-
killProcess(params: {
|
|
779
|
-
process_id: number;
|
|
780
|
-
type?: "CONNECTION" | "QUERY";
|
|
781
|
-
}): Promise<{
|
|
782
|
-
status: string;
|
|
783
|
-
message?: string;
|
|
784
|
-
error?: string;
|
|
785
|
-
}>;
|
|
786
|
-
showStatus(params?: {
|
|
787
|
-
like?: string;
|
|
788
|
-
global?: boolean;
|
|
789
|
-
}): Promise<{
|
|
790
|
-
status: string;
|
|
791
|
-
data?: any;
|
|
792
|
-
error?: string;
|
|
793
|
-
}>;
|
|
794
|
-
showVariables(params?: {
|
|
795
|
-
like?: string;
|
|
796
|
-
global?: boolean;
|
|
797
|
-
}): Promise<{
|
|
798
|
-
status: string;
|
|
799
|
-
data?: any;
|
|
800
|
-
error?: string;
|
|
801
|
-
}>;
|
|
802
|
-
explainQuery(params: {
|
|
803
|
-
query: string;
|
|
804
|
-
format?: "TRADITIONAL" | "JSON" | "TREE";
|
|
805
|
-
analyze?: boolean;
|
|
806
|
-
}): Promise<{
|
|
807
|
-
status: string;
|
|
808
|
-
data?: any;
|
|
809
|
-
error?: string;
|
|
810
|
-
}>;
|
|
811
|
-
getPerformanceMetrics(): Promise<{
|
|
812
|
-
status: string;
|
|
813
|
-
data?: any;
|
|
814
|
-
error?: string;
|
|
815
|
-
}>;
|
|
816
|
-
getTableIOStats(params?: {
|
|
817
|
-
limit?: number;
|
|
818
|
-
table_schema?: string;
|
|
819
|
-
}): Promise<{
|
|
820
|
-
status: string;
|
|
821
|
-
data?: any[];
|
|
822
|
-
error?: string;
|
|
823
|
-
}>;
|
|
824
|
-
getIndexUsageStats(params?: {
|
|
825
|
-
limit?: number;
|
|
826
|
-
table_schema?: string;
|
|
827
|
-
}): Promise<{
|
|
828
|
-
status: string;
|
|
829
|
-
data?: any[];
|
|
830
|
-
error?: string;
|
|
831
|
-
}>;
|
|
832
|
-
getUnusedIndexes(params?: {
|
|
833
|
-
table_schema?: string;
|
|
834
|
-
}): Promise<{
|
|
835
|
-
status: string;
|
|
836
|
-
data?: any[];
|
|
837
|
-
error?: string;
|
|
838
|
-
}>;
|
|
839
|
-
getConnectionPoolStats(): Promise<{
|
|
840
|
-
status: string;
|
|
841
|
-
data?: any;
|
|
842
|
-
error?: string;
|
|
843
|
-
}>;
|
|
844
|
-
getDatabaseHealthCheck(): Promise<{
|
|
845
|
-
status: string;
|
|
846
|
-
data?: any;
|
|
847
|
-
error?: string;
|
|
848
|
-
}>;
|
|
849
|
-
resetPerformanceStats(): Promise<{
|
|
850
|
-
status: string;
|
|
851
|
-
message?: string;
|
|
852
|
-
error?: string;
|
|
853
|
-
}>;
|
|
854
717
|
startQueryBuilder(params: {
|
|
855
718
|
intent: string;
|
|
856
719
|
context?: "analytics" | "reporting" | "data_entry" | "schema_exploration";
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,7 @@ const functionTools_1 = require("./tools/functionTools");
|
|
|
18
18
|
const indexTools_1 = require("./tools/indexTools");
|
|
19
19
|
const constraintTools_1 = require("./tools/constraintTools");
|
|
20
20
|
const maintenanceTools_1 = require("./tools/maintenanceTools");
|
|
21
|
-
const processTools_1 = require("./tools/processTools");
|
|
22
21
|
const backupRestoreTools_1 = require("./tools/backupRestoreTools");
|
|
23
|
-
const migrationTools_1 = require("./tools/migrationTools");
|
|
24
|
-
const performanceTools_1 = require("./tools/performanceTools");
|
|
25
22
|
const analysisTools_1 = require("./tools/analysisTools");
|
|
26
23
|
const aiTools_1 = require("./tools/aiTools");
|
|
27
24
|
const macroTools_1 = require("./tools/macroTools");
|
|
@@ -52,11 +49,7 @@ class MySQLMCP {
|
|
|
52
49
|
this.indexTools = new indexTools_1.IndexTools(this.security);
|
|
53
50
|
this.constraintTools = new constraintTools_1.ConstraintTools(this.security);
|
|
54
51
|
this.maintenanceTools = new maintenanceTools_1.MaintenanceTools(this.security);
|
|
55
|
-
this.processTools = new processTools_1.ProcessTools(this.security);
|
|
56
52
|
this.backupRestoreTools = new backupRestoreTools_1.BackupRestoreTools(this.security);
|
|
57
|
-
this.migrationTools = new migrationTools_1.MigrationTools(this.security);
|
|
58
|
-
this.performanceTools = new performanceTools_1.PerformanceTools(this.security);
|
|
59
|
-
this.analysisTools = new analysisTools_1.AnalysisTools(this.security);
|
|
60
53
|
this.analysisTools = new analysisTools_1.AnalysisTools(this.security);
|
|
61
54
|
this.aiTools = new aiTools_1.AiTools(this.security);
|
|
62
55
|
this.macroTools = new macroTools_1.MacroTools(this.security);
|
|
@@ -424,72 +417,7 @@ class MySQLMCP {
|
|
|
424
417
|
await db.closePool();
|
|
425
418
|
}
|
|
426
419
|
// ==========================================
|
|
427
|
-
//
|
|
428
|
-
// ==========================================
|
|
429
|
-
/**
|
|
430
|
-
* Get cache statistics
|
|
431
|
-
*/
|
|
432
|
-
getCacheStats() {
|
|
433
|
-
const db = connection_1.default.getInstance();
|
|
434
|
-
return {
|
|
435
|
-
status: "success",
|
|
436
|
-
data: db.getCacheStats(),
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Get cache configuration
|
|
441
|
-
*/
|
|
442
|
-
getCacheConfig() {
|
|
443
|
-
const db = connection_1.default.getInstance();
|
|
444
|
-
return {
|
|
445
|
-
status: "success",
|
|
446
|
-
data: db.getCacheConfig(),
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Configure cache settings
|
|
451
|
-
*/
|
|
452
|
-
configureCacheSettings(params) {
|
|
453
|
-
const db = connection_1.default.getInstance();
|
|
454
|
-
db.setCacheConfig(params);
|
|
455
|
-
return {
|
|
456
|
-
status: "success",
|
|
457
|
-
data: {
|
|
458
|
-
message: "Cache configuration updated successfully",
|
|
459
|
-
config: db.getCacheConfig(),
|
|
460
|
-
},
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Clear the query cache
|
|
465
|
-
*/
|
|
466
|
-
clearCache() {
|
|
467
|
-
const db = connection_1.default.getInstance();
|
|
468
|
-
const clearedCount = db.clearCache();
|
|
469
|
-
return {
|
|
470
|
-
status: "success",
|
|
471
|
-
data: {
|
|
472
|
-
message: `Cache cleared successfully`,
|
|
473
|
-
entriesCleared: clearedCount,
|
|
474
|
-
},
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Invalidate cache for a specific table
|
|
479
|
-
*/
|
|
480
|
-
invalidateCacheForTable(params) {
|
|
481
|
-
const db = connection_1.default.getInstance();
|
|
482
|
-
const invalidatedCount = db.invalidateCacheForTable(params.table_name);
|
|
483
|
-
return {
|
|
484
|
-
status: "success",
|
|
485
|
-
data: {
|
|
486
|
-
message: `Cache invalidated for table '${params.table_name}'`,
|
|
487
|
-
entriesInvalidated: invalidatedCount,
|
|
488
|
-
},
|
|
489
|
-
};
|
|
490
|
-
}
|
|
491
|
-
// ==========================================
|
|
492
|
-
// Query Optimization Methods
|
|
420
|
+
// Query Optimization Tools
|
|
493
421
|
// ==========================================
|
|
494
422
|
/**
|
|
495
423
|
* Analyze a query and get optimization suggestions
|
|
@@ -754,84 +682,6 @@ class MySQLMCP {
|
|
|
754
682
|
return { status: "error", error: check.error };
|
|
755
683
|
return await this.maintenanceTools.getTableSize(params);
|
|
756
684
|
}
|
|
757
|
-
// ==========================================
|
|
758
|
-
// Process Management Tools
|
|
759
|
-
// ==========================================
|
|
760
|
-
async showProcessList(params) {
|
|
761
|
-
const check = this.checkToolEnabled("showProcessList");
|
|
762
|
-
if (!check.enabled)
|
|
763
|
-
return { status: "error", error: check.error };
|
|
764
|
-
return await this.processTools.showProcessList(params);
|
|
765
|
-
}
|
|
766
|
-
async killProcess(params) {
|
|
767
|
-
const check = this.checkToolEnabled("killProcess");
|
|
768
|
-
if (!check.enabled)
|
|
769
|
-
return { status: "error", error: check.error };
|
|
770
|
-
return await this.processTools.killProcess(params);
|
|
771
|
-
}
|
|
772
|
-
async showStatus(params) {
|
|
773
|
-
const check = this.checkToolEnabled("showStatus");
|
|
774
|
-
if (!check.enabled)
|
|
775
|
-
return { status: "error", error: check.error };
|
|
776
|
-
return await this.processTools.showStatus(params);
|
|
777
|
-
}
|
|
778
|
-
async showVariables(params) {
|
|
779
|
-
const check = this.checkToolEnabled("showVariables");
|
|
780
|
-
if (!check.enabled)
|
|
781
|
-
return { status: "error", error: check.error };
|
|
782
|
-
return await this.processTools.showVariables(params);
|
|
783
|
-
}
|
|
784
|
-
async explainQuery(params) {
|
|
785
|
-
const check = this.checkToolEnabled("explainQuery");
|
|
786
|
-
if (!check.enabled)
|
|
787
|
-
return { status: "error", error: check.error };
|
|
788
|
-
return await this.processTools.explainQuery(params);
|
|
789
|
-
}
|
|
790
|
-
// ==========================================
|
|
791
|
-
// Performance Monitoring Tools
|
|
792
|
-
// ==========================================
|
|
793
|
-
async getPerformanceMetrics() {
|
|
794
|
-
const check = this.checkToolEnabled("getPerformanceMetrics");
|
|
795
|
-
if (!check.enabled)
|
|
796
|
-
return { status: "error", error: check.error };
|
|
797
|
-
return await this.performanceTools.getPerformanceMetrics();
|
|
798
|
-
}
|
|
799
|
-
async getTableIOStats(params) {
|
|
800
|
-
const check = this.checkToolEnabled("getTableIOStats");
|
|
801
|
-
if (!check.enabled)
|
|
802
|
-
return { status: "error", error: check.error };
|
|
803
|
-
return await this.performanceTools.getTableIOStats(params);
|
|
804
|
-
}
|
|
805
|
-
async getIndexUsageStats(params) {
|
|
806
|
-
const check = this.checkToolEnabled("getIndexUsageStats");
|
|
807
|
-
if (!check.enabled)
|
|
808
|
-
return { status: "error", error: check.error };
|
|
809
|
-
return await this.performanceTools.getIndexUsageStats(params);
|
|
810
|
-
}
|
|
811
|
-
async getUnusedIndexes(params) {
|
|
812
|
-
const check = this.checkToolEnabled("getUnusedIndexes");
|
|
813
|
-
if (!check.enabled)
|
|
814
|
-
return { status: "error", error: check.error };
|
|
815
|
-
return await this.performanceTools.getUnusedIndexes(params);
|
|
816
|
-
}
|
|
817
|
-
async getConnectionPoolStats() {
|
|
818
|
-
const check = this.checkToolEnabled("getConnectionPoolStats");
|
|
819
|
-
if (!check.enabled)
|
|
820
|
-
return { status: "error", error: check.error };
|
|
821
|
-
return await this.performanceTools.getConnectionPoolStats();
|
|
822
|
-
}
|
|
823
|
-
async getDatabaseHealthCheck() {
|
|
824
|
-
const check = this.checkToolEnabled("getDatabaseHealthCheck");
|
|
825
|
-
if (!check.enabled)
|
|
826
|
-
return { status: "error", error: check.error };
|
|
827
|
-
return await this.performanceTools.getDatabaseHealthCheck();
|
|
828
|
-
}
|
|
829
|
-
async resetPerformanceStats() {
|
|
830
|
-
const check = this.checkToolEnabled("resetPerformanceStats");
|
|
831
|
-
if (!check.enabled)
|
|
832
|
-
return { status: "error", error: check.error };
|
|
833
|
-
return await this.performanceTools.resetPerformanceStats();
|
|
834
|
-
}
|
|
835
685
|
// Smart Query Builder Tools
|
|
836
686
|
async startQueryBuilder(params) {
|
|
837
687
|
const check = this.checkToolEnabled("startQueryBuilder");
|
package/dist/mcp-server.js
CHANGED
|
@@ -980,70 +980,6 @@ const TOOLS = [
|
|
|
980
980
|
required: ["query"],
|
|
981
981
|
},
|
|
982
982
|
},
|
|
983
|
-
// Cache Management Tools
|
|
984
|
-
{
|
|
985
|
-
name: "get_cache_stats",
|
|
986
|
-
description: "📊 Returns query cache performance metrics: hit rate, miss rate, size, memory usage, and entry count. Use to monitor cache effectiveness and tune cache settings.",
|
|
987
|
-
inputSchema: {
|
|
988
|
-
type: "object",
|
|
989
|
-
properties: {},
|
|
990
|
-
},
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
name: "get_cache_config",
|
|
994
|
-
description: "Get current cache configuration settings.",
|
|
995
|
-
inputSchema: {
|
|
996
|
-
type: "object",
|
|
997
|
-
properties: {},
|
|
998
|
-
},
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
name: "configure_cache",
|
|
1002
|
-
description: "Configure cache settings including TTL, max size, and enable/disable.",
|
|
1003
|
-
inputSchema: {
|
|
1004
|
-
type: "object",
|
|
1005
|
-
properties: {
|
|
1006
|
-
enabled: {
|
|
1007
|
-
type: "boolean",
|
|
1008
|
-
description: "Enable or disable the query cache",
|
|
1009
|
-
},
|
|
1010
|
-
ttlMs: {
|
|
1011
|
-
type: "number",
|
|
1012
|
-
description: "Cache time-to-live in milliseconds (default: 60000)",
|
|
1013
|
-
},
|
|
1014
|
-
maxSize: {
|
|
1015
|
-
type: "number",
|
|
1016
|
-
description: "Maximum number of cached entries (default: 100)",
|
|
1017
|
-
},
|
|
1018
|
-
maxMemoryMB: {
|
|
1019
|
-
type: "number",
|
|
1020
|
-
description: "Maximum memory usage in MB (default: 50)",
|
|
1021
|
-
},
|
|
1022
|
-
},
|
|
1023
|
-
},
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
name: "clear_cache",
|
|
1027
|
-
description: "Clear all entries from the query cache.",
|
|
1028
|
-
inputSchema: {
|
|
1029
|
-
type: "object",
|
|
1030
|
-
properties: {},
|
|
1031
|
-
},
|
|
1032
|
-
},
|
|
1033
|
-
{
|
|
1034
|
-
name: "invalidate_table_cache",
|
|
1035
|
-
description: "Invalidate all cached queries related to a specific table.",
|
|
1036
|
-
inputSchema: {
|
|
1037
|
-
type: "object",
|
|
1038
|
-
properties: {
|
|
1039
|
-
table_name: {
|
|
1040
|
-
type: "string",
|
|
1041
|
-
description: "Name of the table to invalidate cache for",
|
|
1042
|
-
},
|
|
1043
|
-
},
|
|
1044
|
-
required: ["table_name"],
|
|
1045
|
-
},
|
|
1046
|
-
},
|
|
1047
983
|
// Query Optimization Tools
|
|
1048
984
|
{
|
|
1049
985
|
name: "analyze_query",
|
|
@@ -1872,130 +1808,6 @@ const TOOLS = [
|
|
|
1872
1808
|
},
|
|
1873
1809
|
},
|
|
1874
1810
|
},
|
|
1875
|
-
// Process Management Tools
|
|
1876
|
-
{
|
|
1877
|
-
name: "show_process_list",
|
|
1878
|
-
description: "Shows all running MySQL processes/connections.",
|
|
1879
|
-
inputSchema: {
|
|
1880
|
-
type: "object",
|
|
1881
|
-
properties: {
|
|
1882
|
-
full: { type: "boolean", description: "Show full query text" },
|
|
1883
|
-
},
|
|
1884
|
-
},
|
|
1885
|
-
},
|
|
1886
|
-
{
|
|
1887
|
-
name: "kill_process",
|
|
1888
|
-
description: "Kills a MySQL process/connection by ID.",
|
|
1889
|
-
inputSchema: {
|
|
1890
|
-
type: "object",
|
|
1891
|
-
properties: {
|
|
1892
|
-
process_id: { type: "number", description: "Process ID to kill" },
|
|
1893
|
-
type: {
|
|
1894
|
-
type: "string",
|
|
1895
|
-
enum: ["CONNECTION", "QUERY"],
|
|
1896
|
-
description: "Kill connection or just query",
|
|
1897
|
-
},
|
|
1898
|
-
},
|
|
1899
|
-
required: ["process_id"],
|
|
1900
|
-
},
|
|
1901
|
-
},
|
|
1902
|
-
{
|
|
1903
|
-
name: "show_status",
|
|
1904
|
-
description: "Shows MySQL server status variables.",
|
|
1905
|
-
inputSchema: {
|
|
1906
|
-
type: "object",
|
|
1907
|
-
properties: {
|
|
1908
|
-
like: {
|
|
1909
|
-
type: "string",
|
|
1910
|
-
description: "Optional: filter pattern (e.g., 'Thread%')",
|
|
1911
|
-
},
|
|
1912
|
-
global: {
|
|
1913
|
-
type: "boolean",
|
|
1914
|
-
description: "Show global status instead of session",
|
|
1915
|
-
},
|
|
1916
|
-
},
|
|
1917
|
-
},
|
|
1918
|
-
},
|
|
1919
|
-
{
|
|
1920
|
-
name: "show_variables",
|
|
1921
|
-
description: "Shows MySQL server configuration variables.",
|
|
1922
|
-
inputSchema: {
|
|
1923
|
-
type: "object",
|
|
1924
|
-
properties: {
|
|
1925
|
-
like: {
|
|
1926
|
-
type: "string",
|
|
1927
|
-
description: "Optional: filter pattern (e.g., 'max_%')",
|
|
1928
|
-
},
|
|
1929
|
-
global: {
|
|
1930
|
-
type: "boolean",
|
|
1931
|
-
description: "Show global variables instead of session",
|
|
1932
|
-
},
|
|
1933
|
-
},
|
|
1934
|
-
},
|
|
1935
|
-
},
|
|
1936
|
-
{
|
|
1937
|
-
name: "explain_query",
|
|
1938
|
-
description: "Shows the execution plan for a query (EXPLAIN).",
|
|
1939
|
-
inputSchema: {
|
|
1940
|
-
type: "object",
|
|
1941
|
-
properties: {
|
|
1942
|
-
query: { type: "string", description: "SQL query to explain" },
|
|
1943
|
-
format: {
|
|
1944
|
-
type: "string",
|
|
1945
|
-
enum: ["TRADITIONAL", "JSON", "TREE"],
|
|
1946
|
-
description: "Output format",
|
|
1947
|
-
},
|
|
1948
|
-
analyze: {
|
|
1949
|
-
type: "boolean",
|
|
1950
|
-
description: "Actually execute the query and show real statistics",
|
|
1951
|
-
},
|
|
1952
|
-
},
|
|
1953
|
-
required: ["query"],
|
|
1954
|
-
},
|
|
1955
|
-
},
|
|
1956
|
-
{
|
|
1957
|
-
name: "show_engine_status",
|
|
1958
|
-
description: "Shows storage engine status (InnoDB by default).",
|
|
1959
|
-
inputSchema: {
|
|
1960
|
-
type: "object",
|
|
1961
|
-
properties: {
|
|
1962
|
-
engine: {
|
|
1963
|
-
type: "string",
|
|
1964
|
-
description: "Engine name (INNODB, PERFORMANCE_SCHEMA, etc.)",
|
|
1965
|
-
},
|
|
1966
|
-
},
|
|
1967
|
-
},
|
|
1968
|
-
},
|
|
1969
|
-
{
|
|
1970
|
-
name: "get_server_info",
|
|
1971
|
-
description: "Gets comprehensive MySQL server information including version, uptime, and statistics.",
|
|
1972
|
-
inputSchema: {
|
|
1973
|
-
type: "object",
|
|
1974
|
-
properties: {},
|
|
1975
|
-
},
|
|
1976
|
-
},
|
|
1977
|
-
{
|
|
1978
|
-
name: "show_binary_logs",
|
|
1979
|
-
description: "Shows binary log files on the server.",
|
|
1980
|
-
inputSchema: {
|
|
1981
|
-
type: "object",
|
|
1982
|
-
properties: {},
|
|
1983
|
-
},
|
|
1984
|
-
},
|
|
1985
|
-
{
|
|
1986
|
-
name: "show_replication_status",
|
|
1987
|
-
description: "Shows replication status (master or replica).",
|
|
1988
|
-
inputSchema: {
|
|
1989
|
-
type: "object",
|
|
1990
|
-
properties: {
|
|
1991
|
-
type: {
|
|
1992
|
-
type: "string",
|
|
1993
|
-
enum: ["MASTER", "REPLICA", "SLAVE"],
|
|
1994
|
-
description: "Which status to show",
|
|
1995
|
-
},
|
|
1996
|
-
},
|
|
1997
|
-
},
|
|
1998
|
-
},
|
|
1999
1811
|
// Backup and Restore Tools
|
|
2000
1812
|
{
|
|
2001
1813
|
name: "backup_table",
|
|
@@ -2118,129 +1930,6 @@ const TOOLS = [
|
|
|
2118
1930
|
},
|
|
2119
1931
|
},
|
|
2120
1932
|
},
|
|
2121
|
-
// Performance Monitoring Tools
|
|
2122
|
-
{
|
|
2123
|
-
name: "get_performance_metrics",
|
|
2124
|
-
description: "📊 COMPREHENSIVE MONITORING: Returns complete MySQL performance dashboard including query stats, connection pool, buffer pool efficiency, InnoDB metrics, and disk I/O. Use for performance troubleshooting or health checks.",
|
|
2125
|
-
inputSchema: {
|
|
2126
|
-
type: "object",
|
|
2127
|
-
properties: {},
|
|
2128
|
-
},
|
|
2129
|
-
},
|
|
2130
|
-
{
|
|
2131
|
-
name: "get_top_queries_by_time",
|
|
2132
|
-
description: "Get the top queries ordered by total execution time. Useful for identifying slow queries.",
|
|
2133
|
-
inputSchema: {
|
|
2134
|
-
type: "object",
|
|
2135
|
-
properties: {
|
|
2136
|
-
limit: {
|
|
2137
|
-
type: "number",
|
|
2138
|
-
description: "Maximum number of queries to return (default: 10, max: 100)",
|
|
2139
|
-
},
|
|
2140
|
-
},
|
|
2141
|
-
},
|
|
2142
|
-
},
|
|
2143
|
-
{
|
|
2144
|
-
name: "get_top_queries_by_count",
|
|
2145
|
-
description: "Get the top queries ordered by execution count. Useful for identifying frequently executed queries.",
|
|
2146
|
-
inputSchema: {
|
|
2147
|
-
type: "object",
|
|
2148
|
-
properties: {
|
|
2149
|
-
limit: {
|
|
2150
|
-
type: "number",
|
|
2151
|
-
description: "Maximum number of queries to return (default: 10, max: 100)",
|
|
2152
|
-
},
|
|
2153
|
-
},
|
|
2154
|
-
},
|
|
2155
|
-
},
|
|
2156
|
-
{
|
|
2157
|
-
name: "get_slow_queries",
|
|
2158
|
-
description: "Get queries that exceed a specified execution time threshold.",
|
|
2159
|
-
inputSchema: {
|
|
2160
|
-
type: "object",
|
|
2161
|
-
properties: {
|
|
2162
|
-
limit: {
|
|
2163
|
-
type: "number",
|
|
2164
|
-
description: "Maximum number of queries to return (default: 10, max: 100)",
|
|
2165
|
-
},
|
|
2166
|
-
threshold_seconds: {
|
|
2167
|
-
type: "number",
|
|
2168
|
-
description: "Execution time threshold in seconds (default: 1)",
|
|
2169
|
-
},
|
|
2170
|
-
},
|
|
2171
|
-
},
|
|
2172
|
-
},
|
|
2173
|
-
{
|
|
2174
|
-
name: "get_table_io_stats",
|
|
2175
|
-
description: "Get I/O statistics for tables including read/write operations and timings.",
|
|
2176
|
-
inputSchema: {
|
|
2177
|
-
type: "object",
|
|
2178
|
-
properties: {
|
|
2179
|
-
limit: {
|
|
2180
|
-
type: "number",
|
|
2181
|
-
description: "Maximum number of tables to return (default: 20, max: 100)",
|
|
2182
|
-
},
|
|
2183
|
-
table_schema: {
|
|
2184
|
-
type: "string",
|
|
2185
|
-
description: "Filter by specific database schema",
|
|
2186
|
-
},
|
|
2187
|
-
},
|
|
2188
|
-
},
|
|
2189
|
-
},
|
|
2190
|
-
{
|
|
2191
|
-
name: "get_index_usage_stats",
|
|
2192
|
-
description: "Get index usage statistics showing how often each index is used.",
|
|
2193
|
-
inputSchema: {
|
|
2194
|
-
type: "object",
|
|
2195
|
-
properties: {
|
|
2196
|
-
limit: {
|
|
2197
|
-
type: "number",
|
|
2198
|
-
description: "Maximum number of indexes to return (default: 20, max: 100)",
|
|
2199
|
-
},
|
|
2200
|
-
table_schema: {
|
|
2201
|
-
type: "string",
|
|
2202
|
-
description: "Filter by specific database schema",
|
|
2203
|
-
},
|
|
2204
|
-
},
|
|
2205
|
-
},
|
|
2206
|
-
},
|
|
2207
|
-
{
|
|
2208
|
-
name: "get_unused_indexes",
|
|
2209
|
-
description: "Identify indexes that are not being used by queries. These may be candidates for removal to improve write performance.",
|
|
2210
|
-
inputSchema: {
|
|
2211
|
-
type: "object",
|
|
2212
|
-
properties: {
|
|
2213
|
-
table_schema: {
|
|
2214
|
-
type: "string",
|
|
2215
|
-
description: "Filter by specific database schema",
|
|
2216
|
-
},
|
|
2217
|
-
},
|
|
2218
|
-
},
|
|
2219
|
-
},
|
|
2220
|
-
{
|
|
2221
|
-
name: "get_connection_pool_stats",
|
|
2222
|
-
description: "Get connection pool statistics including current connections, max usage, configuration, and health indicators.",
|
|
2223
|
-
inputSchema: {
|
|
2224
|
-
type: "object",
|
|
2225
|
-
properties: {},
|
|
2226
|
-
},
|
|
2227
|
-
},
|
|
2228
|
-
{
|
|
2229
|
-
name: "get_database_health_check",
|
|
2230
|
-
description: "Perform a comprehensive health check of the database including connection usage, buffer pool efficiency, aborted connections, and slow queries.",
|
|
2231
|
-
inputSchema: {
|
|
2232
|
-
type: "object",
|
|
2233
|
-
properties: {},
|
|
2234
|
-
},
|
|
2235
|
-
},
|
|
2236
|
-
{
|
|
2237
|
-
name: "reset_performance_stats",
|
|
2238
|
-
description: "Reset performance schema statistics. This clears query digest statistics, table I/O stats, and index usage stats. Requires 'utility' permission.",
|
|
2239
|
-
inputSchema: {
|
|
2240
|
-
type: "object",
|
|
2241
|
-
properties: {},
|
|
2242
|
-
},
|
|
2243
|
-
},
|
|
2244
1933
|
{
|
|
2245
1934
|
name: "create_fulltext_index",
|
|
2246
1935
|
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.",
|
|
@@ -2577,22 +2266,6 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
2577
2266
|
case "export_table_to_csv":
|
|
2578
2267
|
result = await mysqlMCP.exportTableToCSV((args || {}));
|
|
2579
2268
|
break;
|
|
2580
|
-
// Cache Management Tools
|
|
2581
|
-
case "get_cache_stats":
|
|
2582
|
-
result = mysqlMCP.getCacheStats();
|
|
2583
|
-
break;
|
|
2584
|
-
case "get_cache_config":
|
|
2585
|
-
result = mysqlMCP.getCacheConfig();
|
|
2586
|
-
break;
|
|
2587
|
-
case "configure_cache":
|
|
2588
|
-
result = mysqlMCP.configureCacheSettings((args || {}));
|
|
2589
|
-
break;
|
|
2590
|
-
case "clear_cache":
|
|
2591
|
-
result = mysqlMCP.clearCache();
|
|
2592
|
-
break;
|
|
2593
|
-
case "invalidate_table_cache":
|
|
2594
|
-
result = mysqlMCP.invalidateCacheForTable((args || {}));
|
|
2595
|
-
break;
|
|
2596
2269
|
// Query Optimization Tools
|
|
2597
2270
|
case "analyze_query":
|
|
2598
2271
|
result = mysqlMCP.analyzeQuery((args || {}));
|
|
@@ -2717,44 +2390,6 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
2717
2390
|
case "get_table_size":
|
|
2718
2391
|
result = await mysqlMCP.getTableSize((args || {}));
|
|
2719
2392
|
break;
|
|
2720
|
-
// Process Management Tools
|
|
2721
|
-
case "show_process_list":
|
|
2722
|
-
result = await mysqlMCP.showProcessList((args || {}));
|
|
2723
|
-
break;
|
|
2724
|
-
case "kill_process":
|
|
2725
|
-
result = await mysqlMCP.killProcess((args || {}));
|
|
2726
|
-
break;
|
|
2727
|
-
case "show_status":
|
|
2728
|
-
result = await mysqlMCP.showStatus((args || {}));
|
|
2729
|
-
break;
|
|
2730
|
-
case "show_variables":
|
|
2731
|
-
result = await mysqlMCP.showVariables((args || {}));
|
|
2732
|
-
break;
|
|
2733
|
-
case "explain_query":
|
|
2734
|
-
result = await mysqlMCP.explainQuery((args || {}));
|
|
2735
|
-
break;
|
|
2736
|
-
// Performance Monitoring Tools
|
|
2737
|
-
case "get_performance_metrics":
|
|
2738
|
-
result = await mysqlMCP.getPerformanceMetrics();
|
|
2739
|
-
break;
|
|
2740
|
-
case "get_table_io_stats":
|
|
2741
|
-
result = await mysqlMCP.getTableIOStats((args || {}));
|
|
2742
|
-
break;
|
|
2743
|
-
case "get_index_usage_stats":
|
|
2744
|
-
result = await mysqlMCP.getIndexUsageStats((args || {}));
|
|
2745
|
-
break;
|
|
2746
|
-
case "get_unused_indexes":
|
|
2747
|
-
result = await mysqlMCP.getUnusedIndexes((args || {}));
|
|
2748
|
-
break;
|
|
2749
|
-
case "get_connection_pool_stats":
|
|
2750
|
-
result = await mysqlMCP.getConnectionPoolStats();
|
|
2751
|
-
break;
|
|
2752
|
-
case "get_database_health_check":
|
|
2753
|
-
result = await mysqlMCP.getDatabaseHealthCheck();
|
|
2754
|
-
break;
|
|
2755
|
-
case "reset_performance_stats":
|
|
2756
|
-
result = await mysqlMCP.resetPerformanceStats();
|
|
2757
|
-
break;
|
|
2758
2393
|
case "repair_query":
|
|
2759
2394
|
result = await mysqlMCP.repairQuery((args || {}));
|
|
2760
2395
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@berthojoris/mcp-mysql-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions, backup/restore capabilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|