@berthojoris/mcp-mysql-server 1.16.0 → 1.16.2

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,27 @@ 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.2] - 2025-12-11
9
+
10
+ ### Fixed
11
+ - **Documentation Update** - Added missing `ai_enhancement` category to the Documentation Categories table in README.md
12
+ - The table now correctly shows all 24 documentation categories
13
+ - Added entry for `ai_enhancement` category with 8 tools and description
14
+
15
+ ## [1.16.1] - 2025-12-09
16
+
17
+ ### Improved
18
+ - **Enhanced Tool Descriptions** - Improved tool descriptions to help LLMs select the correct tool:
19
+ - `run_query`: Now explicitly states "⚡ USE THIS FOR SELECT QUERIES"
20
+ - `execute_sql`: Now explicitly states "⚡ USE THIS FOR INSERT/UPDATE/DELETE"
21
+ - `execute_ddl`: Now explicitly states "⚡ USE THIS FOR DDL ONLY" with clear guidance
22
+ - Added "NO SELECT queries!" warning to `execute_ddl` parameter description
23
+
24
+ ### Fixed
25
+ - **Better Error Messages** - `execute_ddl` now suggests the correct tool when called with wrong query type:
26
+ - "For SELECT queries, use the 'run_query' tool instead"
27
+ - "For INSERT/UPDATE/DELETE, use the 'execute_sql' tool"
28
+
8
29
  ## [1.16.0] - 2025-12-09
9
30
 
10
31
  ### Added
package/README.md CHANGED
@@ -152,7 +152,7 @@ Most AI agents use a similar JSON configuration format. Use the appropriate conf
152
152
  "-y",
153
153
  "@berthojoris/mysql-mcp",
154
154
  "mysql://user:password@localhost:3306/database",
155
- "list,read,utility"
155
+ "list,read,utility,create,update,ddl",
156
156
  ]
157
157
  }
158
158
  }
@@ -168,9 +168,9 @@ Most AI agents use a similar JSON configuration format. Use the appropriate conf
168
168
  "args": [
169
169
  "-y",
170
170
  "@berthojoris/mysql-mcp",
171
- "mysql://user:password@localhost:3306/database",
172
- "list,read,utility",
173
- "database_discovery,crud_operations,custom_queries"
171
+ "mysql://user:password@localhost:3306/database_name_here",
172
+ "list,read,utility,create,update,ddl",
173
+ "database_discovery,crud_operations,custom_queries,schema_management,index_management,constraint_management,table_maintenance,query_optimization,analysis"
174
174
  ]
175
175
  }
176
176
  }
@@ -496,6 +496,7 @@ Use these categories for fine-grained control that matches the tool organization
496
496
  | `data_migration` | 5 | Copy, move, clone, sync table data |
497
497
  | `schema_migrations` | 9 | Version control for database schema |
498
498
  | `analysis` | 4 | AI context optimization and data analysis |
499
+ | `ai_enhancement` | 8 | AI-powered query building, smart search, and documentation generation |
499
500
 
500
501
  ### Legacy Categories (Backward Compatible)
501
502
 
@@ -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,89 +1,89 @@
1
- {
2
- "name": "@berthojoris/mcp-mysql-server",
3
- "version": "1.16.0",
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
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "mcp-mysql": "bin/mcp-mysql.js"
9
- },
10
- "scripts": {
11
- "build": "tsc",
12
- "start": "node dist/server.js",
13
- "start:mcp": "node dist/mcp-server.js",
14
- "start:api": "node dist/server.js",
15
- "dev": "ts-node src/index.ts",
16
- "dev:mcp": "ts-node src/mcp-server.ts",
17
- "dev:api": "ts-node src/server.ts",
18
- "test": "jest",
19
- "prepare": "npm run build",
20
- "prepublishOnly": "npm run build"
21
- },
22
- "keywords": [
23
- "mcp",
24
- "mysql",
25
- "database",
26
- "llm",
27
- "ai",
28
- "model-context-protocol",
29
- "claude",
30
- "cline",
31
- "windsurf",
32
- "codex",
33
- "openai-codex",
34
- "agent",
35
- "database-tools",
36
- "sql",
37
- "mysql-client",
38
- "ai-tools"
39
- ],
40
- "author": "Bertho Joris <berthojoris@gmail.com>",
41
- "license": "MIT",
42
- "repository": {
43
- "type": "git",
44
- "url": "git+https://github.com/berthojoris/mysql-mcp.git"
45
- },
46
- "bugs": {
47
- "url": "https://github.com/berthojoris/mysql-mcp/issues"
48
- },
49
- "homepage": "https://github.com/berthojoris/mysql-mcp#readme",
50
- "files": [
51
- "dist",
52
- "bin",
53
- "README.md",
54
- "DOCUMENTATIONS.md",
55
- "CHANGELOG.md",
56
- "LICENSE",
57
- "manifest.json"
58
- ],
59
- "engines": {
60
- "node": ">=18.0.0"
61
- },
62
- "dependencies": {
63
- "@modelcontextprotocol/sdk": "^1.20.0",
64
- "ajv": "^8.12.0",
65
- "cors": "^2.8.5",
66
- "dotenv": "^16.3.1",
67
- "express": "^4.18.2",
68
- "express-rate-limit": "^7.1.5",
69
- "helmet": "^7.1.0",
70
- "jsonwebtoken": "^9.0.2",
71
- "morgan": "^1.10.0",
72
- "mysql2": "^3.6.1",
73
- "winston": "^3.11.0"
74
- },
75
- "devDependencies": {
76
- "@types/cors": "^2.8.17",
77
- "@types/express": "^4.17.21",
78
- "@types/helmet": "^0.0.48",
79
- "@types/jest": "^29.5.4",
80
- "@types/jsonwebtoken": "^9.0.5",
81
- "@types/morgan": "^1.9.9",
82
- "@types/node": "^20.6.0",
83
- "@types/winston": "^2.4.4",
84
- "jest": "^29.6.4",
85
- "ts-jest": "^29.1.1",
86
- "ts-node": "^10.9.1",
87
- "typescript": "^5.2.2"
88
- }
89
- }
1
+ {
2
+ "name": "@berthojoris/mcp-mysql-server",
3
+ "version": "1.16.2",
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
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "mcp-mysql": "bin/mcp-mysql.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "start": "node dist/server.js",
13
+ "start:mcp": "node dist/mcp-server.js",
14
+ "start:api": "node dist/server.js",
15
+ "dev": "ts-node src/index.ts",
16
+ "dev:mcp": "ts-node src/mcp-server.ts",
17
+ "dev:api": "ts-node src/server.ts",
18
+ "test": "jest",
19
+ "prepare": "npm run build",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "mysql",
25
+ "database",
26
+ "llm",
27
+ "ai",
28
+ "model-context-protocol",
29
+ "claude",
30
+ "cline",
31
+ "windsurf",
32
+ "codex",
33
+ "openai-codex",
34
+ "agent",
35
+ "database-tools",
36
+ "sql",
37
+ "mysql-client",
38
+ "ai-tools"
39
+ ],
40
+ "author": "Bertho Joris <berthojoris@gmail.com>",
41
+ "license": "MIT",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/berthojoris/mysql-mcp.git"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/berthojoris/mysql-mcp/issues"
48
+ },
49
+ "homepage": "https://github.com/berthojoris/mysql-mcp#readme",
50
+ "files": [
51
+ "dist",
52
+ "bin",
53
+ "README.md",
54
+ "DOCUMENTATIONS.md",
55
+ "CHANGELOG.md",
56
+ "LICENSE",
57
+ "manifest.json"
58
+ ],
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ },
62
+ "dependencies": {
63
+ "@modelcontextprotocol/sdk": "^1.20.0",
64
+ "ajv": "^8.12.0",
65
+ "cors": "^2.8.5",
66
+ "dotenv": "^16.3.1",
67
+ "express": "^4.18.2",
68
+ "express-rate-limit": "^7.1.5",
69
+ "helmet": "^7.1.0",
70
+ "jsonwebtoken": "^9.0.2",
71
+ "morgan": "^1.10.0",
72
+ "mysql2": "^3.6.1",
73
+ "winston": "^3.11.0"
74
+ },
75
+ "devDependencies": {
76
+ "@types/cors": "^2.8.17",
77
+ "@types/express": "^4.17.21",
78
+ "@types/helmet": "^0.0.48",
79
+ "@types/jest": "^29.5.4",
80
+ "@types/jsonwebtoken": "^9.0.5",
81
+ "@types/morgan": "^1.9.9",
82
+ "@types/node": "^20.6.0",
83
+ "@types/winston": "^2.4.4",
84
+ "jest": "^29.6.4",
85
+ "ts-jest": "^29.1.1",
86
+ "ts-node": "^10.9.1",
87
+ "typescript": "^5.2.2"
88
+ }
89
+ }