@berthojoris/mcp-mysql-server 1.26.1 → 1.28.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 CHANGED
@@ -5,6 +5,62 @@ 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.28.0] - 2025-12-21
9
+
10
+ ### Changed
11
+ - **[BREAKING]** Removed `get_table_relationships` tool - use `get_all_tables_relationships` instead for better performance
12
+ - `get_all_tables_relationships` retrieves ALL table relationships in a single efficient query with in-memory processing
13
+ - Much faster than calling `get_table_relationships` repeatedly for each table
14
+ - **Enhanced tool descriptions** for improved LLM understanding across 40+ critical tools:
15
+ - Added visual indicators (emojis) for tool categories: 🤖 AI-powered, ⚡ Performance, 🔒 Security, 📊 Analytics, etc.
16
+ - Clarified when to use each tool vs similar alternatives
17
+ - Added use-case context and examples in descriptions
18
+ - Highlighted AI-first tools for natural language operations
19
+ - Improved consistency in description length and detail level
20
+ - Updated total tool count from 104 to 103 across all documentation
21
+
22
+ ### Fixed
23
+ - Removed duplicate `get_all_tables_relationships` entry in DOCUMENTATIONS.md
24
+ - Corrected references to deprecated `get_table_relationships` in documentation examples
25
+
26
+ ## [1.27.1] - 2025-12-21
27
+
28
+ ### Removed
29
+ - **Deprecated Tools**: Removed legacy `runQuery` and `executeSql` tools completely
30
+ - These tools were replaced by `run_select_query` and `execute_write_query` in v1.27.0
31
+ - Removed from feature configuration mappings
32
+ - Removed validation schemas
33
+ - Updated all internal references to use new tool names
34
+
35
+ ### Changed
36
+ - Updated transaction tools to use `executeWriteQuery` permission check instead of deprecated `executeSql`
37
+
38
+ ## [1.27.0] - 2025-12-21
39
+
40
+ ### Changed
41
+ - **Renamed Tools for Clarity**:
42
+ - `run_query` -> `run_select_query`
43
+ - `execute_sql` -> `execute_write_query`
44
+ - **Updated Error Messages**: Error messages now explicitly reference the new tool names to guide users/LLMs to the correct tool for the job.
45
+ - **Updated Documentation**: Updated README.md and DOCUMENTATIONS.md to reflect the new tool names and configuration examples.
46
+
47
+ ## [1.26.2] - 2025-12-19
48
+
49
+ ### Fixed
50
+ - Updated manifest.json version from 1.17.0 to 1.26.2 to match package.json
51
+ - Verified `list_all_tools` tool is properly registered and available in MCP server
52
+ - Updated documentation timestamps to reflect current changes
53
+
54
+ ## [1.26.3] - 2025-12-19
55
+
56
+ ### Documentation
57
+ - Enhanced README documentation categories table with a "List Tools" column (per-category `list_all_tools` call)
58
+
59
+ ## [1.26.4] - 2025-12-19
60
+
61
+ ### Documentation
62
+ - Fixed README "Documentation Categories (Recommended)" to list the actual tools per category in the "List Tools" column
63
+
8
64
  ## [1.26.1] - 2025-12-19
9
65
 
10
66
  ### Documentation
package/DOCUMENTATIONS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MySQL MCP Server - Detailed Documentation
2
2
 
3
- **Last Updated:** 2025-12-19 18:08:39
3
+ **Last Updated:** 2025-12-21 17:00:00
4
4
 
5
5
  This file contains detailed documentation for all features of the MySQL MCP Server. For quick start and basic information, see [README.md](README.md).
6
6
 
@@ -9,7 +9,7 @@ This file contains detailed documentation for all features of the MySQL MCP Serv
9
9
  ## Table of Contents
10
10
 
11
11
  1. [Setup & Configuration (Extended)](#setup--configuration-extended) - Permissions + Categories
12
- 2. [🔧 Complete Tools Reference](#🔧-complete-tools-reference) - All 145 tools organized by category
12
+ 2. [🔧 Complete Tools Reference](#🔧-complete-tools-reference) - All 103 tools organized by category
13
13
  3. [DDL Operations](#🏗️-ddl-operations)
14
14
  4. [Data Export Tools](#📤-data-export-tools)
15
15
  5. [Data Import Tools](#📥-data-import-tools)
@@ -131,7 +131,7 @@ Use both 2nd argument (permissions) and 3rd argument (categories):
131
131
  **Layer 1 (Permissions)**: Allows `list`, `read`, `utility` operations
132
132
  **Layer 2 (Categories)**: Further restricts to `database_discovery` and `performance_monitoring` tools
133
133
 
134
- **Enabled tools**: `list_databases`, `list_tables`, `read_table_schema`, `get_table_relationships`, `get_performance_metrics`, `get_slow_queries`, etc.
134
+ **Enabled tools**: `list_databases`, `list_tables`, `read_table_schema`, `get_all_tables_relationships`, `get_performance_metrics`, `get_slow_queries`, etc.
135
135
 
136
136
  **Disabled tools**:
137
137
  - `read_records` - Has `read` permission but category is `crud_operations` (not allowed)
@@ -144,11 +144,11 @@ Use both 2nd argument (permissions) and 3rd argument (categories):
144
144
  | Permission | Operations Allowed | Example Tools |
145
145
  |------------|-------------------|---------------|
146
146
  | `list` | List/discover database objects | `list_databases`, `list_tables`, `list_views` |
147
- | `read` | Read data from tables | `read_records`, `run_query` |
147
+ | `read` | Read data from tables | `read_records`, `run_select_query` |
148
148
  | `create` | Insert new records | `create_record`, `bulk_insert` |
149
149
  | `update` | Update existing records | `update_record`, `bulk_update` |
150
150
  | `delete` | Delete records | `delete_record`, `bulk_delete` |
151
- | `execute` | Execute custom SQL | `execute_sql`, `run_query` |
151
+ | `execute` | Execute custom SQL | `execute_write_query` |
152
152
  | `ddl` | Schema changes | `create_table`, `alter_table`, `drop_table` |
153
153
  | `utility` | Utility operations | `test_connection`, `analyze_table` |
154
154
  | `transaction` | Transaction management | `begin_transaction`, `commit_transaction` |
@@ -210,7 +210,7 @@ This section provides a comprehensive reference of all 145 available tools organ
210
210
  | `list_databases` | Lists all databases on the MySQL server |
211
211
  | `list_tables` | Lists all tables in the current/specified database |
212
212
  | `read_table_schema` | Gets detailed schema (columns, types, keys, indexes) |
213
- | `get_table_relationships` | Discovers foreign key relationships |
213
+ | `get_all_tables_relationships` | Gets all table relationships efficiently in one query |
214
214
  | `get_all_tables_relationships` | Gets foreign key relationships for ALL tables in a single call with in-memory processing |
215
215
 
216
216
  ### Data Operations - CRUD
@@ -234,8 +234,8 @@ This section provides a comprehensive reference of all 145 available tools organ
234
234
 
235
235
  | Tool | Description |
236
236
  |------|-------------|
237
- | `run_query` | Execute read-only SELECT queries |
238
- | `execute_sql` | Execute write operations (INSERT, UPDATE, DELETE, or DDL) |
237
+ | `run_select_query` | Execute read-only SELECT queries |
238
+ | `execute_write_query` | Execute write operations (INSERT, UPDATE, DELETE, or DDL) |
239
239
 
240
240
  ### Schema Management - DDL
241
241
 
@@ -3604,7 +3604,7 @@ Create a business glossary from database column names with auto-generated descri
3604
3604
 
3605
3605
  **User:** *"Show me the total number of orders per user for the last 30 days"*
3606
3606
 
3607
- **AI uses `run_query`:**
3607
+ **AI uses `run_select_query`:**
3608
3608
  - Constructs JOIN query
3609
3609
  - Applies date filter
3610
3610
  - Groups by user
@@ -3891,12 +3891,12 @@ Parameters:
3891
3891
 
3892
3892
  Query logs are now included in responses from **ALL 30 tools**:
3893
3893
 
3894
- ✅ **Database Discovery** - `list_databases`, `list_tables`, `read_table_schema`, `get_table_relationships`, `get_all_tables_relationships`
3894
+ ✅ **Database Discovery** - `list_databases`, `list_tables`, `read_table_schema`, `get_all_tables_relationships`
3895
3895
  ✅ **Data Operations** - `create_record`, `read_records`, `update_record`, `delete_record`
3896
3896
  ✅ **Bulk Operations** - `bulk_insert`, `bulk_update`, `bulk_delete`
3897
- ✅ **Custom Queries** - `run_query`, `execute_sql`
3897
+ ✅ **Custom Queries** - `run_select_query`, `execute_write_query`
3898
3898
  ✅ **Schema Management** - `create_table`, `alter_table`, `drop_table`, `execute_ddl`
3899
- ✅ **Utilities** - `get_table_relationships`
3899
+ ✅ **Utilities** - `get_all_tables_relationships`
3900
3900
  ✅ **Transactions** - `execute_in_transaction`
3901
3901
  ✅ **Stored Procedures** - `list_stored_procedures`, `get_stored_procedure_info`, `execute_stored_procedure`, etc.
3902
3902
  ✅ **Data Export** - `export_table_to_csv`, `export_query_to_csv`
@@ -3920,8 +3920,8 @@ Query logs are valuable for:
3920
3920
  ### Tools with Query Logging
3921
3921
 
3922
3922
  All tools that execute queries include logs:
3923
- - `run_query` - SELECT query execution
3924
- - `executeSql` - Write operations (INSERT, UPDATE, DELETE)
3923
+ - `run_select_query` - SELECT query execution
3924
+ - `execute_write_query` - Write operations (INSERT, UPDATE, DELETE)
3925
3925
  - `create_record` - Single record insertion
3926
3926
  - `read_records` - Record querying with filters
3927
3927
  - `update_record` - Record updates
@@ -4025,7 +4025,7 @@ console.log(`Query log memory usage: ~${estimatedMemory} KB`);
4025
4025
 
4026
4026
  - ✅ **Parameterized Queries** - All queries use prepared statements (SQL injection protection)
4027
4027
  - ✅ **Permission-Based Access** - Fine-grained control over operations
4028
- - ✅ **Read-Only Validation** - `run_query` enforces SELECT-only operations
4028
+ - ✅ **Read-Only Validation** - `run_select_query` enforces SELECT-only operations
4029
4029
  - ✅ **DDL Gating** - Schema changes require explicit `ddl` permission
4030
4030
  - ✅ **Condition Requirements** - DELETE operations must include WHERE conditions
4031
4031
  - ✅ **Input Validation** - All inputs validated with JSON schemas
@@ -4145,7 +4145,7 @@ Returns:
4145
4145
 
4146
4146
  - **SELECT queries only**: Only SELECT queries are cached
4147
4147
  - **Automatic invalidation**: INSERT, UPDATE, DELETE operations automatically invalidate related cache entries
4148
- - **Per-query control**: Use `useCache: false` in `run_query` to bypass cache for specific queries
4148
+ - **Per-query control**: Use `useCache: false` in `run_select_query` to bypass cache for specific queries
4149
4149
 
4150
4150
  ---
4151
4151
 
@@ -4161,11 +4161,11 @@ The MySQL MCP server provides advanced query optimization tools that help you im
4161
4161
 
4162
4162
  ### Using Optimizer Hints
4163
4163
 
4164
- When running queries with `run_query`, you can include optimizer hints:
4164
+ When running queries with `run_select_query`, you can include optimizer hints:
4165
4165
 
4166
4166
  ```json
4167
4167
  {
4168
- "tool": "run_query",
4168
+ "tool": "run_select_query",
4169
4169
  "arguments": {
4170
4170
  "query": "SELECT * FROM orders WHERE customer_id = ?",
4171
4171
  "params": [123],
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:** 2025-12-19 18:08:39
7
+ **Last Updated:** 2025-12-21 17:00:00
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@berthojoris/mcp-mysql-server)](https://www.npmjs.com/package/@berthojoris/mysql-mcp)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/@berthojoris/mysql-mcp)](https://www.npmjs.com/package/@berthojoris/mysql-mcp)
@@ -173,7 +173,7 @@ Alternative approach using environment variables instead of connection string:
173
173
  "DB_USER": "root",
174
174
  "DB_PASSWORD": "your_password",
175
175
  "DB_NAME": "your_database",
176
- "MCP_PERMISSIONS": "list,read,utility"
176
+ "MCP_PERMISSIONS": "list,read,utility,create,update,delete"
177
177
  }
178
178
  }
179
179
  }
@@ -194,8 +194,8 @@ Alternative approach using environment variables instead of connection string:
194
194
  "DB_USER": "root",
195
195
  "DB_PASSWORD": "your_password",
196
196
  "DB_NAME": "your_database",
197
- "MCP_PERMISSIONS": "list,read,utility",
198
- "MCP_CATEGORIES": "database_discovery,performance_monitoring"
197
+ "MCP_PERMISSIONS": "list,read,utility,create,update,delete",
198
+ "MCP_CATEGORIES": "database_discovery,performance_monitoring,custom_queries"
199
199
  }
200
200
  }
201
201
  }
@@ -215,71 +215,7 @@ Control database access with a **dual-layer filtering system** that provides bot
215
215
 
216
216
  **Filtering Logic**: `Tool enabled = (Has Permission) AND (Has Category OR No categories specified)`
217
217
 
218
- ### Documentation Categories (Recommended)
219
-
220
- Use documentation categories to fine-tune which tools are exposed (Layer 2):
221
-
222
- <table>
223
- <thead>
224
- <tr>
225
- <th align="left">Category A</th>
226
- <th align="left">Category B</th>
227
- <th align="left">Category C</th>
228
- <th align="left">Category D</th>
229
- </tr>
230
- </thead>
231
- <tbody>
232
- <tr>
233
- <td><code>database_discovery</code></td>
234
- <td><code>crud_operations</code></td>
235
- <td><code>bulk_operations</code></td>
236
- <td><code>custom_queries</code></td>
237
- </tr>
238
- <tr>
239
- <td><code>schema_management</code></td>
240
- <td><code>utilities</code></td>
241
- <td><code>transaction_management</code></td>
242
- <td><code>stored_procedures</code></td>
243
- </tr>
244
- <tr>
245
- <td><code>views_management</code></td>
246
- <td><code>triggers_management</code></td>
247
- <td><code>functions_management</code></td>
248
- <td><code>index_management</code></td>
249
- </tr>
250
- <tr>
251
- <td><code>constraint_management</code></td>
252
- <td><code>table_maintenance</code></td>
253
- <td><code>server_management</code></td>
254
- <td><code>performance_monitoring</code></td>
255
- </tr>
256
- <tr>
257
- <td><code>cache_management</code></td>
258
- <td><code>query_optimization</code></td>
259
- <td><code>backup_restore</code></td>
260
- <td><code>import_export</code></td>
261
- </tr>
262
- <tr>
263
- <td><code>data_migration</code></td>
264
- <td><code>schema_migrations</code></td>
265
- <td><code>analysis</code></td>
266
- <td><code>ai_enhancement</code></td>
267
- </tr>
268
- </tbody>
269
- </table>
270
-
271
- <details>
272
- <summary>Copy/paste list (comma-separated, no spaces)</summary>
273
-
274
- ```text
275
- 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,server_management,performance_monitoring,cache_management,query_optimization,backup_restore,import_export,data_migration,schema_migrations,analysis,ai_enhancement
276
- ```
277
-
278
- </details>
279
-
280
- Full category → tool mapping (and examples) lives in **[DOCUMENTATIONS.md → Category Filtering System](DOCUMENTATIONS.md#🆕-category-filtering-system)**.
281
-
282
- ### Legacy Categories (Backward Compatible)
218
+ ### Permissions
283
219
 
284
220
  | Permission | Operations | Use Case |
285
221
  |------------|------------|----------|
@@ -298,6 +234,50 @@ Common configuration examples are documented in **[DOCUMENTATIONS.md → Categor
298
234
 
299
235
  ---
300
236
 
237
+ ### Documentation Categories (Recommended)
238
+
239
+ Use documentation categories to fine-tune which tools are exposed (Layer 2):
240
+
241
+ | Category List | Use Case | List Tools |
242
+ |---------------|----------|-----------|
243
+ | `database_discovery` | Explore databases, tables, and schema structure | `get_all_tables_relationships, get_table_relationships, list_databases, list_tables, read_table_schema` |
244
+ | `crud_operations` | Create, read, update, delete operations on data | `create_record, delete_record, read_records, update_record` |
245
+ | `bulk_operations` | High-performance batch processing operations | `bulk_delete, bulk_insert, bulk_update` |
246
+ | `custom_queries` | Execute custom SQL queries and advanced operations | `execute_write_query, run_select_query` |
247
+ | `schema_management` | Manage database schema, tables, and structure | `alter_table, create_table, drop_table, execute_ddl` |
248
+ | `utilities` | Database utilities, diagnostics, and helper functions | `describe_connection, export_query_to_csv, export_table_to_csv, list_all_tools, read_changelog, test_connection` |
249
+ | `transaction_management` | Handle ACID transactions and rollback operations | `begin_transaction, commit_transaction, execute_in_transaction, get_transaction_status, rollback_transaction` |
250
+ | `stored_procedures` | Create, execute, and manage stored procedures | `create_stored_procedure, drop_stored_procedure, execute_stored_procedure, get_stored_procedure_info, list_stored_procedures, show_create_procedure` |
251
+ | `views_management` | Create and manage database views | `alter_view, create_view, drop_view, get_view_info, list_views, show_create_view` |
252
+ | `triggers_management` | Create and manage database triggers | `create_trigger, drop_trigger, get_trigger_info, list_triggers, show_create_trigger` |
253
+ | `functions_management` | Create and manage database functions | `create_function, drop_function, execute_function, get_function_info, list_functions, show_create_function` |
254
+ | `index_management` | Optimize performance with index management | `analyze_index, create_index, drop_index, get_index_info, list_indexes` |
255
+ | `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` |
256
+ | `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` |
257
+ | `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` |
258
+ | `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` |
259
+ | `cache_management` | Manage query cache and optimization | `clear_cache, configure_cache_settings, get_cache_config, get_cache_stats, invalidate_cache_for_table` |
260
+ | `query_optimization` | Analyze and optimize SQL queries | `analyze_query, get_optimization_hints` |
261
+ | `backup_restore` | Create backups and restore databases | `backup_database, backup_table, get_create_table_statement, get_database_schema, restore_from_sql` |
262
+ | `import_export` | Import and export data in various formats | `export_query_to_json, export_table_to_json, export_table_to_sql, import_from_csv, import_from_json, safe_export_table` |
263
+ | `data_migration` | Migrate data between databases or systems | `clone_table, compare_table_structure, copy_table_data, move_table_data, sync_table_data` |
264
+ | `schema_migrations` | Version control for database schema changes | `apply_migrations, create_migration, generate_migration_from_diff, get_migration_status, get_schema_version, init_migrations_table, reset_failed_migration, rollback_migration, validate_migrations` |
265
+ | `analysis` | Data analysis and reporting tools | `get_column_statistics, get_database_summary, get_schema_erd, get_schema_rag_context` |
266
+ | `ai_enhancement` | AI-powered features and smart automation | `analyze_schema_patterns, audit_database_security, build_query_from_intent, design_schema_from_requirements, discover_data_patterns, find_similar_columns, forecast_database_growth, generate_business_glossary, generate_data_dictionary, generate_documentation, generate_test_data, predict_query_performance, recommend_indexes, smart_search, suggest_query_improvements, visualize_query` |
267
+
268
+ <details>
269
+ <summary>Copy/paste list (comma-separated, no spaces)</summary>
270
+
271
+ ```text
272
+ 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,server_management,performance_monitoring,cache_management,query_optimization,backup_restore,import_export,data_migration,schema_migrations,analysis,ai_enhancement
273
+ ```
274
+
275
+ </details>
276
+
277
+ Full category → tool mapping (and examples) lives in **[DOCUMENTATIONS.md → Category Filtering System](DOCUMENTATIONS.md#🆕-category-filtering-system)**.
278
+
279
+ ---
280
+
301
281
  ## Available Tools
302
282
 
303
283
  The server exposes **145 tools** organized into categories (CRUD, schema, backups, migrations, perf/monitoring, and AI enhancement).
@@ -79,8 +79,8 @@ exports.toolCategoryMap = {
79
79
  bulkUpdate: ToolCategory.UPDATE,
80
80
  bulkDelete: ToolCategory.DELETE,
81
81
  // Query tools
82
- runQuery: ToolCategory.READ,
83
- executeSql: ToolCategory.EXECUTE,
82
+ runSelectQuery: ToolCategory.READ,
83
+ executeWriteQuery: ToolCategory.EXECUTE,
84
84
  // DDL tools
85
85
  createTable: ToolCategory.DDL,
86
86
  alterTable: ToolCategory.DDL,
@@ -238,8 +238,8 @@ exports.toolDocCategoryMap = {
238
238
  bulkUpdate: DocCategory.BULK_OPERATIONS,
239
239
  bulkDelete: DocCategory.BULK_OPERATIONS,
240
240
  // Custom Queries
241
- runQuery: DocCategory.CUSTOM_QUERIES,
242
- executeSql: DocCategory.CUSTOM_QUERIES,
241
+ runSelectQuery: DocCategory.CUSTOM_QUERIES,
242
+ executeWriteQuery: DocCategory.CUSTOM_QUERIES,
243
243
  // Schema Management (DDL)
244
244
  createTable: DocCategory.SCHEMA_MANAGEMENT,
245
245
  alterTable: DocCategory.SCHEMA_MANAGEMENT,
package/dist/index.d.ts CHANGED
@@ -119,7 +119,7 @@ export declare class MySQLMCP {
119
119
  };
120
120
  error?: string;
121
121
  }>;
122
- runQuery(params: {
122
+ runSelectQuery(params: {
123
123
  query: string;
124
124
  params?: any[];
125
125
  hints?: any;
@@ -135,7 +135,7 @@ export declare class MySQLMCP {
135
135
  estimated_cost?: string;
136
136
  message?: string;
137
137
  }>;
138
- executeSql(params: {
138
+ executeWriteQuery(params: {
139
139
  query: string;
140
140
  params?: any[];
141
141
  }): Promise<{
package/dist/index.js CHANGED
@@ -159,8 +159,8 @@ class MySQLMCP {
159
159
  return await this.crudTools.deleteRecord(params);
160
160
  }
161
161
  // Query Tools
162
- async runQuery(params) {
163
- const check = this.checkToolEnabled("runQuery");
162
+ async runSelectQuery(params) {
163
+ const check = this.checkToolEnabled("runSelectQuery");
164
164
  if (!check.enabled) {
165
165
  return { status: "error", error: check.error };
166
166
  }
@@ -168,13 +168,13 @@ class MySQLMCP {
168
168
  if (!this.security.isReadOnlyQuery(params.query)) {
169
169
  return {
170
170
  status: "error",
171
- error: "Only SELECT queries are allowed with runQuery. Use executeSql for other operations.",
171
+ error: "Only SELECT queries are allowed with run_select_query. Use execute_write_query for other operations.",
172
172
  };
173
173
  }
174
- return await this.queryTools.runQuery(params);
174
+ return await this.queryTools.runSelectQuery(params);
175
175
  }
176
- async executeSql(params) {
177
- const check = this.checkToolEnabled("executeSql");
176
+ async executeWriteQuery(params) {
177
+ const check = this.checkToolEnabled("executeWriteQuery");
178
178
  if (!check.enabled) {
179
179
  return { status: "error", error: check.error };
180
180
  }
@@ -184,11 +184,11 @@ class MySQLMCP {
184
184
  if (!this.featureConfig.isCategoryEnabled("ddl")) {
185
185
  return {
186
186
  status: "error",
187
- error: 'DDL operations (DROP, TRUNCATE, ALTER, CREATE) require the "ddl" permission. Use executeDdl tool or add "ddl" to permissions.',
187
+ error: 'DDL operations (DROP, TRUNCATE, ALTER, CREATE) require the "ddl" permission. Use execute_ddl tool or add "ddl" to permissions.',
188
188
  };
189
189
  }
190
190
  }
191
- return await this.queryTools.executeSql(params);
191
+ return await this.queryTools.executeWriteQuery(params);
192
192
  }
193
193
  // Analysis Tools
194
194
  async getColumnStatistics(params) {
@@ -307,7 +307,7 @@ class MySQLMCP {
307
307
  return await this.transactionTools.getTransactionStatus();
308
308
  }
309
309
  async executeInTransaction(params) {
310
- const check = this.checkToolEnabled("executeSql"); // Use executeSql permission for transaction queries
310
+ const check = this.checkToolEnabled("executeWriteQuery"); // Use executeWriteQuery permission for transaction queries
311
311
  if (!check.enabled) {
312
312
  return { status: "error", error: check.error };
313
313
  }