@berthojoris/mcp-mysql-server 1.16.0 → 1.16.1

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,20 @@ 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.16.1] - 2025-12-09
9
+
10
+ ### Improved
11
+ - **Enhanced Tool Descriptions** - Improved tool descriptions to help LLMs select the correct tool:
12
+ - `run_query`: Now explicitly states "⚡ USE THIS FOR SELECT QUERIES"
13
+ - `execute_sql`: Now explicitly states "⚡ USE THIS FOR INSERT/UPDATE/DELETE"
14
+ - `execute_ddl`: Now explicitly states "⚡ USE THIS FOR DDL ONLY" with clear guidance
15
+ - Added "NO SELECT queries!" warning to `execute_ddl` parameter description
16
+
17
+ ### Fixed
18
+ - **Better Error Messages** - `execute_ddl` now suggests the correct tool when called with wrong query type:
19
+ - "For SELECT queries, use the 'run_query' tool instead"
20
+ - "For INSERT/UPDATE/DELETE, use the 'execute_sql' tool"
21
+
8
22
  ## [1.16.0] - 2025-12-09
9
23
 
10
24
  ### Added
@@ -392,7 +392,7 @@ const TOOLS = [
392
392
  },
393
393
  {
394
394
  name: "run_query",
395
- description: "Runs a read-only SQL SELECT query with optional parameters, optimizer hints, and caching support. Only SELECT statements are allowed.",
395
+ description: "⚡ USE THIS FOR SELECT QUERIES. Runs a read-only SQL SELECT query with optional parameters, optimizer hints, and caching support. ONLY SELECT statements are allowed - use execute_sql for INSERT/UPDATE/DELETE, use execute_ddl for CREATE/ALTER/DROP.",
396
396
  inputSchema: {
397
397
  type: "object",
398
398
  properties: {
@@ -459,7 +459,7 @@ const TOOLS = [
459
459
  },
460
460
  {
461
461
  name: "execute_sql",
462
- description: 'Executes a write SQL operation (INSERT, UPDATE, DELETE) with optional parameters. DDL operations require "ddl" permission.',
462
+ description: '⚡ USE THIS FOR INSERT/UPDATE/DELETE. Executes a write SQL operation (INSERT, UPDATE, DELETE) with optional parameters. NOT for SELECT (use run_query), NOT for DDL (use execute_ddl for CREATE/ALTER/DROP/TRUNCATE/RENAME).',
463
463
  inputSchema: {
464
464
  type: "object",
465
465
  properties: {
@@ -639,13 +639,13 @@ const TOOLS = [
639
639
  },
640
640
  {
641
641
  name: "execute_ddl",
642
- description: 'Executes raw DDL SQL (CREATE, ALTER, DROP, TRUNCATE, RENAME). Requires "ddl" permission.',
642
+ description: ' USE THIS FOR DDL ONLY (CREATE, ALTER, DROP, TRUNCATE, RENAME). NOT for SELECT (use run_query), NOT for INSERT/UPDATE/DELETE (use execute_sql). Requires "ddl" permission.',
643
643
  inputSchema: {
644
644
  type: "object",
645
645
  properties: {
646
646
  query: {
647
647
  type: "string",
648
- description: "DDL SQL query to execute",
648
+ description: "DDL SQL query to execute (must start with CREATE, ALTER, DROP, TRUNCATE, or RENAME - NO SELECT queries!)",
649
649
  },
650
650
  },
651
651
  required: ["query"],
@@ -3119,6 +3119,40 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
3119
3119
  case "read_table_schema":
3120
3120
  result = await mysqlMCP.readTableSchema((args || {}));
3121
3121
  break;
3122
+ // CRUD Tools
3123
+ case "create_record":
3124
+ result = await mysqlMCP.createRecord((args || {}));
3125
+ break;
3126
+ case "read_records":
3127
+ result = await mysqlMCP.readRecords((args || {}));
3128
+ break;
3129
+ case "update_record":
3130
+ result = await mysqlMCP.updateRecord((args || {}));
3131
+ break;
3132
+ case "delete_record":
3133
+ result = await mysqlMCP.deleteRecord((args || {}));
3134
+ break;
3135
+ // Bulk Operations
3136
+ case "bulk_insert":
3137
+ result = await mysqlMCP.bulkInsert((args || {}));
3138
+ break;
3139
+ case "bulk_update":
3140
+ result = await mysqlMCP.bulkUpdate((args || {}));
3141
+ break;
3142
+ case "bulk_delete":
3143
+ result = await mysqlMCP.bulkDelete((args || {}));
3144
+ break;
3145
+ // Query Tools
3146
+ case "run_query":
3147
+ result = await mysqlMCP.runQuery((args || {}));
3148
+ break;
3149
+ case "execute_sql":
3150
+ result = await mysqlMCP.executeSql((args || {}));
3151
+ break;
3152
+ // DDL Tools
3153
+ case "create_table":
3154
+ result = await mysqlMCP.createTable(args || {});
3155
+ break;
3122
3156
  case "alter_table":
3123
3157
  result = await mysqlMCP.alterTable(args || {});
3124
3158
  break;
@@ -201,7 +201,7 @@ class DdlTools {
201
201
  if (!isDdl) {
202
202
  return {
203
203
  status: "error",
204
- error: "Only DDL operations (CREATE, ALTER, DROP, TRUNCATE, RENAME) are allowed with executeDdl",
204
+ error: "Only DDL operations (CREATE, ALTER, DROP, TRUNCATE, RENAME) are allowed with execute_ddl. For SELECT queries, use the 'run_query' tool instead. For INSERT/UPDATE/DELETE, use the 'execute_sql' tool.",
205
205
  };
206
206
  }
207
207
  const result = await this.db.query(query);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@berthojoris/mcp-mysql-server",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "Model Context Protocol server for MySQL database integration with dynamic per-project permissions, backup/restore, data import/export, and data migration capabilities",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",