Skip to content
MCP server

MySQL (read-only, switchable)

Read-only MySQL access, with the database and server switchable mid-conversation.

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
1.1.6
Listing updated
4 days ago

About MySQL (read-only, switchable)

MySQL (read-only, switchable) is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

claude mcp add mcp-mysql-read-only --env MYSQL_PASSWORD='<MYSQL_PASSWORD>' --env MYSQL_PROFILES='<MYSQL_PROFILES>' -- npx -y @shibbirweb/mcp-mysql-read-only

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp-mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
        "MYSQL_PROFILES": "<MYSQL_PROFILES>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
        "MYSQL_PROFILES": "<MYSQL_PROFILES>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mcp-mysql-read-only": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
        "MYSQL_PROFILES": "<MYSQL_PROFILES>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "mcp-mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
        "MYSQL_PROFILES": "<MYSQL_PROFILES>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "mcp-mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_PASSWORD": "<MYSQL_PASSWORD>",
        "MYSQL_PROFILES": "<MYSQL_PROFILES>"
      }
    }
  }
}

Configuration

  • MYSQL_HOSTHostname of the MySQL server. Defaults to 127.0.0.1
  • MYSQL_PORTPort of the MySQL server. Defaults to 3306
  • MYSQL_USERMySQL user. Prefer an account holding only SELECT grants
  • MYSQL_PASSWORDPassword for MYSQL_USER. Empty when the account has none
  • MYSQL_DATABASEDatabase to open at startup. Can be changed later without restarting
  • MYSQL_PROFILESJSON object of named connections to switch between, keyed by profile name
  • MYSQL_DEFAULT_PROFILEWhich MYSQL_PROFILES entry to start on
  • MYSQL_CONNECT_TIMEOUT_MSConnection timeout in milliseconds. Defaults to 10000
  • MYSQL_QUERY_TIMEOUT_MSServer-side query timeout in milliseconds. Defaults to 30000
  • MYSQL_HOSTHostname of the MySQL server. Use host.docker.internal to reach the host
  • MYSQL_PORTPort of the MySQL server. Defaults to 3306
  • MYSQL_USERMySQL user. Prefer an account holding only SELECT grants
  • MYSQL_PASSWORDPassword for MYSQL_USER. Empty when the account has none
  • MYSQL_DATABASEDatabase to open at startup. Can be changed later without restarting
  • MYSQL_PROFILESJSON object of named connections to switch between, keyed by profile name
  • MYSQL_DEFAULT_PROFILEWhich MYSQL_PROFILES entry to start on
  • MYSQL_CONNECT_TIMEOUT_MSConnection timeout in milliseconds. Defaults to 10000
  • MYSQL_QUERY_TIMEOUT_MSServer-side query timeout in milliseconds. Defaults to 30000

Pricing

Open source

MySQL (read-only, switchable) FAQ

Is MySQL (read-only, switchable) free?

Yes. MySQL (read-only, switchable) is open source, so you can use and self-host it for free.

How do I add MySQL (read-only, switchable) to Claude Code?

Run this command in your terminal: claude mcp add mcp-mysql-read-only --env MYSQL_PASSWORD='<MYSQL_PASSWORD>' --env MYSQL_PROFILES='<MYSQL_PROFILES>' -- npx -y @shibbirweb/mcp-mysql-read-only

What are the best alternatives to MySQL (read-only, switchable)?

The closest alternatives to MySQL (read-only, switchable) are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

Alternatives to MySQL (read-only, switchable)

  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