MCP ConfigsMay 12, 2026·2 min read

mcp-server-mysql — Read-Only MySQL MCP for Claude Code

mcp-server-mysql is an MCP server for Claude Code that connects to MySQL (optionally via SSH tunnels) so agents can inspect schemas and run read-only SQL.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Needs Confirmation · 62/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Mcp
Install
Manual
Trust
Trust: Established
Entrypoint
claude mcp add mcp_server_mysql -- npx @benborla29/mcp-server-mysql
Universal CLI install command
npx tokrepo install 2c4d8def-3374-5876-87e9-73d83580f5f8
Intro

Connect Claude Code to a MySQL database with explicit read-only guards and optional SSH tunnel automation, so queries are auditable and repeatable.

Best for: Database exploration, troubleshooting, and schema QA where you want an agent to run SQL without write access

Works with: Claude Code (or any MCP client); MySQL; optional SSH tunnels for remote DBs

Setup time: 5–10 minutes

Key facts (verified)

  • README shows a Claude Code config with ALLOW_*_OPERATION=false toggles for read-only safety.
  • Supports SSH tunnel workflows and auto start/stop hooks (per README).
  • Uses npx @benborla29/mcp-server-mysql as the standard stdio entrypoint for Claude Code (per README).
  • GitHub: 1,638 stars · 206 forks; pushed 2026-03-10 (GitHub API verified).

Main

A safe pattern for “agent queries” is:

  1. Keep the MCP server read-only (leave ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, ALLOW_DELETE_OPERATION set to false).
  2. Ask the agent to describe intent before executing (e.g., “I will run a SELECT ... LIMIT 50 to validate hypothesis X”).
  3. Use the agent for schema discovery first (tables, columns, indexes) before any large query.
  4. When connecting to a remote DB, use the README’s SSH tunnel support and keep credentials out of version control (prefer env prompts / local secret stores).

If you later need writes (migrations, backfills), flip write flags only for a time-bounded session and keep a human in the loop.

FAQ

Q: Is it read-only? A: By default, yes. The README config shows write operations gated by ALLOW_*_OPERATION env flags.

Q: Can it connect to a remote DB? A: Yes. The README highlights SSH tunnel support for remote MySQL.

Q: How do I verify it’s working in Claude Code? A: Use claude mcp list and then try a small schema query (e.g., list tables) before larger SQL.

🙏

Source & Thanks

Source: https://github.com/benborla/mcp-server-mysql > License: MIT > GitHub stars: 1,638 · forks: 206

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets