Skip to content
Back to search

mcp-server-mysql

A Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/benborla--mcp-server-mysql/badge.svg)](/listings/benborla--mcp-server-mysql)

HTML

<a href="/listings/benborla--mcp-server-mysql"><img src="/api/listings/benborla--mcp-server-mysql/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**Claude Code (simplest):**

claude mcp add mcp_server_mysql \
  -e MYSQL_HOST="127.0.0.1" \
  -e MYSQL_PORT="3306" \
  -e MYSQL_USER="root" \
  -e MYSQL_PASS="your_password" \
  -e MYSQL_DB="your_database" \
  -- npx @benborla29/mcp-server-mysql

**Claude Desktop / other clients:**

{
  "mcpServers": {
    "mcp_server_mysql": {
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "your_password",
        "MYSQL_DB": "your_database"
      }
    }
  }
}

All write operations are disabled by default. Enable with `ALLOW_INSERT_OPERATION=true`, `ALLOW_UPDATE_OPERATION=true`, `ALLOW_DELETE_OPERATION=true`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 103 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Server for MySQL
  2. [![MCP Toplist](https://mcptoplist.com/badge/glama%2Fbenborla%2Fmcp-server-mysql.svg)](https://mcptoplist.com/server/glama%2Fbenborla%2Fmcp-server-mysql)
  3. [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/benborla/mcp-server-mysql)](https://archestra.ai/mcp-catalog/benborla__mcp-server-mysql)
  4. ## Sponsor — Bloome
  5. [![Bloome](assets/bloome.png)](https://bloome.im/login?ref=2x7GfeSw)
  6. Using mcp-server-mysql to let your AI query MySQL? [**Bloome**](https://bloome.im/login?ref=2x7GfeSw) brings that to your whole team — an AI-agent IM platform where AI agents are members of the chat. Connect your MCP tools and have agents inspect schemas, run queries, and answer data questions for everyone in one thread. Zero local setup, runs in the cloud, on web and mobile.
  7. ---
  8. MCP server that gives Claude and other LLMs access to MySQL — inspect schemas, run queries, and optionally write data, all through the Model Context Protocol.
  9. ## Key Features
  10. - **Read-only by default** — write operations opt-in via env flags
  11. - **Claude Code integration** — optimized for Anthropic's Claude Code CLI
  12. - **SSH tunnel support** — built-in support for remote databases
  13. - **Multi-DB mode** — query across multiple databases without reconnecting
  14. - **Schema-specific permissions** — per-database read/write control
  15. - **PII redaction** — automatic masking of sensitive data in results
  16. - **Remote mode** — HTTP transport with bearer token auth
  17. - **SSL/TLS support** — encrypted connections with mTLS option
  18. ## Requirements
  19. - Node.js v20+
  20. - MySQL 5.7+ (8.0+ recommended)
  21. - MySQL user with appropriate privileges
  22. ## Quick Install
  23. **Claude Code (simplest):**
  24. ```bash
  25. claude mcp add mcp_server_mysql \
  26. -e MYSQL_HOST="127.0.0.1" \
  27. -e MYSQL_PORT="3306" \
  28. -e MYSQL_USER="root" \
  29. -e MYSQL_PASS="your_password" \
  30. -e MYSQL_DB="your_database" \
  31. -- npx @benborla29/mcp-server-mysql
  32. ```
  33. **Claude Desktop / other clients:**
  34. ```json
  35. {
  36. "mcpServers": {
  37. "mcp_server_mysql": {
  38. "command": "npx",
  39. "args": ["-y", "@benborla29/mcp-server-mysql"],
  40. "env": {
  41. "MYSQL_HOST": "127.0.0.1",
  42. "MYSQL_PORT": "3306",
  43. "MYSQL_USER": "root",
  44. "MYSQL_PASS": "your_password",
  45. "MYSQL_DB": "your_database"
  46. }
  47. }
  48. }
  49. }
  50. ```
  51. All write operations are disabled by default. Enable with `ALLOW_INSERT_OPERATION=true`, `ALLOW_UPDATE_OPERATION=true`, `ALLOW_DELETE_OPERATION=true`.
  52. ## Documentation
  53. - [Installation Guide](docs/INSTALLATION.md) — Smithery, Cursor, Codex, Claude Code, local repo, remote mode
  54. - [Configuration & Environment Variables](docs/CONFIGURATION.md) — all env vars, advanced config
  55. - [Multi-DB Mode](README-MULTI-DB.md) — querying multiple databases
  56. - [PII Redaction](docs/PII-REDACTION.md) — automatic data masking
  57. - [Testing](docs/TESTING.md) — test setup and running
  58. - [Troubleshooting](docs/TROUBLESHOOTING.md) — common issues and fixes
  59. - [Changelog](CHANGELOG.md)
  60. ## Tools & Resources
  61. **Tool: `mysql_query`**
  62. Execute SQL queries. Read-only by default. Write operations enabled per flag.
  63. **Resources: `mysql://tables`**
  64. Lists all tables and column metadata for the connected database.
  65. ## Contributing
  66. PRs welcome at [github.com/benborla/mcp-server-mysql](https://github.com/benborla/mcp-server-mysql).
  67. ```bash
  68. git clone https://github.com/benborla/mcp-server-mysql.git
  69. pnpm install
  70. pnpm run build
  71. pnpm test
  72. ```
  73. [![Contributors](https://contrib.rocks/image?repo=benborla/mcp-server-mysql)](https://github.com/benborla/mcp-server-mysql/graphs/contributors)
  74. ## License
  75. MIT — see [LICENSE](LICENSE) for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.