# MCP Server for MySQL

> Let Claude and other LLMs inspect MySQL schemas and run queries, read-only unless you opt in to writes.

## Facts
- **Category:** [MCP Servers](https://agentsearchengine.app/category/mcp-servers)
- **Type:** MCP server
- **Pricing:** Open source
- **GitHub stars:** 2,132
- **Language:** JavaScript
- **License:** MIT
- **Last repo activity:** 1 month ago (Jul 27, 2026)
- **Official site:** https://github.com/benborla/mcp-server-mysql
- **Source code:** https://github.com/benborla/mcp-server-mysql
- **Listing on Agent Search Engine:** https://agentsearchengine.app/agents/mcp-server-mysql
- **Data verified:** September 2026

## Best for
Letting an assistant explore and query a MySQL database safely, with writes off by default.

## About MCP Server for MySQL
This community MCP server gives AI assistants access to MySQL: schema inspection and queries, with write operations enabled only through environment flags. It supports SSH tunnels to remote databases, a multi-database mode, per-schema read/write permissions and automatic redaction of personal data, and is tuned for Claude Code.

## Connect to an MCP client
Launch command from the project's README: `MYSQL_HOST=127.0.0.1 MYSQL_PORT=3306 MYSQL_USER=<user> MYSQL_PASS=<password> MYSQL_DB=<database> npx -y @benborla29/mcp-server-mysql`

### Claude Code (Run in your terminal)

```shell
claude mcp add mcp-server-mysql -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e 'MYSQL_USER=<user>' -e 'MYSQL_PASS=<password>' -e 'MYSQL_DB=<database>' -- npx -y @benborla29/mcp-server-mysql
```

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

```json
{
  "mcpServers": {
    "mcp-server-mysql": {
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "<user>",
        "MYSQL_PASS": "<password>",
        "MYSQL_DB": "<database>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "mcp-server-mysql": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "<user>",
        "MYSQL_PASS": "<password>",
        "MYSQL_DB": "<database>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-server-mysql": {
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "<user>",
        "MYSQL_PASS": "<password>",
        "MYSQL_DB": "<database>"
      }
    }
  }
}
```

### Codex (~/.codex/config.toml)

```toml
[mcp_servers.mcp-server-mysql]
command = "npx"
args = ["-y", "@benborla29/mcp-server-mysql"]
env = { MYSQL_HOST = "127.0.0.1", MYSQL_PORT = "3306", MYSQL_USER = "<user>", MYSQL_PASS = "<password>", MYSQL_DB = "<database>" }
```

## Alternatives
MCP Server for MySQL sits in mcp servers. Related tools indexed here:
- [MCP Reference Servers](https://agentsearchengine.app/agents/mcp-reference-servers) — The MCP steering group's reference servers: Everything, Fetch, Filesystem, Git, Memory, Sequential Thinking and Time. · Open source · MCP server · 91k★ · TypeScript · MIT AND Apache-2.0 · active today
- [context7](https://agentsearchengine.app/agents/context7) — Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors · Open source · MCP server · 62k★ · TypeScript · MIT · active today
- [chrome-devtools-mcp](https://agentsearchengine.app/agents/chrome-devtools-mcp) — Chrome DevTools for coding agents · Open source · MCP server · 53k★ · TypeScript · Apache-2.0 · active today
- [Playwright MCP](https://agentsearchengine.app/agents/playwright-mcp) — Expose Playwright browser tools to MCP clients using accessibility snapshots. · Open source · MCP server · 37k★ · TypeScript · Apache-2.0 · active 4 days ago
- [github-mcp-server](https://agentsearchengine.app/agents/github-mcp-server) — GitHub's official MCP Server · Open source · MCP server · 33k★ · Go · MIT · active today
- [serena](https://agentsearchengine.app/agents/serena) — A powerful MCP toolkit for coding, providing semantic retrieval and editing capabilities - the IDE for your agent · Open source · SDK / library · 30k★ · Python · MIT · active today
- [MCP for Blender (blender-mcp)](https://agentsearchengine.app/agents/blender-mcp) — Connect Blender to Claude or any LLM client for prompt-driven 3D modelling and scene editing. · Open source · MCP server · 29k★ · Python · MIT · active 2 days ago
- [fastmcp](https://agentsearchengine.app/agents/fastmcp) — The fast, Pythonic way to build MCP servers and clients. · Open source · SDK / library · 28k★ · Python · Apache-2.0 · active today

---
Source: [Agent Search Engine](https://agentsearchengine.app) — an independent, hand-curated index of AI agents, MCP servers, and frameworks. Rankings are never sold; sponsored placements are labeled and never numbered. Full directory: https://agentsearchengine.app/llms-full.txt
