
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Go-based MCP server that lets MCP clients interact with MySQL databases for schema inspection and query execution.
MCP MySQL Server is cataloged as an MCP server attributed to cnosuke. A Go-based MCP server that lets MCP clients interact with MySQL databases for schema inspection and query execution. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for MCP MySQL Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, read-only mode can be enabled, and in that mode only tools beginning with list, read_ and desc_ are available.
Yes, enabling explain_check checks the query plan with EXPLAIN before executing.
It supports both native MySQL DSN format and URL-style connection strings such as mysql://.
README.md · 99dd0e7cf98b · 采集于 2026-11-13 11:03:21 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
MCP MySQL Server is a Go-based MCP server implementation that provides MySQL database interaction functionality, allowing MCP clients (e.g., Claude Desktop) to perform database operations.
mysql://user:pass@host:port/dbname.For local development:
# Pull the image
docker pull cnosuke/mcp-mysql:latest
# Run with default settings
docker run -i --rm cnosuke/mcp-mysql:latest
# Run with custom MySQL connection
docker run -i --rm \
-e MYSQL_HOST=your-mysql-host \
-e MYSQL_PORT=3306 \
-e MYSQL_USER=your-username \
-e MYSQL_PASSWORD=your-password \
-e MYSQL_DATABASE=your-database \
cnosuke/mcp-mysql:latest
# Run in read-only mode
docker run -i --rm \
-e MYSQL_HOST=your-mysql-host \
-e MYSQL_USER=your-username \
-e MYSQL_PASSWORD=your-password \
-e MYSQL_DATABASE=your-database \
-e MYSQL_READ_ONLY=true \
cnosuke/mcp-mysql:latest
To integrate with Claude Desktop using Docker, add an entry to your claude_desktop_config.json file:
{
"mcpServers": {
"mysql": {
"command": "docker",
"args": ["run", "-i", "--rm", "cnosuke/mcp-mysql:latest"],
"env": {
"MYSQL_HOST": "your-mysql-host",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your-username",
"MYSQL_PASSWORD": "your-password",
"MYSQL_DATABASE": "your-database",
"MYSQL_READ_ONLY": "false"
}
}
}
}
Alternatively, you can build and run the Go binary directly:
# Build the server
make
# Run the server
./bin/mcp-mysql server --config=config.yml
To integrate with Claude Desktop using the Go binary, add an entry to your claude_desktop_config.json file:
{
"mcpServers": {
"mysql": {
"command": "./bin/mcp-mysql",
"args": ["server"],
"env": {
"LOG_PATH": "mcp-mysql.log",
"DEBUG": "false",
"MYSQL_HOST": "your-mysql-host",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your-username",
"MYSQL_PASSWORD": "your-password",
"MYSQL_DATABASE": "your-database",
"MYSQL_READ_ONLY": "false"
}
}
}
}
This project uses Google's distroless container images for the final Docker image. The gcr.io/distroless/static base image provides:
The Docker image is built using a multi-stage build process:
The server is configured via a YAML file (default: config.yml) or environment variables:
log: 'path/to/mcp-mysql.log' # Log file path, if empty no log will be produced
debug: false # Enable debug mode for verbose logging
mysql:
host: 'localhost'
user: 'root'
password: ''
port: 3306
database: ''
dsn: ''
read_only: false
explain_check: false
You can specify MySQL connection details in three ways (in order of precedence):
dsn parameter directly to any tool when invoking itmysql.dsn value in the configuration fileIf no connection information is provided in any of these ways, the server will return an error message prompting you to provide connection details.
mysql.host: MySQL server hostname (default: 'localhost')mysql.user: MySQL username (default: 'root')mysql.password: MySQL passwordmysql.port: MySQL port (default: 3306)mysql.database: MySQL database namemysql.dsn: MySQL DSN (Data Source Name) string. If provided, this overrides the individual connection parametersmysql.read_only: Enable read-only mode. In this mode, only tools beginning with list, read_ and desc_ are availablemysql.explain_check: Check query plan with EXPLAIN before executingYou can override configurations using environment variables:
LOG_PATH: Path to log fileDEBUG: Enable debug mode (true/false)MYSQL_HOST: MySQL server hostnameMYSQL_PORT: MySQL server portMYSQL_USER: MySQL usernameMYSQL_PASSWORD: MySQL passwordMYSQL_DATABASE: MySQL database nameMYSQL_DSN: MySQL DSN stringMYSQL_READ_ONLY: Enable read-only mode (true/false)MYSQL_EXPLAIN_CHECK: Enable query plan checking (true/false)Logging behavior is controlled through configuration:
log is set in the config file, logs will be written to the specified filelog is empty, no logs will be produceddebug: true for more verbose loggingMCP clients interact with the server by sending JSON‐RPC requests to execute various tools. The following MCP tools are supported:
list_database
dsn (optional): MySQL DSN string to override configuration.list_table
dsn (optional): MySQL DSN string to override configuration.create_table (not available in read-only mode)
query: The SQL query to create the table.dsn (optional): MySQL DSN string to override configuration.alter_table (not available in read-only mode)
query: The SQL query to alter the table.dsn (optional): MySQL DSN string to override configuration.desc_table
name: The name of the table to describe.dsn (optional): MySQL DSN string to override configuration.read_query
query: The SQL query to execute.dsn (optional): MySQL DSN string to override configuration.write_query (not available in read-only mode)
query: The SQL query to execute.dsn (optional): MySQL DSN string to override configuration.update_query (not available in read-only mode)
query: The SQL query to execute.dsn (optional): MySQL DSN string to override configuration.delete_query (not available in read-only mode)
query: The SQL query to execute.dsn (optional): MySQL DSN string to override configuration.The dsn parameter or mysql.dsn configuration option can be specified in two formats:
[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
Example: username:password@tcp(localhost:3306)/mydb?parseTime=true&loc=Local
Please refer to MySQL DSN for more details on this format.
mysql://username:password@hostname:port/dbname?param1=value1¶m2=value2
Example: mysql://root:pass@localhost:3306/mydb?parseTime=true&loc=Local
This URL-style format is automatically converted to the native MySQL DSN format.
Supported URL schemes include: mysql://, mariadb://.
When starting the server, you can specify various settings:
./bin/mcp-mysql server [options]
Options:
--config, -c: Path to the configuration file (default: "config.yml").Contributions are welcome! Please fork the repository and submit pull requests for improvements or bug fixes. For major changes, open an issue first to discuss your ideas.
This project is licensed under the MIT License.
Author: cnosuke ( x.com/cnosuke )
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for MCP MySQL Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-mysql-cnosuke)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.