MCP Server MySQL

MCP Server for MySQL databases
  • javascript

10

GitHub Stars

javascript

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

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

You can use this MCP (Model Context Protocol) server to give your LLMs read‑only access to a MySQL database. It lets you inspect schemas and run safe, read‑only queries, making it suitable for data exploration and question answering without risking data modification.

How to use

To use the MySQL MCP Server with an MCP client, run the server locally or in your environment and point your client to the provided command configuration. The server exposes a read‑only interface to your MySQL database, enabling schema inspection and safe query execution within READ ONLY transactions.

A practical way to connect via a local client is to configure your MCP client to invoke the Docker image as shown in the example configuration. This keeps the database access isolated and ensures all queries run in a read‑only context.

How to install

Prerequisites you need before installation:

  • Docker installed and running on your system

  • Node.js and npm installed if you plan to use npm/npx based installation flows

Installation flow using Docker (recommended for quick start):

# Build the Docker image
make docker

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

Additional configuration and usage notes

The server is designed for read‑only access to protect your data. All queries are executed within READ ONLY transactions. If you can, create a dedicated read‑only user in your MySQL instance for added security.

If you plan to integrate with Claude Desktop or similar clients, you can configure the MCP server entry in your client config. The following snippet demonstrates how to wire the Docker‑based server into your client configuration.

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

Available tools

inspectSchema

Inspect and expose the database schema to the MCP client, enabling discovery of tables, columns, and data types.

readOnlyQuery

Execute read‑only queries within a safe READ ONLY transaction to prevent data modification.

dockerSupport

Docker integration to run the MCP server image locally and reliably isolate database access.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational