@berthojoris/mcp-mysql-server 1.40.7 → 1.42.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 +19 -0
- package/DOCUMENTATIONS.md +75 -16
- package/README.md +7 -5
- package/bin/mcp-mysql.js +5 -5
- package/dist/config/featureConfig.d.ts +3 -2
- package/dist/config/featureConfig.js +32 -3
- package/dist/index.d.ts +31 -0
- package/dist/index.js +45 -0
- package/dist/mcp-server.js +306 -1
- package/dist/tools/relationalSeederTools.d.ts +207 -0
- package/dist/tools/relationalSeederTools.js +1432 -0
- package/dist/tools/toolArgumentValidation.js +112 -0
- package/dist/tools/utilityTools.js +8 -0
- package/manifest.json +363 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ 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.42.0] - 2026-05-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Added composite FK/PK tuple resolution for relational seeding so multi-column relationships are selected and validated as intact parent key tuples.
|
|
12
|
+
- Added `infer_seed_rules` to infer safe seed generators from schema, samples, unique indexes, and ecommerce/POS/CRM domain presets.
|
|
13
|
+
- Added `seed_from_template` to create plan-first ecommerce, POS, and CRM seed workflows with detected tables and template-scale row counts.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Updated seed tool count to 6 and total MCP tools to 85.
|
|
17
|
+
|
|
18
|
+
## [1.41.0] - 2026-05-11
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- Added `seed_operations` category with `plan_seed_data`, `generate_seed_preview`, `execute_seed_plan`, and `validate_seed_integrity` for FK-aware relational dummy data seeding.
|
|
22
|
+
- Added deterministic seed planning, preview, confirmation token, transaction rollback, production-name guard, and integrity validation support.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Updated tool totals and version metadata to `1.41.0`.
|
|
26
|
+
|
|
8
27
|
## [1.40.7] - 2026-05-06
|
|
9
28
|
|
|
10
29
|
### Added
|
package/DOCUMENTATIONS.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# MySQL MCP Server - Documentation
|
|
2
2
|
|
|
3
|
-
**Last Updated:** 2026-05-
|
|
4
|
-
**Version:** 1.
|
|
5
|
-
**Total Tools:**
|
|
3
|
+
**Last Updated:** 2026-05-11 10:44:46
|
|
4
|
+
**Version:** 1.42.0
|
|
5
|
+
**Total Tools:** 85
|
|
6
6
|
|
|
7
7
|
Comprehensive documentation for the MySQL MCP Server. For quick start, see [README.md](README.md).
|
|
8
8
|
|
|
@@ -109,7 +109,7 @@ For CSV exports, use `export_table_to_csv` for table-based exports and `export_q
|
|
|
109
109
|
|------------|------------|---------------|
|
|
110
110
|
| `list` | List/discover objects | `list_databases`, `list_tables` |
|
|
111
111
|
| `read` | Read data | `read_records`, `run_select_query` |
|
|
112
|
-
| `create` | Insert records | `create_record`, `bulk_insert` |
|
|
112
|
+
| `create` | Insert records and seed data | `create_record`, `bulk_insert`, `execute_seed_plan` |
|
|
113
113
|
| `update` | Update records | `update_record`, `bulk_update` |
|
|
114
114
|
| `delete` | Delete records | `delete_record`, `bulk_delete` |
|
|
115
115
|
| `execute` | Custom SQL | `execute_write_query` |
|
|
@@ -149,22 +149,30 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
149
149
|
- `bulk_update` - Batch update (performance)
|
|
150
150
|
- `bulk_delete` - Batch delete (performance)
|
|
151
151
|
|
|
152
|
-
### 4.
|
|
152
|
+
### 4. Seed Operations (6 tools)
|
|
153
|
+
- `plan_seed_data` - Build FK-aware relational seed plans
|
|
154
|
+
- `generate_seed_preview` - Preview deterministic dummy rows without writing
|
|
155
|
+
- `execute_seed_plan` - Execute confirmed seed plans with transaction and rollback safety
|
|
156
|
+
- `validate_seed_integrity` - Validate row counts, FK orphans, required columns, and unique collisions
|
|
157
|
+
- `infer_seed_rules` - Infer advanced generators from schema, samples, unique indexes, and domain presets
|
|
158
|
+
- `seed_from_template` - Create reusable plan-first seed workflows for ecommerce, POS, and CRM domains
|
|
159
|
+
|
|
160
|
+
### 5. Query Management (3 tools)
|
|
153
161
|
- `run_select_query` - Execute SELECT queries
|
|
154
162
|
- `execute_write_query` - Execute INSERT/UPDATE/DELETE
|
|
155
163
|
- `repair_query` - Diagnose and fix SQL errors
|
|
156
164
|
|
|
157
|
-
###
|
|
165
|
+
### 6. Schema Management (4 tools)
|
|
158
166
|
- `create_table` - Create new tables
|
|
159
167
|
- `alter_table` - Modify table structure
|
|
160
168
|
- `drop_table` - Delete tables
|
|
161
169
|
- `execute_ddl` - Execute raw DDL
|
|
162
170
|
|
|
163
|
-
###
|
|
171
|
+
### 7. Data Export (2 tools)
|
|
164
172
|
- `export_table_to_csv` - Export table data to CSV
|
|
165
173
|
- `export_query_to_csv` - Export SELECT query results to CSV
|
|
166
174
|
|
|
167
|
-
###
|
|
175
|
+
### 8. Index Management (10 tools)
|
|
168
176
|
- `list_indexes` - List table indexes
|
|
169
177
|
- `get_index_info` - Get index details
|
|
170
178
|
- `create_index` - Create indexes
|
|
@@ -176,7 +184,7 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
176
184
|
- `get_fulltext_stats` - Get FULLTEXT index statistics
|
|
177
185
|
- `optimize_fulltext` - Optimize FULLTEXT indexes
|
|
178
186
|
|
|
179
|
-
###
|
|
187
|
+
### 9. Constraint Management (7 tools)
|
|
180
188
|
- `list_foreign_keys` - List foreign keys
|
|
181
189
|
- `list_constraints` - List all constraints
|
|
182
190
|
- `add_foreign_key` - Add foreign key
|
|
@@ -185,7 +193,7 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
185
193
|
- `drop_constraint` - Remove constraint
|
|
186
194
|
- `add_check_constraint` - Add check constraint
|
|
187
195
|
|
|
188
|
-
###
|
|
196
|
+
### 10. Stored Procedures (6 tools)
|
|
189
197
|
- `list_stored_procedures` - List procedures
|
|
190
198
|
- `get_stored_procedure_info` - Get procedure details
|
|
191
199
|
- `execute_stored_procedure` - Execute procedures
|
|
@@ -193,7 +201,7 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
193
201
|
- `drop_stored_procedure` - Remove procedures
|
|
194
202
|
- `show_create_procedure` - Show CREATE statement
|
|
195
203
|
|
|
196
|
-
###
|
|
204
|
+
### 11. Views Management (6 tools)
|
|
197
205
|
- `list_views` - List views
|
|
198
206
|
- `get_view_info` - Get view details
|
|
199
207
|
- `create_view` - Create views
|
|
@@ -201,14 +209,14 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
201
209
|
- `drop_view` - Remove views
|
|
202
210
|
- `show_create_view` - Show CREATE statement
|
|
203
211
|
|
|
204
|
-
###
|
|
212
|
+
### 12. Triggers Management (5 tools)
|
|
205
213
|
- `list_triggers` - List triggers
|
|
206
214
|
- `get_trigger_info` - Get trigger details
|
|
207
215
|
- `create_trigger` - Create triggers
|
|
208
216
|
- `drop_trigger` - Remove triggers
|
|
209
217
|
- `show_create_trigger` - Show CREATE statement
|
|
210
218
|
|
|
211
|
-
###
|
|
219
|
+
### 13. Table Maintenance (8 tools)
|
|
212
220
|
- `analyze_table` - Update statistics
|
|
213
221
|
- `optimize_table` - Reclaim space
|
|
214
222
|
- `check_table` - Check for errors
|
|
@@ -218,19 +226,19 @@ Tool enabled = (Has Permission) AND (Has Category OR No categories specified)
|
|
|
218
226
|
- `flush_table` - Close/reopen table
|
|
219
227
|
- `get_table_size` - Get size information
|
|
220
228
|
|
|
221
|
-
###
|
|
229
|
+
### 14. Transaction Management (5 tools)
|
|
222
230
|
- `begin_transaction` - Start transaction
|
|
223
231
|
- `commit_transaction` - Commit transaction
|
|
224
232
|
- `rollback_transaction` - Rollback transaction
|
|
225
233
|
- `get_transaction_status` - Check transaction state
|
|
226
234
|
- `execute_in_transaction` - Execute within transaction
|
|
227
235
|
|
|
228
|
-
###
|
|
236
|
+
### 15. Query Optimization (3 tools)
|
|
229
237
|
- `analyze_query` - Analyze query performance
|
|
230
238
|
- `get_optimization_hints` - Get optimizer hints
|
|
231
239
|
- `repair_query` - Repair broken SQL queries
|
|
232
240
|
|
|
233
|
-
###
|
|
241
|
+
### 16. Utilities (5 tools)
|
|
234
242
|
- `test_connection` - Test connectivity
|
|
235
243
|
- `describe_connection` - Connection info
|
|
236
244
|
- `read_changelog` - Read changelog
|
|
@@ -329,6 +337,57 @@ For high-performance operations with large datasets:
|
|
|
329
337
|
- **Bulk Update**: Update multiple records with different conditions
|
|
330
338
|
- **Bulk Delete**: Delete multiple record sets in batches
|
|
331
339
|
|
|
340
|
+
### Relational Data Seeder
|
|
341
|
+
|
|
342
|
+
For dummy data on related tables, use the seed workflow:
|
|
343
|
+
|
|
344
|
+
```javascript
|
|
345
|
+
const plan = await mcp.call("plan_seed_data", {
|
|
346
|
+
target_tables: ["orders"],
|
|
347
|
+
rows_per_table: 20,
|
|
348
|
+
include_dependencies: true,
|
|
349
|
+
include_children: true,
|
|
350
|
+
random_seed: 42
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
await mcp.call("generate_seed_preview", {
|
|
354
|
+
plan_id: plan.plan_id,
|
|
355
|
+
max_preview_rows_per_table: 3
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
await mcp.call("execute_seed_plan", {
|
|
359
|
+
plan_id: plan.plan_id,
|
|
360
|
+
dry_run: false,
|
|
361
|
+
confirm_token: plan.confirm_token
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
await mcp.call("validate_seed_integrity", {
|
|
365
|
+
plan_id: plan.plan_id
|
|
366
|
+
});
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
`execute_seed_plan` defaults to dry-run, requires confirmation for writes, blocks production-like database names unless explicitly allowed, and uses transaction rollback on errors.
|
|
370
|
+
|
|
371
|
+
Composite FK/PK support resolves multi-column parent tuples together, so relations such as `(tenant_id, region_id)` or `(tenant_id, region_id, order_id)` are not mixed across different parent rows.
|
|
372
|
+
|
|
373
|
+
Advanced rule inference and templates:
|
|
374
|
+
|
|
375
|
+
```javascript
|
|
376
|
+
await mcp.call("infer_seed_rules", {
|
|
377
|
+
tables: ["orders", "order_items"],
|
|
378
|
+
domain: "ecommerce",
|
|
379
|
+
sample_size: 25
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
await mcp.call("seed_from_template", {
|
|
383
|
+
template: "ecommerce",
|
|
384
|
+
scale: "small",
|
|
385
|
+
random_seed: 42
|
|
386
|
+
});
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
`seed_from_template` is plan-first and does not write data directly. Review its plan/preview, then execute with `execute_seed_plan`.
|
|
390
|
+
|
|
332
391
|
### Transaction Management
|
|
333
392
|
|
|
334
393
|
Full ACID transaction support:
|
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-05-
|
|
7
|
+
**Last Updated:** 2026-05-11 10:44:46
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
|
|
10
10
|
[](https://www.npmjs.com/package/@berthojoris/mcp-mysql-server)
|
|
@@ -148,8 +148,8 @@ If you want ready-to-copy snippets per client (Claude Code/Cursor/Windsurf/Cline
|
|
|
148
148
|
"-y",
|
|
149
149
|
"@berthojoris/mcp-mysql-server",
|
|
150
150
|
"mysql://user:password@localhost:3306/database_name_here",
|
|
151
|
-
"list,read,utility,create,update,ddl",
|
|
152
|
-
"database_discovery,crud_operations,custom_queries,schema_management,index_management,constraint_management,table_maintenance,query_optimization,analysis"
|
|
151
|
+
"list,read,utility,create,update,ddl,transaction",
|
|
152
|
+
"database_discovery,crud_operations,custom_queries,schema_management,index_management,constraint_management,table_maintenance,query_optimization,analysis,seed_operations"
|
|
153
153
|
]
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -282,6 +282,7 @@ Use documentation categories to fine-tune which tools are exposed (Layer 2):
|
|
|
282
282
|
| `database_discovery` | Explore databases, tables, and schema structure | `get_all_tables_relationships, list_databases, list_tables, read_table_schema` |
|
|
283
283
|
| `crud_operations` | Create, read, update, delete operations on data | `create_record, delete_record, read_records, update_record` |
|
|
284
284
|
| `bulk_operations` | High-performance batch processing operations | `bulk_delete, bulk_insert, bulk_update` |
|
|
285
|
+
| `seed_operations` | FK-aware relational dummy data seeding | `execute_seed_plan, generate_seed_preview, infer_seed_rules, plan_seed_data, seed_from_template, validate_seed_integrity` |
|
|
285
286
|
| `custom_queries` | Execute custom SQL queries and advanced operations | `execute_write_query, run_select_query` |
|
|
286
287
|
| `schema_management` | Manage database schema, tables, and structure | `alter_table, create_table, drop_table, execute_ddl` |
|
|
287
288
|
| `utilities` | Database utilities, diagnostics, and helper functions | `cursor_execute_request, describe_connection, export_query_to_csv, export_table_to_csv, list_all_tools, read_changelog, test_connection` |
|
|
@@ -299,7 +300,7 @@ Use documentation categories to fine-tune which tools are exposed (Layer 2):
|
|
|
299
300
|
<summary>Copy/paste list (comma-separated, no spaces)</summary>
|
|
300
301
|
|
|
301
302
|
```text
|
|
302
|
-
database_discovery,crud_operations,bulk_operations,custom_queries,schema_management,utilities,transaction_management,stored_procedures,views_management,triggers_management,index_management,constraint_management,table_maintenance,query_optimization,analysis
|
|
303
|
+
database_discovery,crud_operations,bulk_operations,seed_operations,custom_queries,schema_management,utilities,transaction_management,stored_procedures,views_management,triggers_management,index_management,constraint_management,table_maintenance,query_optimization,analysis
|
|
303
304
|
```
|
|
304
305
|
|
|
305
306
|
</details>
|
|
@@ -310,7 +311,7 @@ Full category → tool mapping (and examples) lives in **[DOCUMENTATIONS.md →
|
|
|
310
311
|
|
|
311
312
|
## Available Tools
|
|
312
313
|
|
|
313
|
-
The server exposes **
|
|
314
|
+
The server exposes **85 tools** organized into categories (CRUD, seed, schema, and utilities).
|
|
314
315
|
|
|
315
316
|
- Complete list of tools: **[DOCUMENTATIONS.md → Complete Tools Reference](DOCUMENTATIONS.md#🔧-complete-tools-reference)**
|
|
316
317
|
|
|
@@ -322,6 +323,7 @@ For comprehensive documentation, see **[DOCUMENTATIONS.md](DOCUMENTATIONS.md)**:
|
|
|
322
323
|
|
|
323
324
|
- **DDL Operations** - Create, alter, and drop tables
|
|
324
325
|
- **Data Export Tools** - Export to CSV, JSON, and SQL formats
|
|
326
|
+
- **Relational Data Seeder** - Plan, preview, execute, validate, infer rules, and template FK-aware dummy data
|
|
325
327
|
- **Data Import Tools** - Import from CSV and JSON sources
|
|
326
328
|
- **Data Migration Tools** - Copy, move, clone, compare, and sync data
|
|
327
329
|
- **Schema Versioning** - Version control for database schema changes
|
package/bin/mcp-mysql.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* MCP MySQL Server CLI
|
|
@@ -50,7 +50,7 @@ if (!mysqlUrl) {
|
|
|
50
50
|
" # Dual-layer: Permissions + Categories (fine-grained control)",
|
|
51
51
|
);
|
|
52
52
|
console.error(
|
|
53
|
-
' mcp-mysql mysql://root:pass@localhost:3306/mydb "list,read,utility" "database_discovery,custom_queries,analysis"',
|
|
53
|
+
' mcp-mysql mysql://root:pass@localhost:3306/mydb "list,read,utility" "database_discovery,custom_queries,analysis"',
|
|
54
54
|
);
|
|
55
55
|
console.error("");
|
|
56
56
|
console.error("Permissions (Layer 1 - Broad Control):");
|
|
@@ -66,13 +66,13 @@ if (!mysqlUrl) {
|
|
|
66
66
|
" schema_management, utilities, transaction_management, stored_procedures,",
|
|
67
67
|
);
|
|
68
68
|
console.error(
|
|
69
|
-
" views_management, triggers_management, index_management,",
|
|
69
|
+
" views_management, triggers_management, index_management,",
|
|
70
70
|
);
|
|
71
71
|
console.error(
|
|
72
|
-
" constraint_management, table_maintenance, query_optimization,",
|
|
72
|
+
" constraint_management, table_maintenance, query_optimization,",
|
|
73
73
|
);
|
|
74
74
|
console.error(
|
|
75
|
-
" analysis",
|
|
75
|
+
" analysis, seed_operations",
|
|
76
76
|
);
|
|
77
77
|
console.error("");
|
|
78
78
|
console.error("Filtering Logic:");
|
|
@@ -14,7 +14,7 @@ export declare enum ToolCategory {
|
|
|
14
14
|
PROCEDURE = "procedure"
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Documentation categories from README
|
|
17
|
+
* Documentation categories from README
|
|
18
18
|
* More intuitive and matches user mental model
|
|
19
19
|
*/
|
|
20
20
|
export declare enum DocCategory {
|
|
@@ -32,7 +32,8 @@ export declare enum DocCategory {
|
|
|
32
32
|
CONSTRAINT_MANAGEMENT = "constraint_management",
|
|
33
33
|
TABLE_MAINTENANCE = "table_maintenance",
|
|
34
34
|
QUERY_OPTIMIZATION = "query_optimization",
|
|
35
|
-
ANALYSIS = "analysis"
|
|
35
|
+
ANALYSIS = "analysis",
|
|
36
|
+
SEED_OPERATIONS = "seed_operations"
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Map of tool names to their legacy categories
|
|
@@ -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
|
|
28
28
|
* More intuitive and matches user mental model
|
|
29
29
|
*/
|
|
30
30
|
var DocCategory;
|
|
@@ -44,6 +44,7 @@ var DocCategory;
|
|
|
44
44
|
DocCategory["TABLE_MAINTENANCE"] = "table_maintenance";
|
|
45
45
|
DocCategory["QUERY_OPTIMIZATION"] = "query_optimization";
|
|
46
46
|
DocCategory["ANALYSIS"] = "analysis";
|
|
47
|
+
DocCategory["SEED_OPERATIONS"] = "seed_operations";
|
|
47
48
|
})(DocCategory || (exports.DocCategory = DocCategory = {}));
|
|
48
49
|
/**
|
|
49
50
|
* Map of tool names to their legacy categories
|
|
@@ -72,6 +73,19 @@ exports.toolCategoryMap = {
|
|
|
72
73
|
bulkInsert: ToolCategory.CREATE,
|
|
73
74
|
bulkUpdate: ToolCategory.UPDATE,
|
|
74
75
|
bulkDelete: ToolCategory.DELETE,
|
|
76
|
+
// Seed operations
|
|
77
|
+
planSeedData: ToolCategory.LIST,
|
|
78
|
+
plan_seed_data: ToolCategory.LIST,
|
|
79
|
+
generateSeedPreview: ToolCategory.READ,
|
|
80
|
+
generate_seed_preview: ToolCategory.READ,
|
|
81
|
+
executeSeedPlan: ToolCategory.CREATE,
|
|
82
|
+
execute_seed_plan: ToolCategory.CREATE,
|
|
83
|
+
validateSeedIntegrity: ToolCategory.READ,
|
|
84
|
+
validate_seed_integrity: ToolCategory.READ,
|
|
85
|
+
inferSeedRules: ToolCategory.READ,
|
|
86
|
+
infer_seed_rules: ToolCategory.READ,
|
|
87
|
+
seedFromTemplate: ToolCategory.LIST,
|
|
88
|
+
seed_from_template: ToolCategory.LIST,
|
|
75
89
|
// Query tools
|
|
76
90
|
runSelectQuery: ToolCategory.READ,
|
|
77
91
|
executeWriteQuery: ToolCategory.EXECUTE,
|
|
@@ -175,6 +189,19 @@ exports.toolDocCategoryMap = {
|
|
|
175
189
|
bulkInsert: DocCategory.BULK_OPERATIONS,
|
|
176
190
|
bulkUpdate: DocCategory.BULK_OPERATIONS,
|
|
177
191
|
bulkDelete: DocCategory.BULK_OPERATIONS,
|
|
192
|
+
// Seed Operations
|
|
193
|
+
planSeedData: DocCategory.SEED_OPERATIONS,
|
|
194
|
+
plan_seed_data: DocCategory.SEED_OPERATIONS,
|
|
195
|
+
generateSeedPreview: DocCategory.SEED_OPERATIONS,
|
|
196
|
+
generate_seed_preview: DocCategory.SEED_OPERATIONS,
|
|
197
|
+
executeSeedPlan: DocCategory.SEED_OPERATIONS,
|
|
198
|
+
execute_seed_plan: DocCategory.SEED_OPERATIONS,
|
|
199
|
+
validateSeedIntegrity: DocCategory.SEED_OPERATIONS,
|
|
200
|
+
validate_seed_integrity: DocCategory.SEED_OPERATIONS,
|
|
201
|
+
inferSeedRules: DocCategory.SEED_OPERATIONS,
|
|
202
|
+
infer_seed_rules: DocCategory.SEED_OPERATIONS,
|
|
203
|
+
seedFromTemplate: DocCategory.SEED_OPERATIONS,
|
|
204
|
+
seed_from_template: DocCategory.SEED_OPERATIONS,
|
|
178
205
|
// Custom Queries
|
|
179
206
|
runSelectQuery: DocCategory.CUSTOM_QUERIES,
|
|
180
207
|
executeWriteQuery: DocCategory.CUSTOM_QUERIES,
|
|
@@ -283,11 +310,13 @@ const legacyToDocCategoryMap = {
|
|
|
283
310
|
DocCategory.TABLE_MAINTENANCE,
|
|
284
311
|
DocCategory.ANALYSIS,
|
|
285
312
|
DocCategory.UTILITIES,
|
|
313
|
+
DocCategory.SEED_OPERATIONS,
|
|
286
314
|
],
|
|
287
|
-
read: [DocCategory.CRUD_OPERATIONS, DocCategory.CUSTOM_QUERIES, DocCategory.ANALYSIS],
|
|
315
|
+
read: [DocCategory.CRUD_OPERATIONS, DocCategory.CUSTOM_QUERIES, DocCategory.ANALYSIS, DocCategory.SEED_OPERATIONS],
|
|
288
316
|
create: [
|
|
289
317
|
DocCategory.CRUD_OPERATIONS,
|
|
290
318
|
DocCategory.BULK_OPERATIONS,
|
|
319
|
+
DocCategory.SEED_OPERATIONS,
|
|
291
320
|
],
|
|
292
321
|
update: [
|
|
293
322
|
DocCategory.CRUD_OPERATIONS,
|
|
@@ -311,7 +340,7 @@ const legacyToDocCategoryMap = {
|
|
|
311
340
|
DocCategory.TABLE_MAINTENANCE,
|
|
312
341
|
DocCategory.QUERY_OPTIMIZATION,
|
|
313
342
|
],
|
|
314
|
-
transaction: [DocCategory.TRANSACTION_MANAGEMENT],
|
|
343
|
+
transaction: [DocCategory.TRANSACTION_MANAGEMENT, DocCategory.SEED_OPERATIONS],
|
|
315
344
|
procedure: [DocCategory.STORED_PROCEDURES],
|
|
316
345
|
};
|
|
317
346
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class MySQLMCP {
|
|
|
21
21
|
private macroTools;
|
|
22
22
|
private smartQueryBuilderTools;
|
|
23
23
|
private fulltextSearchTools;
|
|
24
|
+
private relationalSeederTools;
|
|
24
25
|
private security;
|
|
25
26
|
private featureConfig;
|
|
26
27
|
constructor(permissionsConfig?: string, categoriesConfig?: string);
|
|
@@ -427,6 +428,36 @@ export declare class MySQLMCP {
|
|
|
427
428
|
data?: any;
|
|
428
429
|
error?: string;
|
|
429
430
|
}>;
|
|
431
|
+
planSeedData(params: any): Promise<{
|
|
432
|
+
status: string;
|
|
433
|
+
data?: any;
|
|
434
|
+
error?: string;
|
|
435
|
+
}>;
|
|
436
|
+
generateSeedPreview(params: any): Promise<{
|
|
437
|
+
status: string;
|
|
438
|
+
data?: any;
|
|
439
|
+
error?: string;
|
|
440
|
+
}>;
|
|
441
|
+
executeSeedPlan(params: any): Promise<{
|
|
442
|
+
status: string;
|
|
443
|
+
data?: any;
|
|
444
|
+
error?: string;
|
|
445
|
+
}>;
|
|
446
|
+
validateSeedIntegrity(params: any): Promise<{
|
|
447
|
+
status: string;
|
|
448
|
+
data?: any;
|
|
449
|
+
error?: string;
|
|
450
|
+
}>;
|
|
451
|
+
inferSeedRules(params: any): Promise<{
|
|
452
|
+
status: string;
|
|
453
|
+
data?: any;
|
|
454
|
+
error?: string;
|
|
455
|
+
}>;
|
|
456
|
+
seedFromTemplate(params: any): Promise<{
|
|
457
|
+
status: string;
|
|
458
|
+
data?: any;
|
|
459
|
+
error?: string;
|
|
460
|
+
}>;
|
|
430
461
|
close(): Promise<void>;
|
|
431
462
|
/**
|
|
432
463
|
* Analyze a query and get optimization suggestions
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const aiTools_1 = require("./tools/aiTools");
|
|
|
22
22
|
const macroTools_1 = require("./tools/macroTools");
|
|
23
23
|
const smartQueryBuilderTools_1 = require("./tools/smartQueryBuilderTools");
|
|
24
24
|
const fulltextSearchTools_1 = require("./tools/fulltextSearchTools");
|
|
25
|
+
const relationalSeederTools_1 = require("./tools/relationalSeederTools");
|
|
25
26
|
const securityLayer_1 = __importDefault(require("./security/securityLayer"));
|
|
26
27
|
const connection_1 = __importDefault(require("./db/connection"));
|
|
27
28
|
const featureConfig_1 = require("./config/featureConfig");
|
|
@@ -51,6 +52,7 @@ class MySQLMCP {
|
|
|
51
52
|
this.macroTools = new macroTools_1.MacroTools(this.security);
|
|
52
53
|
this.smartQueryBuilderTools = new smartQueryBuilderTools_1.SmartQueryBuilderTools(this.security);
|
|
53
54
|
this.fulltextSearchTools = new fulltextSearchTools_1.FulltextSearchTools(this.security);
|
|
55
|
+
this.relationalSeederTools = new relationalSeederTools_1.RelationalSeederTools(this.security);
|
|
54
56
|
}
|
|
55
57
|
// Helper method to check if tool is enabled
|
|
56
58
|
checkToolEnabled(toolName) {
|
|
@@ -414,6 +416,49 @@ class MySQLMCP {
|
|
|
414
416
|
}
|
|
415
417
|
return this.crudTools.bulkDelete(params);
|
|
416
418
|
}
|
|
419
|
+
// Relational Data Seeder Tools
|
|
420
|
+
async planSeedData(params) {
|
|
421
|
+
const check = this.checkToolEnabled("planSeedData");
|
|
422
|
+
if (!check.enabled) {
|
|
423
|
+
return { status: "error", error: check.error };
|
|
424
|
+
}
|
|
425
|
+
return await this.relationalSeederTools.planSeedData(params);
|
|
426
|
+
}
|
|
427
|
+
async generateSeedPreview(params) {
|
|
428
|
+
const check = this.checkToolEnabled("generateSeedPreview");
|
|
429
|
+
if (!check.enabled) {
|
|
430
|
+
return { status: "error", error: check.error };
|
|
431
|
+
}
|
|
432
|
+
return await this.relationalSeederTools.generateSeedPreview(params);
|
|
433
|
+
}
|
|
434
|
+
async executeSeedPlan(params) {
|
|
435
|
+
const check = this.checkToolEnabled("executeSeedPlan");
|
|
436
|
+
if (!check.enabled) {
|
|
437
|
+
return { status: "error", error: check.error };
|
|
438
|
+
}
|
|
439
|
+
return await this.relationalSeederTools.executeSeedPlan(params);
|
|
440
|
+
}
|
|
441
|
+
async validateSeedIntegrity(params) {
|
|
442
|
+
const check = this.checkToolEnabled("validateSeedIntegrity");
|
|
443
|
+
if (!check.enabled) {
|
|
444
|
+
return { status: "error", error: check.error };
|
|
445
|
+
}
|
|
446
|
+
return await this.relationalSeederTools.validateSeedIntegrity(params);
|
|
447
|
+
}
|
|
448
|
+
async inferSeedRules(params) {
|
|
449
|
+
const check = this.checkToolEnabled("inferSeedRules");
|
|
450
|
+
if (!check.enabled) {
|
|
451
|
+
return { status: "error", error: check.error };
|
|
452
|
+
}
|
|
453
|
+
return await this.relationalSeederTools.inferSeedRules(params);
|
|
454
|
+
}
|
|
455
|
+
async seedFromTemplate(params) {
|
|
456
|
+
const check = this.checkToolEnabled("seedFromTemplate");
|
|
457
|
+
if (!check.enabled) {
|
|
458
|
+
return { status: "error", error: check.error };
|
|
459
|
+
}
|
|
460
|
+
return await this.relationalSeederTools.seedFromTemplate(params);
|
|
461
|
+
}
|
|
417
462
|
// Close database connection
|
|
418
463
|
async close() {
|
|
419
464
|
const db = connection_1.default.getInstance();
|