@berthojoris/mcp-mysql-server 1.4.3 → 1.4.5
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 +83 -60
- package/README.md +209 -79
- package/dist/mcp-server.js +429 -379
- package/dist/security/securityLayer.d.ts +8 -2
- package/dist/security/securityLayer.js +120 -48
- package/dist/tools/queryTools.d.ts +1 -1
- package/dist/tools/queryTools.js +33 -29
- package/package.json +86 -86
package/CHANGELOG.md
CHANGED
|
@@ -5,84 +5,107 @@ 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.4.
|
|
8
|
+
## [1.4.5] - 2025-01-08
|
|
9
9
|
|
|
10
10
|
### Changed
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- No functional code changes from version 1.4.2
|
|
11
|
+
- Reorganized README.md structure - moved "Permission System" section to appear before "Available Tools" section for better user understanding
|
|
12
|
+
- Updated documentation organization to improve readability and user experience
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
### Fixed
|
|
15
|
+
- Minor documentation formatting improvements
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
- Re-published package to ensure README.md displays correctly on npmjs.com
|
|
19
|
-
- No functional changes from version 1.4.1
|
|
20
|
-
|
|
21
|
-
## [1.4.1] - 2025-01-04
|
|
17
|
+
## [1.4.4] - 2025-01-07
|
|
22
18
|
|
|
23
19
|
### Fixed
|
|
24
|
-
- **Critical Parameter Validation Fix**: Fixed "Invalid parameters: must be object" error that occurred when AI agents called MCP tools without parameters
|
|
25
|
-
- Applied defensive parameter handling to all 27 tools that accept parameters
|
|
26
|
-
- Tools now properly handle cases where MCP SDK passes `undefined` or `null` instead of empty object `{}`
|
|
27
|
-
- Pattern applied: `(args || {})` ensures parameters are always objects before validation
|
|
28
|
-
- No breaking changes - existing valid calls continue to work exactly as before
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- Per-project permission configuration
|
|
21
|
+
#### First Tool Call Failure Issue
|
|
22
|
+
- **Problem**: The first tool call would fail with "Connection closed" error (-32000), but subsequent calls would succeed
|
|
23
|
+
- **Root Cause**: MySQL MCP instance was initialized at module load time, before the MCP transport was fully connected, causing a race condition
|
|
24
|
+
- **Solution**: Moved the initialization to occur after the MCP transport is connected in `src/mcp-server.ts`
|
|
25
|
+
- **Impact**: First tool calls now work reliably without needing retry
|
|
26
|
+
- **Files Changed**: `src/mcp-server.ts`
|
|
27
|
+
|
|
28
|
+
#### Execute Permission Not Respected
|
|
29
|
+
- **Problem**: Users with `execute` permission would still get "Dangerous keyword detected" errors when using legitimate SQL functions like `LOAD_FILE()`, `UNION`, or accessing `INFORMATION_SCHEMA`
|
|
30
|
+
- **Root Cause**: Security layer blocked certain SQL keywords unconditionally, regardless of granted permissions
|
|
31
|
+
- **Solution**:
|
|
32
|
+
- Modified `validateQuery()` in `src/security/securityLayer.ts` to accept `bypassDangerousCheck` parameter
|
|
33
|
+
- Added `hasExecutePermission()` method to check if execute permission is enabled
|
|
34
|
+
- Updated `executeSql()` and `runQuery()` in `src/tools/queryTools.ts` to respect execute permission
|
|
35
|
+
- Reduced "always blocked" keywords to only critical security threats (GRANT, REVOKE, INTO OUTFILE, etc.)
|
|
36
|
+
- Allowed advanced SQL features when execute permission is granted:
|
|
37
|
+
- SQL functions: `LOAD_FILE()`, `BENCHMARK()`, `SLEEP()`
|
|
38
|
+
- Advanced SELECT: `UNION`, subqueries in FROM clause
|
|
39
|
+
- Database metadata: `INFORMATION_SCHEMA` access
|
|
40
|
+
- **Impact**: Users with full permissions can now use advanced SQL features as intended
|
|
41
|
+
- **Files Changed**:
|
|
42
|
+
- `src/security/securityLayer.ts`
|
|
43
|
+
- `src/tools/queryTools.ts`
|
|
54
44
|
|
|
55
45
|
### Changed
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
46
|
+
- Updated version from 1.4.3 to 1.4.4
|
|
47
|
+
- Enhanced README.md with detailed documentation on execute permission and advanced SQL features
|
|
48
|
+
- Added "Recent Updates" section to README.md documenting bug fixes
|
|
59
49
|
|
|
60
|
-
|
|
50
|
+
### Security
|
|
51
|
+
- Critical security operations remain blocked even with execute permission:
|
|
52
|
+
- `GRANT` / `REVOKE` - User privilege management
|
|
53
|
+
- `INTO OUTFILE` / `INTO DUMPFILE` - Writing files to server
|
|
54
|
+
- `LOAD DATA` - Loading data from files
|
|
55
|
+
- Direct access to `mysql`, `performance_schema`, `sys` databases
|
|
56
|
+
- `USER` / `PASSWORD` manipulation
|
|
57
|
+
|
|
58
|
+
## [1.4.3] - 2025-01-06
|
|
61
59
|
|
|
62
60
|
### Added
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
- Permission-based access control
|
|
66
|
-
- MCP protocol support
|
|
61
|
+
- Improved permission error handling with detailed messages
|
|
62
|
+
- Enhanced documentation for permission system
|
|
67
63
|
|
|
68
|
-
|
|
64
|
+
### Fixed
|
|
65
|
+
- Fixed undefined/null parameter handling in all tool calls
|
|
66
|
+
- Improved MySQL operations error handling
|
|
67
|
+
|
|
68
|
+
## [1.4.2] - 2025-01-05
|
|
69
69
|
|
|
70
70
|
### Added
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
71
|
+
- Dynamic per-project permissions system
|
|
72
|
+
- Enhanced security layer with permission-based access control
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
- Improved documentation and examples
|
|
74
76
|
|
|
75
|
-
## [1.1
|
|
77
|
+
## [1.4.1] - 2025-01-04
|
|
76
78
|
|
|
77
79
|
### Added
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
80
|
+
- Stored procedure support
|
|
81
|
+
- Transaction management tools
|
|
82
|
+
- Bulk operations (insert, update, delete)
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
### Changed
|
|
85
|
+
- Enhanced error messages
|
|
86
|
+
- Improved query validation
|
|
87
|
+
|
|
88
|
+
## [1.4.0] - 2025-01-03
|
|
83
89
|
|
|
84
90
|
### Added
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
|
|
91
|
+
- Data export tools (CSV export)
|
|
92
|
+
- DDL operations (CREATE, ALTER, DROP tables)
|
|
93
|
+
- Utility tools (connection testing, table relationships)
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
- Major refactoring of tool organization
|
|
97
|
+
- Improved TypeScript type definitions
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Version History Summary
|
|
102
|
+
|
|
103
|
+
- **1.4.4** - Bug fixes: First call failure & execute permission
|
|
104
|
+
- **1.4.3** - Permission error handling improvements
|
|
105
|
+
- **1.4.2** - Dynamic per-project permissions
|
|
106
|
+
- **1.4.1** - Stored procedures, transactions, bulk operations
|
|
107
|
+
- **1.4.0** - Data export, DDL operations, utilities
|
|
108
|
+
- **1.3.x** - Core CRUD operations and query tools
|
|
109
|
+
- **1.2.x** - Security layer implementation
|
|
110
|
+
- **1.1.x** - MCP protocol integration
|
|
111
|
+
- **1.0.x** - Initial release
|
package/README.md
CHANGED
|
@@ -21,6 +21,39 @@ A fully-featured **Model Context Protocol (MCP)** server for MySQL database inte
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
+
## 🆕 Recent Updates (v1.4.4)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
#### ✅ Fixed: First Tool Call Failure Issue
|
|
29
|
+
**Problem**: The first tool call would fail with "Connection closed" error (-32000), but subsequent calls would succeed.
|
|
30
|
+
|
|
31
|
+
**Root Cause**: The MySQL MCP instance was initialized at module load time, before the MCP transport was fully connected, causing a race condition.
|
|
32
|
+
|
|
33
|
+
**Solution**: Moved the initialization to occur after the MCP transport is connected, ensuring proper startup sequence.
|
|
34
|
+
|
|
35
|
+
**Impact**: First tool calls now work reliably without needing retry.
|
|
36
|
+
|
|
37
|
+
#### ✅ Fixed: Execute Permission Not Respected
|
|
38
|
+
**Problem**: Users with `execute` permission would still get "Dangerous keyword detected" errors when using legitimate SQL functions like `LOAD_FILE()`, `UNION`, or accessing `INFORMATION_SCHEMA`.
|
|
39
|
+
|
|
40
|
+
**Root Cause**: The security layer blocked certain SQL keywords unconditionally, regardless of granted permissions.
|
|
41
|
+
|
|
42
|
+
**Solution**:
|
|
43
|
+
- Modified security validation to respect the `execute` permission
|
|
44
|
+
- Users with `execute` permission can now use:
|
|
45
|
+
- SQL functions like `LOAD_FILE()`, `BENCHMARK()`, `SLEEP()`
|
|
46
|
+
- Advanced SELECT features like `UNION` and subqueries
|
|
47
|
+
- Access to `INFORMATION_SCHEMA` for metadata queries
|
|
48
|
+
- Critical security operations remain blocked (GRANT, REVOKE, INTO OUTFILE, etc.)
|
|
49
|
+
|
|
50
|
+
**Impact**: Users with full permissions can now use advanced SQL features as intended.
|
|
51
|
+
|
|
52
|
+
### Breaking Changes
|
|
53
|
+
None - all changes are backward compatible.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
24
57
|
## 📦 Installation
|
|
25
58
|
|
|
26
59
|
### Option 1: Quick Start (npx)
|
|
@@ -111,84 +144,7 @@ Try asking your AI:
|
|
|
111
144
|
|
|
112
145
|
---
|
|
113
146
|
|
|
114
|
-
##
|
|
115
|
-
|
|
116
|
-
The MCP server provides **30 powerful tools**:
|
|
117
|
-
|
|
118
|
-
### Database Discovery (4 tools)
|
|
119
|
-
|
|
120
|
-
| Tool | Description |
|
|
121
|
-
|------|-------------|
|
|
122
|
-
| `list_databases` | Lists all databases on the MySQL server |
|
|
123
|
-
| `list_tables` | Lists all tables in the current/specified database |
|
|
124
|
-
| `read_table_schema` | Gets detailed schema (columns, types, keys, indexes) |
|
|
125
|
-
| `get_table_relationships` | Discovers foreign key relationships |
|
|
126
|
-
|
|
127
|
-
### Data Operations - CRUD (4 tools)
|
|
128
|
-
|
|
129
|
-
| Tool | Description |
|
|
130
|
-
|------|-------------|
|
|
131
|
-
| `create_record` | Insert new records with automatic SQL generation |
|
|
132
|
-
| `read_records` | Query records with filtering, pagination, and sorting |
|
|
133
|
-
| `update_record` | Update records based on conditions |
|
|
134
|
-
| `delete_record` | Delete records with safety checks |
|
|
135
|
-
|
|
136
|
-
### Bulk Operations (3 tools)
|
|
137
|
-
|
|
138
|
-
| Tool | Description | Performance |
|
|
139
|
-
|------|-------------|-------------|
|
|
140
|
-
| `bulk_insert` | Insert multiple records in batches for optimal performance | Up to 10,000 records per batch |
|
|
141
|
-
| `bulk_update` | Update multiple records with different conditions in batches | Up to 1,000 operations per batch |
|
|
142
|
-
| `bulk_delete` | Delete multiple record sets based on different conditions | Up to 1,000 operations per batch |
|
|
143
|
-
|
|
144
|
-
### Custom Queries (2 tools)
|
|
145
|
-
|
|
146
|
-
| Tool | Description |
|
|
147
|
-
|------|-------------|
|
|
148
|
-
| `run_query` | Execute read-only SELECT queries |
|
|
149
|
-
| `execute_sql` | Execute write operations (INSERT, UPDATE, DELETE, or DDL with permission) |
|
|
150
|
-
|
|
151
|
-
### Schema Management - DDL (4 tools)
|
|
152
|
-
|
|
153
|
-
| Tool | Description | Requires |
|
|
154
|
-
|------|-------------|----------|
|
|
155
|
-
| `create_table` | Create new tables with columns and indexes | `ddl` permission |
|
|
156
|
-
| `alter_table` | Modify table structure (add/drop/modify columns, indexes) | `ddl` permission |
|
|
157
|
-
| `drop_table` | Delete tables | `ddl` permission |
|
|
158
|
-
| `execute_ddl` | Execute raw DDL SQL (CREATE, ALTER, DROP, TRUNCATE, RENAME) | `ddl` permission |
|
|
159
|
-
|
|
160
|
-
### Utilities (4 tools)
|
|
161
|
-
|
|
162
|
-
| Tool | Description |
|
|
163
|
-
|------|-------------|
|
|
164
|
-
| `test_connection` | Test database connectivity and measure latency |
|
|
165
|
-
| `describe_connection` | Get current connection information |
|
|
166
|
-
| `export_table_to_csv` | Export table data to CSV format with optional filtering, pagination, and sorting |
|
|
167
|
-
| `export_query_to_csv` | Export the results of a SELECT query to CSV format |
|
|
168
|
-
|
|
169
|
-
### Transaction Management (5 tools)
|
|
170
|
-
|
|
171
|
-
| Tool | Description |
|
|
172
|
-
|------|-------------|
|
|
173
|
-
| `begin_transaction` | Start a new database transaction |
|
|
174
|
-
| `commit_transaction` | Commit the current transaction |
|
|
175
|
-
| `rollback_transaction` | Rollback the current transaction |
|
|
176
|
-
| `get_transaction_status` | Check if a transaction is active |
|
|
177
|
-
| `execute_in_transaction` | Execute SQL within a transaction context |
|
|
178
|
-
|
|
179
|
-
### Stored Procedures (5 tools)
|
|
180
|
-
|
|
181
|
-
| Tool | Description | Requires |
|
|
182
|
-
|------|-------------|----------|
|
|
183
|
-
| `list_stored_procedures` | List all stored procedures in a database | `procedure` permission |
|
|
184
|
-
| `create_stored_procedure` | Create new stored procedures with parameters | `procedure` permission |
|
|
185
|
-
| `get_stored_procedure_info` | Get detailed information about a stored procedure | `procedure` permission |
|
|
186
|
-
| `execute_stored_procedure` | Execute stored procedures with IN/OUT/INOUT parameters | `procedure` permission |
|
|
187
|
-
| `drop_stored_procedure` | Delete stored procedures | `procedure` permission |
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## 🔐 Permission System
|
|
147
|
+
## Permission System
|
|
192
148
|
|
|
193
149
|
### Permission Categories
|
|
194
150
|
|
|
@@ -201,7 +157,7 @@ Control access with these permission categories:
|
|
|
201
157
|
| **`create`** | INSERT new records | Data entry |
|
|
202
158
|
| **`update`** | UPDATE existing records | Data maintenance |
|
|
203
159
|
| **`delete`** | DELETE records | Data cleanup |
|
|
204
|
-
| **`execute`** | Execute custom SQL (DML) | Complex operations |
|
|
160
|
+
| **`execute`** | Execute custom SQL (DML) + Advanced SQL features | Complex operations, advanced queries |
|
|
205
161
|
| **`ddl`** | CREATE/ALTER/DROP tables | Schema management |
|
|
206
162
|
| **`procedure`** | CREATE/DROP/EXECUTE stored procedures | Stored procedure management |
|
|
207
163
|
| **`transaction`** | BEGIN, COMMIT, ROLLBACK transactions | ACID operations |
|
|
@@ -283,6 +239,103 @@ You can have different databases with different permissions in the same AI agent
|
|
|
283
239
|
|
|
284
240
|
---
|
|
285
241
|
|
|
242
|
+
## 🔓 Execute Permission & Advanced SQL Features
|
|
243
|
+
|
|
244
|
+
The `execute` permission unlocks advanced SQL capabilities that are restricted by default for security reasons.
|
|
245
|
+
|
|
246
|
+
### What Execute Permission Enables
|
|
247
|
+
|
|
248
|
+
When you grant the `execute` permission, users can:
|
|
249
|
+
|
|
250
|
+
#### 1. **Advanced SQL Functions**
|
|
251
|
+
- `LOAD_FILE()` - Read files from the server
|
|
252
|
+
- `BENCHMARK()` - Performance testing
|
|
253
|
+
- `SLEEP()` - Delay execution
|
|
254
|
+
- And other MySQL built-in functions
|
|
255
|
+
|
|
256
|
+
#### 2. **Advanced SELECT Features**
|
|
257
|
+
- `UNION` queries - Combine multiple SELECT results
|
|
258
|
+
- Subqueries in FROM clause - Complex nested queries
|
|
259
|
+
- Access to `INFORMATION_SCHEMA` - Database metadata queries
|
|
260
|
+
|
|
261
|
+
#### 3. **Execute Custom SQL**
|
|
262
|
+
- Use `execute_sql` tool for INSERT, UPDATE, DELETE with advanced features
|
|
263
|
+
- Use `run_query` tool for complex SELECT queries with UNION and subqueries
|
|
264
|
+
|
|
265
|
+
### Security Considerations
|
|
266
|
+
|
|
267
|
+
**Without `execute` permission:**
|
|
268
|
+
```sql
|
|
269
|
+
-- ❌ BLOCKED: UNION queries
|
|
270
|
+
SELECT * FROM users WHERE id = 1 UNION SELECT * FROM admin;
|
|
271
|
+
|
|
272
|
+
-- ❌ BLOCKED: Subqueries in FROM
|
|
273
|
+
SELECT * FROM (SELECT * FROM users WHERE active = 1) AS active_users;
|
|
274
|
+
|
|
275
|
+
-- ❌ BLOCKED: LOAD_FILE function
|
|
276
|
+
SELECT LOAD_FILE('/etc/passwd');
|
|
277
|
+
|
|
278
|
+
-- ❌ BLOCKED: INFORMATION_SCHEMA access
|
|
279
|
+
SELECT * FROM INFORMATION_SCHEMA.TABLES;
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**With `execute` permission:**
|
|
283
|
+
```sql
|
|
284
|
+
-- ✅ ALLOWED: All advanced SQL features
|
|
285
|
+
SELECT * FROM users WHERE id = 1 UNION SELECT * FROM admin;
|
|
286
|
+
SELECT * FROM (SELECT * FROM users WHERE active = 1) AS active_users;
|
|
287
|
+
SELECT LOAD_FILE('/path/to/file.txt');
|
|
288
|
+
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mydb';
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### When to Grant Execute Permission
|
|
292
|
+
|
|
293
|
+
**Grant `execute` when:**
|
|
294
|
+
- Users need complex analytical queries with UNION or subqueries
|
|
295
|
+
- Developers need access to INFORMATION_SCHEMA for metadata analysis
|
|
296
|
+
- Advanced SQL functions are required for specific operations
|
|
297
|
+
- You trust the user with broader database access
|
|
298
|
+
|
|
299
|
+
**Don't grant `execute` when:**
|
|
300
|
+
- Users only need basic CRUD operations
|
|
301
|
+
- Working with untrusted AI agents
|
|
302
|
+
- Production environments with strict security policies
|
|
303
|
+
- Read-only access is sufficient
|
|
304
|
+
|
|
305
|
+
### Example: Analytics with Execute Permission
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
{
|
|
309
|
+
"args": [
|
|
310
|
+
"mysql://analyst:pass@localhost:3306/analytics_db",
|
|
311
|
+
"list,read,execute,utility"
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
This allows the AI agent to run complex analytical queries:
|
|
317
|
+
|
|
318
|
+
```sql
|
|
319
|
+
-- Complex query with UNION and subqueries
|
|
320
|
+
SELECT 'Q1' as quarter, SUM(revenue) as total
|
|
321
|
+
FROM (SELECT * FROM sales WHERE date BETWEEN '2024-01-01' AND '2024-03-31') AS q1_sales
|
|
322
|
+
UNION
|
|
323
|
+
SELECT 'Q2' as quarter, SUM(revenue) as total
|
|
324
|
+
FROM (SELECT * FROM sales WHERE date BETWEEN '2024-04-01' AND '2024-06-30') AS q2_sales;
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Critical Security Keywords (Always Blocked)
|
|
328
|
+
|
|
329
|
+
Even with `execute` permission, these operations are **always blocked** for security:
|
|
330
|
+
|
|
331
|
+
- `GRANT` / `REVOKE` - User privilege management
|
|
332
|
+
- `INTO OUTFILE` / `INTO DUMPFILE` - Writing files to server
|
|
333
|
+
- `LOAD DATA` - Loading data from files
|
|
334
|
+
- Direct access to `mysql`, `performance_schema`, `sys` databases
|
|
335
|
+
- `USER` / `PASSWORD` manipulation
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
286
339
|
## 🚫 Permission Error Handling
|
|
287
340
|
|
|
288
341
|
The MySQL MCP Server provides clear, user-friendly error messages when operations are attempted without proper permissions. This helps users understand exactly what permissions are needed and how to enable them.
|
|
@@ -397,6 +450,83 @@ After (DDL enabled):
|
|
|
397
450
|
|
|
398
451
|
---
|
|
399
452
|
|
|
453
|
+
## 🛠️ Available Tools
|
|
454
|
+
|
|
455
|
+
The MCP server provides **30 powerful tools**:
|
|
456
|
+
|
|
457
|
+
### Database Discovery (4 tools)
|
|
458
|
+
|
|
459
|
+
| Tool | Description |
|
|
460
|
+
|------|-------------|
|
|
461
|
+
| `list_databases` | Lists all databases on the MySQL server |
|
|
462
|
+
| `list_tables` | Lists all tables in the current/specified database |
|
|
463
|
+
| `read_table_schema` | Gets detailed schema (columns, types, keys, indexes) |
|
|
464
|
+
| `get_table_relationships` | Discovers foreign key relationships |
|
|
465
|
+
|
|
466
|
+
### Data Operations - CRUD (4 tools)
|
|
467
|
+
|
|
468
|
+
| Tool | Description |
|
|
469
|
+
|------|-------------|
|
|
470
|
+
| `create_record` | Insert new records with automatic SQL generation |
|
|
471
|
+
| `read_records` | Query records with filtering, pagination, and sorting |
|
|
472
|
+
| `update_record` | Update records based on conditions |
|
|
473
|
+
| `delete_record` | Delete records with safety checks |
|
|
474
|
+
|
|
475
|
+
### Bulk Operations (3 tools)
|
|
476
|
+
|
|
477
|
+
| Tool | Description | Performance |
|
|
478
|
+
|------|-------------|-------------|
|
|
479
|
+
| `bulk_insert` | Insert multiple records in batches for optimal performance | Up to 10,000 records per batch |
|
|
480
|
+
| `bulk_update` | Update multiple records with different conditions in batches | Up to 1,000 operations per batch |
|
|
481
|
+
| `bulk_delete` | Delete multiple record sets based on different conditions | Up to 1,000 operations per batch |
|
|
482
|
+
|
|
483
|
+
### Custom Queries (2 tools)
|
|
484
|
+
|
|
485
|
+
| Tool | Description |
|
|
486
|
+
|------|-------------|
|
|
487
|
+
| `run_query` | Execute read-only SELECT queries |
|
|
488
|
+
| `execute_sql` | Execute write operations (INSERT, UPDATE, DELETE, or DDL with permission) |
|
|
489
|
+
|
|
490
|
+
### Schema Management - DDL (4 tools)
|
|
491
|
+
|
|
492
|
+
| Tool | Description | Requires |
|
|
493
|
+
|------|-------------|----------|
|
|
494
|
+
| `create_table` | Create new tables with columns and indexes | `ddl` permission |
|
|
495
|
+
| `alter_table` | Modify table structure (add/drop/modify columns, indexes) | `ddl` permission |
|
|
496
|
+
| `drop_table` | Delete tables | `ddl` permission |
|
|
497
|
+
| `execute_ddl` | Execute raw DDL SQL (CREATE, ALTER, DROP, TRUNCATE, RENAME) | `ddl` permission |
|
|
498
|
+
|
|
499
|
+
### Utilities (4 tools)
|
|
500
|
+
|
|
501
|
+
| Tool | Description |
|
|
502
|
+
|------|-------------|
|
|
503
|
+
| `test_connection` | Test database connectivity and measure latency |
|
|
504
|
+
| `describe_connection` | Get current connection information |
|
|
505
|
+
| `export_table_to_csv` | Export table data to CSV format with optional filtering, pagination, and sorting |
|
|
506
|
+
| `export_query_to_csv` | Export the results of a SELECT query to CSV format |
|
|
507
|
+
|
|
508
|
+
### Transaction Management (5 tools)
|
|
509
|
+
|
|
510
|
+
| Tool | Description |
|
|
511
|
+
|------|-------------|
|
|
512
|
+
| `begin_transaction` | Start a new database transaction |
|
|
513
|
+
| `commit_transaction` | Commit the current transaction |
|
|
514
|
+
| `rollback_transaction` | Rollback the current transaction |
|
|
515
|
+
| `get_transaction_status` | Check if a transaction is active |
|
|
516
|
+
| `execute_in_transaction` | Execute SQL within a transaction context |
|
|
517
|
+
|
|
518
|
+
### Stored Procedures (5 tools)
|
|
519
|
+
|
|
520
|
+
| Tool | Description | Requires |
|
|
521
|
+
|------|-------------|----------|
|
|
522
|
+
| `list_stored_procedures` | List all stored procedures in a database | `procedure` permission |
|
|
523
|
+
| `create_stored_procedure` | Create new stored procedures with parameters | `procedure` permission |
|
|
524
|
+
| `get_stored_procedure_info` | Get detailed information about a stored procedure | `procedure` permission |
|
|
525
|
+
| `execute_stored_procedure` | Execute stored procedures with IN/OUT/INOUT parameters | `procedure` permission |
|
|
526
|
+
| `drop_stored_procedure` | Delete stored procedures | `procedure` permission |
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
400
530
|
## 🏗️ DDL Operations
|
|
401
531
|
|
|
402
532
|
DDL (Data Definition Language) operations allow AI to create, modify, and delete tables.
|