MySQL MCP Server
@yuki777
About MySQL MCP Server
No overview available yet
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mysql-mcp-server-yuki777": {
"command": "npx",
"args": [
"-y",
"https://github.com/yuki777/mysql-mcp-server",
"--host",
"127.0.0.1",
"--port",
"13306",
"--user",
"root"
]
}
}
}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?
MySQL MCP Server enables large language models (LLMs) to directly execute SQL queries on a local MySQL or MariaDB database by implementing the Model Context Protocol (MCP). It is built for developers and AI applications that need LLMs to safely interact with relational databases.
How to use MySQL MCP Server?
Run it via npx with database connection options, or use a JSON config file. The server starts in stdio mode and accepts tool calls for connecting, querying, and managing connections. Example: npx -y https://github.com/yuki777/mysql-mcp-server --host 127.0.0.1 --port 13306 --user root. After starting, LLMs invoke MCP tools like execute_query and connect_database.
Key features of MySQL MCP Server
- Executes SQL queries directly from LLM tool calls
- Lists databases, tables, and table structures
- M‑CP compliant, integrates with any MCP‑capable LLM
- Uses stdio communication, no network port binding
- Saves connection profiles locally for reuse
- Manages multiple profiles and switches between them
Use cases of MySQL MCP Server
- Allow an LLM to explore and query a local database for data analysis
- Let an LLM manage database schemas by running DDL statements
- Switch between development and production databases using saved profiles
- Securely connect an LLM to a database without exposing network ports
FAQ from MySQL MCP Server
What are the runtime requirements?
Node.js 20.0.0 or higher and MySQL 5.7+ or MariaDB server are required.
Where are saved connection profiles stored?
Profiles are stored locally in ~/.mysql-mcp-connections.json in the user’s home directory.
Does this server expose a network port?
No, it uses stdio communication by default, avoiding port conflicts and improving security. An optional HTTP server port can be configured but is not used in stdio mode.
Can I connect to multiple databases without restarting?
Yes, the server separates startup from database connection. You can use connect_database or connect_by_profile tools to switch between databases at runtime.
How do I configure a custom query timeout and result limit?
Use the --query-timeout (default 30000 ms) and --max-results (default 1000 rows) command‑line options or set them in the JSON config file.
Frequently asked questions
What are the runtime requirements?
Node.js 20.0.0 or higher and MySQL 5.7+ or MariaDB server are required.
Where are saved connection profiles stored?
Profiles are stored locally in `~/.mysql-mcp-connections.json` in the user’s home directory.
Does this server expose a network port?
No, it uses stdio communication by default, avoiding port conflicts and improving security. An optional HTTP server port can be configured but is not used in stdio mode.
Can I connect to multiple databases without restarting?
Yes, the server separates startup from database connection. You can use `connect_database` or `connect_by_profile` tools to switch between databases at runtime.
How do I configure a custom query timeout and result limit?
Use the `--query-timeout` (default 30000 ms) and `--max-results` (default 1000 rows) command‑line options or set them in the JSON config file.
Basic information
More Databases MCP servers
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
Neon MCP Server
neondatabase-labsMCP server for interacting with Neon Management API and databases
Neon MCP Server
neondatabaseMCP server for interacting with Neon Management API and databases
MCP MongoDB Server
kiliczshA Model Context Protocol Server for MongoDB
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