@berthojoris/mcp-mysql-server 1.43.5 → 1.45.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 +61 -0
- package/DOCUMENTATIONS.md +674 -508
- package/README.md +468 -376
- package/bin/mcp-mysql.js +214 -168
- package/dist/cache/queryCache.js +1 -1
- package/dist/config/config.js +2 -1
- package/dist/config/featureConfig.d.ts +5 -0
- package/dist/config/featureConfig.js +11 -13
- package/dist/config/runtimeConfig.d.ts +50 -0
- package/dist/config/runtimeConfig.js +173 -0
- package/dist/db/connection.d.ts +40 -1
- package/dist/db/connection.js +188 -22
- package/dist/mcp-server.js +248 -375
- package/dist/security/grantInspector.d.ts +5 -0
- package/dist/security/grantInspector.js +32 -0
- package/dist/security/securityLayer.d.ts +21 -2
- package/dist/security/securityLayer.js +151 -21
- package/dist/server/auditLogger.d.ts +24 -0
- package/dist/server/auditLogger.js +60 -0
- package/dist/server/auth.d.ts +56 -0
- package/dist/server/auth.js +274 -0
- package/dist/server/httpServer.d.ts +22 -0
- package/dist/server/httpServer.js +320 -0
- package/dist/server/rateLimiter.d.ts +15 -0
- package/dist/server/rateLimiter.js +41 -0
- package/dist/server/requestContext.d.ts +12 -0
- package/dist/server/requestContext.js +9 -0
- package/dist/tools/toolAnnotations.d.ts +4 -0
- package/dist/tools/toolAnnotations.js +73 -0
- package/dist/tools/toolArgumentValidation.js +22 -22
- package/dist/tools/toolRegistry.d.ts +1 -1
- package/dist/tools/toolRegistry.js +7 -1
- package/manifest.json +1 -1
- package/package.json +86 -78
- package/dist/auth/authService.d.ts +0 -29
- package/dist/auth/authService.js +0 -114
- package/dist/tools/backupRestoreTools.d.ts +0 -18
- package/dist/tools/backupRestoreTools.js +0 -70
- package/dist/tools/documentationGeneratorTools.d.ts +0 -145
- package/dist/tools/documentationGeneratorTools.js +0 -820
- package/dist/tools/forecastingTools.d.ts +0 -36
- package/dist/tools/forecastingTools.js +0 -256
- package/dist/tools/functionTools.d.ts +0 -87
- package/dist/tools/functionTools.js +0 -358
- package/dist/tools/indexRecommendationTools.d.ts +0 -50
- package/dist/tools/indexRecommendationTools.js +0 -451
- package/dist/tools/intelligentQueryTools.d.ts +0 -94
- package/dist/tools/intelligentQueryTools.js +0 -713
- package/dist/tools/performanceTools.d.ts +0 -76
- package/dist/tools/performanceTools.js +0 -505
- package/dist/tools/processTools.d.ts +0 -61
- package/dist/tools/processTools.js +0 -181
- package/dist/tools/queryVisualizationTools.d.ts +0 -22
- package/dist/tools/queryVisualizationTools.js +0 -155
- package/dist/tools/schemaDesignTools.d.ts +0 -67
- package/dist/tools/schemaDesignTools.js +0 -359
- package/dist/tools/schemaPatternTools.d.ts +0 -19
- package/dist/tools/schemaPatternTools.js +0 -253
- package/dist/tools/schemaVersioningTools.d.ts +0 -138
- package/dist/tools/schemaVersioningTools.js +0 -1008
- package/dist/tools/securityAuditTools.d.ts +0 -39
- package/dist/tools/securityAuditTools.js +0 -319
- package/dist/tools/smartDiscoveryTools.d.ts +0 -163
- package/dist/tools/smartDiscoveryTools.js +0 -750
- package/dist/tools/testDataTools.d.ts +0 -26
- package/dist/tools/testDataTools.js +0 -325
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,67 @@ 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.45.2] - 2026-10-26
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Synced `DOCUMENTATIONS.md` and `README.md` with the v1.45 code:
|
|
12
|
+
- Exact `Host`/`Origin` allowlist defaults, including a non-loopback bind, and `0` meaning "no limit" for the session, idle-timeout, and body-size settings.
|
|
13
|
+
- HTTP status codes for session errors, plus OAuth claim checks (60 s clock skew, client id source, JWKS discovery and caching).
|
|
14
|
+
- Audit log event reference, and query timeout cancellation details.
|
|
15
|
+
- Tool annotation classes, and that HTTP settings are ignored over stdio.
|
|
16
|
+
- Corrected the transaction example to use `execute_in_transaction` with `transactionId`; `create_record` and `update_record` do not run inside a transaction.
|
|
17
|
+
- Documented `CACHE_MAX_MEMORY_MB` and the `MCP_MYSQL_REQUEST_FILE` alias.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- Broken documentation links: the README navigation anchors, and links to sections that no longer exist in `DOCUMENTATIONS.md` (Setup & Configuration, Agent Configuration Examples, Category Filtering System, Complete Tools Reference). Added Remote Access and Troubleshooting to the `DOCUMENTATIONS.md` table of contents. Documentation only; the catalog remains at 88 tools.
|
|
21
|
+
|
|
22
|
+
## [1.45.1] - 2026-10-26
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- `README.md` now lists the protection defaults (on in HTTP mode, off over stdio) and every HTTP setting with its default. It also shows how to run the HTTP server from `.env` and how to connect a client by URL. Documentation only; the catalog remains at 88 tools.
|
|
26
|
+
|
|
27
|
+
## [1.45.0] - 2026-10-26
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **Streamable HTTP transport (opt-in)** for ChatGPT connectors and other remote MCP clients. Enable it with `--transport=http` (or `--http`) or `MCP_TRANSPORT=http`; `--host`/`--port` or `MCP_HTTP_HOST`/`MCP_HTTP_PORT` set the address. stdio remains the default and is unchanged when these settings are absent. Uses Node's built-in `http` module, so there are no new dependencies.
|
|
31
|
+
- **HTTP authentication**: `MCP_HTTP_AUTH=token` (static bearer tokens of at least 32 characters, compared in constant time) or `oauth` (OAuth 2.1 resource server). The `oauth` mode validates JWT access tokens against the issuer's JWKS (RS/PS/ES/EdDSA; `none`/HMAC rejected), checks `iss`/`aud`/`exp`/`nbf` and required scopes, serves RFC 9728 Protected Resource Metadata, and adds `WWW-Authenticate` headers. `none` is refused unless the server is bound to loopback with loopback-only allowed hosts.
|
|
32
|
+
- **HTTP hardening**: `Host`/`Origin` allowlists (DNS-rebinding protection), CORS for allowed origins, request body limit, concurrent-session cap, idle-session expiry, and sessions bound to the identity that created them.
|
|
33
|
+
- **Protection settings** for both transports. They are on by default over HTTP and off over stdio: `MCP_QUERY_TIMEOUT_MS` (cancels statements on the server with `KILL QUERY`), `MCP_RATE_LIMIT_PER_MINUTE` (tool calls per client), `MCP_MAX_RESULT_BYTES` (truncates row arrays, rejects other oversized results), and `MCP_AUDIT_LOG` (JSON lines to stderr or a file).
|
|
34
|
+
- **Read-only database user check**: in HTTP mode, `SHOW GRANTS` is inspected at startup and a warning is logged when the MySQL user can write. `MCP_REQUIRE_READONLY_DB_USER=true` makes startup fail instead.
|
|
35
|
+
- **Tool annotations** (`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on all 88 tools, also returned by `list_all_tools`.
|
|
36
|
+
- Jest tests for runtime config, authentication, the HTTP server (using the SDK client), annotations, grant inspection, and rate limiting.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Transactions belong to the MCP session that began them: other sessions cannot see, use, commit, or roll them back. Open transactions are rolled back when their session closes or expires. Over stdio there is one session, so behaviour does not change.
|
|
40
|
+
- `begin_transaction` rejects a transaction ID that is already in use. Previously the open transaction was replaced and its connection leaked.
|
|
41
|
+
- A statement that hits `MCP_QUERY_TIMEOUT_MS` inside a transaction rolls that transaction back.
|
|
42
|
+
- `mcp-server.ts` builds its MCP server through a factory (one per HTTP session). Tool dispatch is unchanged.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- `get_transaction_status` now returns the `activeTransactions` list. It was previously dropped from the response, leaving only the message.
|
|
46
|
+
|
|
47
|
+
## [1.44.0] - 2026-10-26
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- **Read-only default permissions**: when neither permissions nor categories are configured, the server enables only `list,read,utility` instead of every tool. Configurations that relied on the old default must now list permissions explicitly.
|
|
51
|
+
- **No implicit `mysql` schema**: `DB_NAME` no longer falls back to the `mysql` system schema. Without a configured database, database-scoped tools return "No database specified".
|
|
52
|
+
- **Query cache disabled by default**: opt in with `CACHE_ENABLED=true`.
|
|
53
|
+
- `CallTool` dispatch now resolves tools to their `MySQLMCP` method through the same path as the Cursor bridge, replacing the per-tool `switch`. The server version is read from `package.json`.
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- SQL validation no longer rejects `#`, `;`, `--`, or `/* */` inside string literals and quoted identifiers (e.g. `WHERE color = '#fff'`). Literals containing backslashes still get the strict raw-text check because their meaning depends on `NO_BACKSLASH_ESCAPES`.
|
|
57
|
+
- `WITH` (CTE) queries are classified by their main statement (SELECT/UPDATE/DELETE) instead of being rejected. CTEs in read queries require `execute`, as derived tables do.
|
|
58
|
+
- When the cache is enabled, writes executed inside transactions and transaction commits now clear it, and table-name guessing was replaced by clearing the whole cache on any data-changing statement (covers db-qualified names, multi-table writes, DDL, and `EXPLAIN ANALYZE`).
|
|
59
|
+
- `npm run build` now removes `dist/` first, so the stale `dist/auth/authService.js` (JWT code with a default secret and an undeclared `jsonwebtoken` dependency) is no longer published.
|
|
60
|
+
- `npm run dev` (ts-node) works again: local imports no longer use `.js` suffixes that ts-node could not resolve.
|
|
61
|
+
- Restricted permission profiles no longer log "Unknown tool" warnings for tools mapped only by their snake_case name.
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
- Jest test suite in `src/__tests__/` covering the SQL validator, default permissions, and cache invalidation.
|
|
65
|
+
|
|
66
|
+
### Removed
|
|
67
|
+
- Unused `next-env.d.ts`. Removed the inaccurate "PII masking in exports" claim from the documentation; results are returned unmasked. The catalog remains at 88 tools.
|
|
68
|
+
|
|
8
69
|
## [1.43.5] - 2026-10-12
|
|
9
70
|
|
|
10
71
|
### Added
|