MySQL MCP Server
@designcomputer
About MySQL MCP Server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mysql_mcp_server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"designcomputer/mysql-mcp-server",
"--client",
"claude"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is MySQL MCP Server?
MySQL MCP Server is a Model Context Protocol implementation that enables secure interaction between AI applications (hosts/clients) and MySQL databases. It facilitates structured database exploration and analysis through a controlled interface.
How to use MySQL MCP Server?
Install via pip install mysql-mcp-server, then configure environment variables (e.g. MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) and integrate with hosts like Claude Desktop or VS Code by adding the server to their MCP configuration. Supports both STDIO and SSE transport modes. For remote deployments, use SSE with a reverse proxy for authentication.
Key features of MySQL MCP Server
- List MySQL tables as resources
- Read table contents and execute SQL queries
- Multi-database mode when
MYSQL_DATABASEis omitted - SSE/HTTP transport support with
MCP_TRANSPORT=sse - SSH tunneling for secure connections
- Comprehensive schema information via
get_schema_info - Table data sampling via
get_table_sample - Secure database access through environment variables
Use cases of MySQL MCP Server
- AI agents exploring database structure before analysis
- Running safe, single‑statement SQL queries through a chat interface
- Sampling data from tables to understand content without large fetches
- Cross‑database queries using
database.tablenotation - Self‑hosted deployments with SSH tunneling or SSL/TLS encryption
FAQ from MySQL MCP Server
What transport modes does MySQL MCP Server support?
It supports both STDIO (standard input/output) and Streamable HTTP (SSE) transport modes. SSE is recommended for remote or self‑hosted deployments.
How do I enable multi‑database mode?
Omit the MYSQL_DATABASE environment variable. The server then returns all user databases for resource listing and allows fully qualified names like mydb.mytable in queries.
Does SSE transport include built‑in authentication?
No. SSE binds to 0.0.0.0 by default and accepts connections without credentials. If exposed beyond localhost, place it behind a reverse proxy (e.g., nginx with HTTP Basic Auth) and set MCP_SSE_HOST=127.0.0.1.
What are the limitations on SQL queries?
Only single‑statement queries are supported. Multi‑statement queries (e.g., USE db; SELECT …) are not allowed. DML operations (INSERT, UPDATE, DELETE) are marked with a destructive hint.
How are table/column identifiers validated?
Identifiers in get_schema_info and get_table_sample are restricted to alphanumeric characters, underscores, and $. A single dot is allowed as a separator between database and table names. Other special characters are rejected to prevent SQL injection.
Frequently asked questions
What transport modes does MySQL MCP Server support?
It supports both STDIO (standard input/output) and Streamable HTTP (SSE) transport modes. SSE is recommended for remote or self‑hosted deployments.
How do I enable multi‑database mode?
Omit the `MYSQL_DATABASE` environment variable. The server then returns all user databases for resource listing and allows fully qualified names like `mydb.mytable` in queries.
Does SSE transport include built‑in authentication?
No. SSE binds to `0.0.0.0` by default and accepts connections without credentials. If exposed beyond localhost, place it behind a reverse proxy (e.g., nginx with HTTP Basic Auth) and set `MCP_SSE_HOST=127.0.0.1`.
What are the limitations on SQL queries?
Only single‑statement queries are supported. Multi‑statement queries (e.g., `USE db; SELECT …`) are not allowed. DML operations (`INSERT`, `UPDATE`, `DELETE`) are marked with a destructive hint.
How are table/column identifiers validated?
Identifiers in `get_schema_info` and `get_table_sample` are restricted to alphanumeric characters, underscores, and `$`. A single dot is allowed as a separator between database and table names. Other special characters are rejected to prevent SQL injection.
Basic information
More Databases MCP servers

Local YDB MCP
astandrikSafety-first stdio MCP server with 38 tools for operating Docker-based local-ydb environments locally or over SSH.
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
mcp-server-qdrant: A Qdrant MCP server
qdrantAn official Qdrant Model Context Protocol (MCP) server implementation
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
Comments