Repolode
designcomputer

designcomputer/mysql_mcp_server

An MCP server that lets AI assistants like Claude explore and query MySQL databases through a controlled set of tools.

Stars
1,408
Forks
260
Open issues
4
Last commit
10 days ago

What is it?

MySQL MCP Server implements the Model Context Protocol so AI applications can connect to a MySQL database and work with its schema and data. Instead of giving a model open-ended database access, it exposes a fixed set of tools: running SQL queries, inspecting table schemas, and sampling rows from a table.

It runs over stdio for local clients such as Claude Desktop, Claude Code, and VS Code, or over Streamable HTTP (SSE) for remote deployments. Connection settings come from environment variables and include SSL/TLS modes, SSH tunneling to reach private databases, and a multi-database mode that works across every user database on the server when no single database is specified. Passwords and SSH keys are masked in logs.

The server also provides two guided prompts, explore_database and analyze_table, that chain the schema and sampling tools into multi-step workflows. The SSE transport has no built-in authentication, so the project recommends placing it behind a reverse proxy when exposed beyond localhost.

Key features

  • 01Lists MySQL tables as resources and reads table contents
  • 02Executes SQL queries, including SELECT, SHOW, DESCRIBE, and DML statements
  • 03Returns schema details such as column types, nullability, defaults, and comments
  • 04Samples up to 20 rows from a table
  • 05Supports stdio and SSE/HTTP transports
  • 06Offers SSH tunneling, SSL/TLS modes, and multi-database mode

Use cases

  • Letting Claude or another AI assistant answer questions about a database's contents
  • Exploring an unfamiliar database schema before writing queries
  • Giving an AI tool read or limited write access to a dev or staging MySQL instance
  • Reaching a private MySQL server through an SSH jump host

Quick start

  1. 1

    Install the package from PyPI

    pip install mysql-mcp-server
  2. 2

    Set MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE in the MCP client config env block

  3. 3

    Register the server with Claude Code CLI

    claude mcp add --transport stdio designcomputer-mysql_mcp_server uvx mysql_mcp_server

Things to know

  • Only single SQL statements are supported; multi-statement queries are rejected.
  • The SSE transport has no built-in authentication and needs a reverse proxy if exposed beyond localhost.
  • Hosts like Claude Desktop do not load the project .env file, so credentials must go in the MCP config.

In collections

Topics

FAQ

What is mysql_mcp_server?
An MCP server that lets AI assistants like Claude explore and query MySQL databases through a controlled set of tools. MySQL MCP Server implements the Model Context Protocol so AI applications can connect to a MySQL database and work with its schema and data. Instead of giving a model open-ended database access, it exposes a fixed set of tools: running SQL queries, inspecting table schemas, and sampling rows from a table.
Is mysql_mcp_server free to use? What license does it have?
mysql_mcp_server is open source under the MIT license. Check the license terms before using it in commercial products.
Is mysql_mcp_server still maintained?
Actively maintained. The last commit to mysql_mcp_server was on Oct 28, 2026.
What can I use mysql_mcp_server for?
Letting Claude or another AI assistant answer questions about a database's contents Exploring an unfamiliar database schema before writing queries Giving an AI tool read or limited write access to a dev or staging MySQL instance Reaching a private MySQL server through an SSH jump host
How do I install mysql_mcp_server?
Install the package from PyPI: pip install mysql-mcp-server Set MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE in the MCP client config env block Register the server with Claude Code CLI: claude mcp add --transport stdio designcomputer-mysql_mcp_server uvx mysql_mcp_server
Where can I get mysql_mcp_server?
The source code and installation instructions are on GitHub: https://github.com/designcomputer/mysql_mcp_server

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects