tokenlite-mysql-mcp
v5.0.0A secure, efficient, and intelligent MySQL server for the Model Context Protocol
Values you need
| Variable | What it is | |
|---|---|---|
DB_HOST | optional | MySQL Host address (defaults to localhost) |
DB_PORT | optional | MySQL Port (defaults to 3306) |
DB_USER | optional | MySQL Username (defaults to root) |
DB_PASSWORD | optional secret | MySQL Password (defaults to empty string) |
DB_NAME | required | MySQL Database name |
MCP_EXPLAIN_MAX_SCAN_ROWS | optional | EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias. |
MCP_QUERY_ROW_LIMIT | optional | Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500) |
MCP_SAFE_QUERY_MAX_ROWS | optional | Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS |
MCP_SAFE_QUERY_ENABLE_BLOCKING | optional | Enable or disable the EXPLAIN guardrail (defaults to true) |
MCP_METADATA_PATH | optional | Absolute path to your custom metadata.json dictionary |
MCP_TEMPLATES_PATH | optional | Absolute path to your custom templates.json pre-approved queries |
TOOL_PREFIX | optional | Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override. |
MCP_RATE_LIMIT_RPM | optional | Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable. |
MYSQL_QUERY_TIMEOUT | optional | Max execution time for a query in milliseconds to protect against DoS (defaults to 15000) |
MYSQL_CONNECTION_LIMIT | optional | Max concurrent pool connections (defaults to 10) |
MYSQL_CONNECT_TIMEOUT | optional | Max time to wait for a connection socket to establish in milliseconds (defaults to 10000) |
MYSQL_RETRY_ATTEMPTS | optional | Max retries on transient connection errors (defaults to 3) |
MYSQL_RETRY_DELAY_MS | optional | Base delay in milliseconds for exponential backoff between retries (defaults to 1000) |
MYSQL_QUEUE_LIMIT | optional | Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50) |
MCP_DDL_CACHE_TTL | optional | Time-to-live in seconds for cached DDL statements (defaults to 60) |
MCP_LOG_LEVEL | optional | Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency |
ALLOW_INSERT_OPERATION | optional | Enable INSERT and REPLACE queries (defaults to false) |
ALLOW_UPDATE_OPERATION | optional | Enable UPDATE queries (defaults to false) |
ALLOW_DELETE_OPERATION | optional | Enable DELETE and TRUNCATE queries (defaults to false) |
ALLOW_DDL_OPERATION | optional | Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false) |
DB_SSL | optional | Enable TLS for the MySQL connection (defaults to false) |
DB_SSL_REJECT_UNAUTHORIZED | optional | Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true) |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add tokenlite-mysql-mcp -e 'DB_NAME=<DB_NAME>' -- npx -y @andezdev/tokenlite-mysql-mcp@5.0.0Add to
claude_desktop_config.json{
"mcpServers": {
"tokenlite-mysql-mcp": {
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp@5.0.0"
],
"command": "npx",
"env": {
"DB_NAME": "<DB_NAME>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"tokenlite-mysql-mcp": {
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp@5.0.0"
],
"command": "npx",
"env": {
"DB_NAME": "<DB_NAME>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "DB_NAME",
"id": "db-name",
"password": true,
"type": "promptString"
}
],
"servers": {
"tokenlite-mysql-mcp": {
"args": [
"-y",
"@andezdev/tokenlite-mysql-mcp@5.0.0"
],
"command": "npx",
"env": {
"DB_NAME": "${input:db-name}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.tokenlite-mysql-mcp]
command = "npx"
args = ["-y", "@andezdev/tokenlite-mysql-mcp@5.0.0"]
env = { "DB_NAME" = "<DB_NAME>" }For AI agents
- Ask the user for: DB_NAME. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: mcpkg_smoke_placeholder_search_schema, mcpkg_smoke_placeholder_execute_safe_query, mcpkg_smoke_placeholder_refresh_schema, mcpkg_smoke_placeholder_ping, mcpkg_smoke_placeholder_explain_query.
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json