MCPSERV.CLUB
benborla

MySQL MCP Server (Claude Code Edition)

MCP Server

Secure MySQL access via SSH tunnels for Claude

Active(75)
853stars
0views
Updated 12 days ago

About

A Model Context Protocol server that provides secure, SSH‑tunneled access to MySQL databases for Claude and other LLMs. It supports schema inspection, query execution, DDL operations, and multi‑project setups with auto tunnel management.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Overview

The MCP Server for MySQL is a specialized bridge that lets AI assistants such as Claude Code interact directly with MySQL databases. By exposing database schemas, tables, and query execution capabilities through the Model Context Protocol, it transforms a traditionally isolated data source into an interactive knowledge base that can be queried, inspected, and even modified in real time by a language model. This is especially valuable for developers who need to prototype data‑driven features, debug complex queries, or generate code that relies on live database structures—all without leaving their AI‑centric workflow.

At its core, the server offers secure SSH tunnel support, enabling connections to remote or cloud‑hosted MySQL instances that would otherwise be inaccessible from a local development environment. The tunnel is managed automatically in sync with Claude Code’s start and stop lifecycle, so developers can focus on writing queries rather than configuring networking. Additionally, the server includes a lightweight DDL extension () that permits operations even when the database is set to read‑only mode, giving developers a flexible sandbox for schema evolution.

Key capabilities include:

  • Schema introspection: The server exposes tables, columns, indexes, and foreign key relationships, allowing the AI to generate accurate SQL or ORM code snippets.
  • Query execution: Developers can run SELECT, INSERT, UPDATE, and DELETE statements directly from the AI interface, with fine‑grained control over which operations are permitted.
  • Multi‑project support: A single server instance can be configured to connect to multiple databases, each with its own credentials and permission set, making it ideal for environments that manage several micro‑services or staging/production pairs.
  • Automatic SSH tunneling: When a remote MySQL instance is behind a firewall, the server automatically establishes an SSH tunnel on start and tears it down on stop, ensuring secure, transient connectivity.

Real‑world use cases span from rapid prototyping—where a developer can ask the AI to “show me all users who signed up in the last 30 days”—to automated documentation generation, where schema metadata is rendered into markdown or diagrammatic form. In data‑driven applications, the server can serve as a live data source for LLM‑powered analytics dashboards or conversational agents that need to answer queries about inventory, sales, or user behavior. By integrating seamlessly with Claude Code’s CLI and IDE extensions, the MCP server lets developers maintain a single, consistent interface for both code generation and data manipulation, streamlining the entire development cycle.