Skip to content
MCP server

Mysql

MySQL statements and transactions over MCP

Install
Pricing
Open source
Runs
Remotely
Version
0.4.1
Listing updated
4 days ago

About Mysql

Mysql is an open-source MCP server for databases. It runs as a hosted remote server, so there is nothing to install locally.

Install

Run in a terminal

claude mcp add mysql --env DATABASE_URL='<DATABASE_URL>' -- docker run -i --rm -e DATABASE_URL ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mysql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mysql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mysql": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mysql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mysql": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}

Configuration

  • DATABASE_URLSQLAlchemy mysql+pymysql URL for one existing MySQL 8.4 database.Required
  • CLOUD_SQL_INSTANCEOptional Cloud SQL project:region:instance; connects through its private IP.

Pricing

Open source

Mysql FAQ

Is Mysql free?

Yes. Mysql is open source, so you can use and self-host it for free.

How do I add Mysql to Claude Code?

Run this command in your terminal: claude mcp add mysql --env DATABASE_URL='<DATABASE_URL>' -- docker run -i --rm -e DATABASE_URL ghcr.io/hughhan1/mysql@sha256:858da81df0d25bba99f485ae663208f2255b2278be711924f9b08032398e7093

What are the best alternatives to Mysql?

The closest alternatives to Mysql are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

Alternatives to Mysql

  1. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  2. PlatypusDB

    MCP server

    Gives MCP clients access to your PlatypusDB database connections, scoped per agent

    Runs locally
    • Open source
    • Databases
  3. Lorebase

    MCP server

    Lets agents read and change a governed, versioned Postgres knowledge graph

    Runs locally
    • Open source
    • Knowledge and memory
  4. Sovaria

    MCP server

    Manage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant

    Not checked yet
    • 4 tools
    • Remote
    • Freemium
    • Databases
  5. Generate realistic connected test data, dbt projects and dashboards from a schema

    • Remote
    • Freemium
    • Databases
  6. semlayer

    MCP server

    Infers a semantic layer from your data warehouse and serves it to agents

    Runs locally
    • Free
    • Databases