# MySQL (read-only, switchable)

> MySQL (read-only, switchable) is an open-source MCP server for databases. Read-only MySQL access, with the database and server switchable mid-conversation. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/shibbirweb/mcp-mysql-read-only
- **MCP Registry name:** io.github.shibbirweb/mcp-mysql-read-only
- **Categories:** databases
- **Listing updated:** 2026-11-13

## About

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

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

```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>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## 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

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [PlatypusDB](https://ai-powered.com/mcp/platypusdb): PlatypusDB is an open-source MCP server for databases.
- [Lorebase](https://ai-powered.com/mcp/lorebase): Lorebase is an open-source MCP server for knowledge and memory.
- [Sovaria](https://ai-powered.com/mcp/sovaria): Sovaria is a freemium MCP server for databases.
- [model2data studio](https://ai-powered.com/mcp/model2data-studio): model2data studio is a freemium MCP server for databases.
- [semlayer](https://ai-powered.com/mcp/semlayer): semlayer is a free MCP server for databases.
- [bricksentry](https://ai-powered.com/mcp/bricksentry): bricksentry is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/mysql-read-only-switchable
