Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-server-mysql

MCP.Pizza Chef: yuru-sha

mcp-server-mysql is an MCP server that provides read-only access to MySQL databases, allowing LLMs to inspect database schemas and execute safe, read-only queries. It supports schema inspection, safe query execution within read-only transactions, and is available as a Docker image and NPM package for easy integration.

Use This MCP server To

Inspect MySQL database schemas for structure and metadata Execute read-only SQL queries safely on MySQL databases Integrate MySQL data access into LLM-powered applications Enable LLMs to query MySQL databases without write risks Use Docker to deploy MySQL MCP server in containerized environments Automate data retrieval from MySQL for AI workflows

README

mcp-server-mysql

CI Status smithery badge

Model Context Protocol Server for MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

Features

  • Read-only access to MySQL databases
  • Schema inspection capabilities
  • Safe query execution within READ ONLY transactions
  • Docker support
  • NPM package available

Installation

Using Docker

# Build the Docker image
make docker

# Run with Docker
docker run -i --rm mcp/mysql mysql://host:port/dbname

Installing via Smithery

To install MySQL Database Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @yuru-sha/mcp-server-mysql --client claude

Usage

With Claude Desktop

Add the following configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "mysql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/mysql",
        "mysql://host:port/dbname"
      ]
    }
  }
}

Note: When using Docker on macOS, use host.docker.internal if the MySQL server is running on the host network.

Connection URL Format

mysql://[user][:password]@host[:port]/database

Replace /database with your database name.

Development

# Initial setup
make setup

# Build the project
make build

# Format code
make format

# Run linter
make lint

License

This project is released under the MIT License.

Security

This server enforces read-only access to protect your database. All queries are executed within READ ONLY transactions.

For enhanced security, we recommend creating a read-only user.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

mcp-server-mysql FAQ

How does mcp-server-mysql ensure database safety?
It runs all queries within read-only transactions to prevent data modification.
Can I use mcp-server-mysql with Docker?
Yes, it provides a Docker image for easy deployment and containerized use.
Is schema inspection supported?
Yes, the server allows LLMs to inspect MySQL database schemas for metadata and structure.
How do I install mcp-server-mysql?
You can install it via Docker, NPM package, or through Smithery CLI for Claude Desktop integration.
Does mcp-server-mysql support write operations?
No, it only supports read-only queries to ensure data integrity.
Can this server be integrated with multiple LLM providers?
Yes, it is designed to work with various LLMs like OpenAI, Claude, and Gemini.
What kind of MySQL versions are supported?
It supports standard MySQL databases compatible with typical read-only query operations.
Is there continuous integration for this project?
Yes, the GitHub repository includes CI workflows to ensure code quality and reliability.