MySQL MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MYSQL_SSL | No | Enable SSL connection | false |
| MYSQL_HOST | Yes | MySQL host | |
| MYSQL_PORT | No | MySQL port | 3306 |
| MYSQL_USER | Yes | MySQL user | |
| MYSQL_DATABASE | No | Default database | |
| MYSQL_MAX_ROWS | No | Auto LIMIT for SELECT queries | 100 |
| MYSQL_PASSWORD | Yes | MySQL password | |
| MYSQL_READONLY | No | Read-only mode | false |
| MYSQL_QUERY_TIMEOUT | No | Query timeout in ms (0 to disable) | 30000 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| queryA | Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN). LIMIT is auto-appended to SELECT/WITH queries without one (default: server maxRows). Prefer specific columns over SELECT * to reduce response size. For data modification, use the "execute" tool instead. |
| executeA | Execute a data modification SQL statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, etc.). Set dryRun=true to validate without executing — uses EXPLAIN for DML, or previews the SQL for DDL. Always confirm destructive operations (DROP, TRUNCATE, DELETE without WHERE) with the user before executing. Not available in read-only mode. |
| list_databasesA | List all databases on the MySQL server. Use this as a starting point to discover available databases before querying. Returns a JSON array of database names. |
| list_tablesA | List all tables in the specified database (or the current database if not specified). Includes table comments when available. Use this before describe_table to find the exact table name. |
| describe_tableA | Show the schema/structure of a table, including column names, types, constraints, and comments. Use this before writing queries to ensure correct column names and types. For inspecting all tables at once, use describe_all_tables instead. |
| describe_all_tablesA | Show the schema of all tables at once. Much more efficient than calling describe_table for each table individually. Warning: response can be large for databases with many tables — prefer describe_table for specific tables when possible. |
| add_commentA | Safely add a comment to a table or column. This tool only modifies comments — it cannot alter table structure, column types, or data. Set dryRun=true to preview the generated SQL without executing it. Use describe_table first to verify column names. Not available in read-only mode. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ImRieul/mysql-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server