mcp-mysql-server
@tonycai
About mcp-mysql-server
MySQL Database Integration using Python script with configurable access controls and schema inspection, using stdio mode to suitable local deployment.
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-mysql-server-tonycai": {
"command": "python",
"args": [
"mcp-mysql-server.py",
"--config",
"config.ini"
]
}
}
}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 mcp-mysql-server?
mcp-mysql-server is a Python script that provides a command-line interface for interacting with a local MySQL database via standard input/output (stdio) using FastMCP. It allows querying, inspecting schema, and performing data operations on a MySQL database, designed for local development environments.
How to use mcp-mysql-server?
Install Python 3.x and a local MySQL server. Install dependencies with pip install -r requirements.txt. Create a config.ini file with MySQL connection parameters (host, user, password, database; port optional). Run the script using python mcp-mysql-server.py --config config.ini. The script exposes tools such as test_connection, list_tables, read_table, write_table, get_table_schema, and execute_sql. Docker Compose support is also available.
Key features of mcp-mysql-server
- Execute SQL SELECT statements and view results
- Insert data into tables with write_table tool
- List all tables with list_tables tool
- Display table schema with get_table_schema tool
- Test database connectivity and get server info
- Configurable access via connection parameters file
Use cases of mcp-mysql-server
- Exploring and inspecting the schema of a local MySQL database
- Running custom SQL queries from the command line
- Inserting rows into tables during development
- Scripting database interactions in automation workflows
- Testing database connectivity and server details
FAQ from mcp-mysql-server
How do I configure mcp-mysql-server?
Create a config.ini file in the same directory (or specify its path with --config) containing [mysql] section with host, user, password, database, and optionally port (defaults to 3306).
What tools does mcp-mysql-server expose?
It exposes six tools: test_connection, list_tables, read_table, write_table, get_table_schema, and execute_sql. Each performs a specific database operation.
Does mcp-mysql-server support Docker?
Yes. Use docker-compose up -d to start a MySQL container with sample data and the MCP MySQL Server container. A special configuration file (config.docker.ini) is used for Docker.
What are the runtime requirements?
Python 3.x, a local MySQL server instance, and the Python libraries listed in requirements.txt (installed via pip install -r requirements.txt).
How can I run the unit tests?
Run cp mcp-mysql-server.py mcp_mysql_server.py && python -m unittest tests.py locally. For Docker, use docker-compose -f docker-compose.test.yml up --build. Tests use mocking and do not require a real database.
More Databases MCP servers
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.
mcp-server-qdrant: A Qdrant MCP server
qdrantAn official Qdrant Model Context Protocol (MCP) server implementation
Neon MCP Server
neondatabase-labsMCP server for interacting with Neon Management API and databases
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
MySQL MCP Server
designcomputerA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Comments