MySQL MCP Server
@OTA-EITA
About MySQL MCP Server
No overview available yet
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mysql_mcp_servers": {
"command": "docker",
"args": [
"build",
"-t",
"mysql-mcp-server:latest",
"."
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MySQL MCP Server?
It provides a server to interact with MySQL databases using the Model Context Protocol (MCP). It is designed for accessing MySQL databases from WSL (Windows Subsystem for Linux) environments.
How to use MySQL MCP Server?
Clone the repository, create a Python 3.11+ virtual environment, install dependencies, and run the setup script. The server can be started directly (./run_direct.sh), as a module (./run_module.sh), or inside a Docker container (./run_docker.sh). Connection to MySQL is configured via environment variables (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE).
Key features of MySQL MCP Server
- Retrieves a list of tables in the database
- Reads data from a specific table (up to 100 rows)
- Executes SQL queries (SELECT, SHOW TABLES, INSERT, UPDATE, DELETE)
- Implements MCP endpoints: list_resources, read_resource, list_tools, call_tool
- Supports direct, module, and Docker execution
- Provides Nox sessions for testing, formatting, and linting
Use cases of MySQL MCP Server
- Query a MySQL database from any MCP‑compatible client (e.g., AI assistants)
- Access a MySQL database running inside WSL from outside the subsystem
- Automate database interactions by calling SQL tools through the MCP protocol
- Run ad‑hoc SQL queries (SELECT, INSERT, UPDATE, DELETE) without a full client
FAQ from MySQL MCP Server
What is the maximum number of rows returned when reading a table?
The read_resource endpoint returns up to 100 rows from a table.
What environment variables are required to connect to MySQL?
MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE must be set.
Can I run the server inside a Docker container?
Yes, build the Docker image with docker build -t mysql-mcp-server:latest . and run with ./run_docker.sh.
What Python version is needed?
Python 3.11 or higher is required.
How do I connect to a MySQL server running in WSL?
Configure the MySQL bind-address to 0.0.0.0, grant remote access to the user, and ensure the Windows firewall allows the MySQL port (default 13306).
Frequently asked questions
What is the maximum number of rows returned when reading a table?
The read_resource endpoint returns up to 100 rows from a table.
What environment variables are required to connect to MySQL?
MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE must be set.
Can I run the server inside a Docker container?
Yes, build the Docker image with `docker build -t mysql-mcp-server:latest .` and run with `./run_docker.sh`.
What Python version is needed?
Python 3.11 or higher is required.
How do I connect to a MySQL server running in WSL?
Configure the MySQL bind-address to 0.0.0.0, grant remote access to the user, and ensure the Windows firewall allows the MySQL port (default 13306).
Basic information
More Databases MCP servers
MongoDB MCP Server
mongodb-jsA Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
Postgres Mcp
crystaldbaPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
MCP Server for MySQL based on NodeJS
benborlaA Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
Comments