@berthojoris/mcp-mysql-server 1.44.0 → 1.46.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 +52 -0
- package/DOCUMENTATIONS.md +680 -524
- package/README.md +473 -382
- package/bin/mcp-mysql.js +49 -3
- package/dist/config/featureConfig.js +5 -5
- package/dist/config/runtimeConfig.d.ts +50 -0
- package/dist/config/runtimeConfig.js +173 -0
- package/dist/db/connection.d.ts +32 -0
- package/dist/db/connection.js +169 -8
- package/dist/mcp-server.js +224 -83
- package/dist/optimization/queryOptimizer.d.ts +13 -5
- package/dist/optimization/queryOptimizer.js +85 -58
- package/dist/security/grantInspector.d.ts +5 -0
- package/dist/security/grantInspector.js +32 -0
- package/dist/security/securityLayer.js +3 -2
- 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/maintenanceTools.d.ts +3 -1
- package/dist/tools/maintenanceTools.js +22 -10
- package/dist/tools/queryTools.js +9 -0
- package/dist/tools/toolAnnotations.d.ts +4 -0
- package/dist/tools/toolAnnotations.js +73 -0
- package/manifest.json +6 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,58 @@ 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.46.0] - 2026-10-26
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
- `run_select_query` validates optimizer `hints` before adding them to the SQL. Table and index names must be identifiers, strategies and `MAX_EXECUTION_TIME`/`RESOURCE_GROUP`/`SET_VAR` values must match their MySQL forms, and invalid values are dropped. The query with hints applied is validated again before it runs.
|
|
12
|
+
- System schema checks (`mysql.user`, `mysql.db`, and the `execute` requirement for `information_schema`/`mysql`/`performance_schema`/`sys`) now also match names with whitespace around the dot.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **Breaking:** `optimize_table`, `repair_table`, `flush_table`, and `optimize_fulltext` require `ddl` instead of `utility`, so the read-only default (`list,read,utility`) no longer enables them. `analyze_table`, `check_table`, and `analyze_index` stay in `utility`.
|
|
16
|
+
- `flush_table` flushes only tables in the connected database (all of them when `table_name` is omitted) and rejects `with_read_lock`, which left the lock held on a pooled connection. The parameter was removed from the tool schema. The catalog remains at 88 tools.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- Jest tests for hint validation, qualified system schema names, and the maintenance tool permissions.
|
|
20
|
+
|
|
21
|
+
## [1.45.2] - 2026-10-26
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Synced `DOCUMENTATIONS.md` and `README.md` with the v1.45 code:
|
|
25
|
+
- Exact `Host`/`Origin` allowlist defaults, including a non-loopback bind, and `0` meaning "no limit" for the session, idle-timeout, and body-size settings.
|
|
26
|
+
- HTTP status codes for session errors, plus OAuth claim checks (60 s clock skew, client id source, JWKS discovery and caching).
|
|
27
|
+
- Audit log event reference, and query timeout cancellation details.
|
|
28
|
+
- Tool annotation classes, and that HTTP settings are ignored over stdio.
|
|
29
|
+
- Corrected the transaction example to use `execute_in_transaction` with `transactionId`; `create_record` and `update_record` do not run inside a transaction.
|
|
30
|
+
- Documented `CACHE_MAX_MEMORY_MB` and the `MCP_MYSQL_REQUEST_FILE` alias.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- 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.
|
|
34
|
+
|
|
35
|
+
## [1.45.1] - 2026-10-26
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- `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.
|
|
39
|
+
|
|
40
|
+
## [1.45.0] - 2026-10-26
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- **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.
|
|
44
|
+
- **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.
|
|
45
|
+
- **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.
|
|
46
|
+
- **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).
|
|
47
|
+
- **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.
|
|
48
|
+
- **Tool annotations** (`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on all 88 tools, also returned by `list_all_tools`.
|
|
49
|
+
- Jest tests for runtime config, authentication, the HTTP server (using the SDK client), annotations, grant inspection, and rate limiting.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
- 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.
|
|
53
|
+
- `begin_transaction` rejects a transaction ID that is already in use. Previously the open transaction was replaced and its connection leaked.
|
|
54
|
+
- A statement that hits `MCP_QUERY_TIMEOUT_MS` inside a transaction rolls that transaction back.
|
|
55
|
+
- `mcp-server.ts` builds its MCP server through a factory (one per HTTP session). Tool dispatch is unchanged.
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
- `get_transaction_status` now returns the `activeTransactions` list. It was previously dropped from the response, leaving only the message.
|
|
59
|
+
|
|
8
60
|
## [1.44.0] - 2026-10-26
|
|
9
61
|
|
|
10
62
|
### Changed
|