Skip to main content
Glama
tokenlite-mysql-mcp

tokenlite-mysql-mcp

by andezdev

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_HOSTNoMySQL Host addresslocalhost
DB_NAMEYesMySQL Database name (required)
DB_PORTNoMySQL Port3306
DB_USERNoMySQL Usernameroot
DB_PASSWORDNoMySQL Password
TOOL_PREFIXNoPrefix for tool names
MCP_LOG_LEVELNoMinimum severity for MCP log notificationsinfo
MCP_DDL_CACHE_TTLNoTime-to-live (in seconds) for cached DDL statements60
MCP_METADATA_PATHNoAbsolute path to your custom metadata.json dictionary
MYSQL_QUEUE_LIMITNoMax queued requests when all pool connections are busy50
MCP_TEMPLATES_PATHNoAbsolute path to your custom templates.json queries
ALLOW_DDL_OPERATIONNoEnable Data Definition Language (CREATE, ALTER, DROP, RENAME)false
MYSQL_QUERY_TIMEOUTNoMax execution time for a query (in ms)15000
MYSQL_RETRY_ATTEMPTSNoMax retries on transient connection errors3
MYSQL_RETRY_DELAY_MSNoBase delay (ms) for exponential backoff between retries1000
MYSQL_CONNECT_TIMEOUTNoMax time to wait for a socket to establish (in ms)10000
ALLOW_DELETE_OPERATIONNoEnable DELETE and TRUNCATE queriesfalse
ALLOW_INSERT_OPERATIONNoEnable INSERT and REPLACE queriesfalse
ALLOW_UPDATE_OPERATIONNoEnable UPDATE queriesfalse
MYSQL_CONNECTION_LIMITNoMax concurrent pool connections10
MCP_SAFE_QUERY_MAX_ROWSNoThreshold for EXPLAIN to block unindexed Full Table Scans1000
MCP_SAFE_QUERY_ENABLE_BLOCKINGNoEnable or disable the EXPLAIN guardrailtrue

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

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": true,
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
mydatabase_search_schemaA

CRITICAL TOOL FOR SCHEMA EXPLORATION: Use this FIRST before writing queries. Fuzzy-searches a table name and returns its DDL plus direct parent/child table DDLs (Auto-Join Context), inferred FK hints, and semantic dictionary entries from metadata.json when configured. If templates.json is loaded, reminds you to use the 'query_templates' prompt for business metrics. Do NOT use execute_safe_query for schema exploration.

mydatabase_execute_safe_queryA

Executes SQL against the database with AST validation. SELECT results are capped by MCP_QUERY_ROW_LIMIT (default 500, AST-injected LIMIT) and include a '-- rows: N (truncated at LIMIT X)' footer when the cap is reached. Unindexed full table scans above MCP_EXPLAIN_MAX_SCAN_ROWS are blocked before execution. Only the configured schema is reachable: SHOW statements, information_schema/mysql/performance_schema/sys, other schemas, server variables, SELECT ... INTO and functions such as LOAD_FILE or SLEEP are rejected by the server. To explore the schema use 'search_schema'.

mydatabase_refresh_schemaA

Rebuilds the internal Schema Graph from the live database and notifies subscribed MCP resources. Use when search_schema or execute_safe_query fail with missing table/column errors after a schema change.

mydatabase_pingA

Health check: verifies the database connection is alive. Returns JSON with status, MySQL server version, and connection pool stats (active, idle, queued).

mydatabase_explain_queryA

Returns MySQL EXPLAIN output as CSV for a validated SELECT query. SQL is AST-validated and timeout-protected; ANALYZE and non-SELECT statements are blocked. Unlike execute_safe_query, this does NOT block full table scans — use it to diagnose why a query was blocked or to verify index usage before executing.

Prompts

Interactive templates invoked by user choice

NameDescription
mydatabase_query_templatesReturns pre-approved SQL templates for business metrics (requires templates.json via MCP_TEMPLATES_PATH). Use before writing analytical SQL from scratch. Execute the returned SQL via execute_safe_query.

Resources

Contextual data attached and managed by the client

NameDescription
schemaLists all available tables in the database schema

TDQS

A4.2/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct role: schema exploration (search_schema), schema cache rebuild (refresh_schema), governed query execution (execute_safe_query), diagnostic EXPLAIN (explain_query), and liveness (ping). The descriptions actively disambiguate the closest pairs — search_schema vs execute_safe_query ('do NOT use execute_safe_query for schema exploration') and explain_query vs execute_safe_query (scan-blocking difference).

Naming Consistency5/5

All tools share the mydatabase_ prefix and snake_case verb_noun form (refresh_schema, search_schema, execute_safe_query, explain_query), with only the conventional bare 'ping' as a health-check name. No mixed casing or competing verb styles.

Tool Count5/5

Five tools is a tight, well-scoped set for a read-only SQL assistant, and each one earns its place (explore, rebuild cache, run, diagnose, health-check). Nothing looks like a redundant wrapper or a leftover utility.

Completeness4/5

The read-only lifecycle is covered end to end: discover schema, refresh it, validate/execute queries, diagnose blocked queries, and verify connectivity. Minor gaps remain — there is no explicit table-listing/overview tool for environments where the agent doesn't know table names, and the referenced query templates/metadata dictionary surface only exists as hints rather than tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues