Skip to main content
Glama
ImRieul

MySQL MCP Server

by ImRieul

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MYSQL_SSLNoEnable SSL connectionfalse
MYSQL_HOSTYesMySQL host
MYSQL_PORTNoMySQL port3306
MYSQL_USERYesMySQL user
MYSQL_DATABASENoDefault database
MYSQL_MAX_ROWSNoAuto LIMIT for SELECT queries100
MYSQL_PASSWORDYesMySQL password
MYSQL_READONLYNoRead-only modefalse
MYSQL_QUERY_TIMEOUTNoQuery timeout in ms (0 to disable)30000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

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