tokenlite-mysql-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_HOST | No | MySQL Host address | localhost |
| DB_NAME | Yes | MySQL Database name (required) | |
| DB_PORT | No | MySQL Port | 3306 |
| DB_USER | No | MySQL Username | root |
| DB_PASSWORD | No | MySQL Password | |
| TOOL_PREFIX | No | Prefix for tool names | |
| MCP_LOG_LEVEL | No | Minimum severity for MCP log notifications | info |
| MCP_DDL_CACHE_TTL | No | Time-to-live (in seconds) for cached DDL statements | 60 |
| MCP_METADATA_PATH | No | Absolute path to your custom metadata.json dictionary | |
| MYSQL_QUEUE_LIMIT | No | Max queued requests when all pool connections are busy | 50 |
| MCP_TEMPLATES_PATH | No | Absolute path to your custom templates.json queries | |
| ALLOW_DDL_OPERATION | No | Enable Data Definition Language (CREATE, ALTER, DROP, RENAME) | false |
| MYSQL_QUERY_TIMEOUT | No | Max execution time for a query (in ms) | 15000 |
| MYSQL_RETRY_ATTEMPTS | No | Max retries on transient connection errors | 3 |
| MYSQL_RETRY_DELAY_MS | No | Base delay (ms) for exponential backoff between retries | 1000 |
| MYSQL_CONNECT_TIMEOUT | No | Max time to wait for a socket to establish (in ms) | 10000 |
| ALLOW_DELETE_OPERATION | No | Enable DELETE and TRUNCATE queries | false |
| ALLOW_INSERT_OPERATION | No | Enable INSERT and REPLACE queries | false |
| ALLOW_UPDATE_OPERATION | No | Enable UPDATE queries | false |
| MYSQL_CONNECTION_LIMIT | No | Max concurrent pool connections | 10 |
| MCP_SAFE_QUERY_MAX_ROWS | No | Threshold for EXPLAIN to block unindexed Full Table Scans | 1000 |
| MCP_SAFE_QUERY_ENABLE_BLOCKING | No | Enable or disable the EXPLAIN guardrail | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": true,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mydatabase_search_schemaA | CRITICAL TOOL FOR SCHEMA EXPLORATION: Use this tool FIRST to understand the database structure. Searches for a table and returns its exact SQL DDL, along with the DDL of its direct parent and child tables (Auto-Join Context). Do NOT use execute_safe_query for schema exploration. |
| mydatabase_execute_safe_queryA | Executes a safe SELECT query on the database. Large results are automatically truncated. CRITICAL: NEVER use this tool (e.g., SHOW TABLES or querying information_schema) to understand the database structure. You MUST ALWAYS use the 'search_schema' tool first to understand the relationships and tables before writing any JOIN queries. |
| mydatabase_refresh_schemaA | Forces the MCP server to rebuild the internal Schema Graph. Use this if you suspect a DBA recently added a table, column, or foreign key and the search_schema or execute queries are failing. |
| mydatabase_pingA | Health check: verifies the database connection is alive and returns pool stats and server version. |
| mydatabase_explain_queryA | Returns the MySQL EXPLAIN output for a SELECT query. Use this to understand index usage, join types, and row estimates before rewriting a blocked or slow query. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| mydatabase_query_templates | Official company SQL templates for business metrics. Use this as a starting point to avoid writing SQL from scratch. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| schema | Lists all available tables in the database schema |
TDQS
Scored across 5 tools
Each tool has a distinct purpose: executing safe SELECT queries, explaining query plans, checking connection health, forcing schema refresh, and searching schema metadata. No two tools overlap in functionality, making it easy for an agent to select the correct one.
All tools follow the pattern 'mydatabase_<action>' with verbs like execute, explain, ping, refresh, search. While most are verb_noun (e.g., execute_safe_query), 'ping' is a single verb, which is a minor deviation but still clear and predictable.
With 5 tools, the server covers essential database operations (query, explain, schema search, schema refresh, health check) without unnecessary bloat. The count is well-scoped for a focused MySQL utility.
The tool set provides good coverage for read-only database interaction and schema exploration. However, there is no tool to list all tables or columns directly; agents must rely on search_schema which requires prior knowledge of table names. This is a minor gap for full self-service discovery.