Mysql MCP Server logo

Mysql MCP Server

by designcomputer

Connects AI clients to MySQL for SQL execution, schema inspection, table sampling, and guided database exploration.

Install Mysql MCP Server

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "designcomputer-mysql-mcp-server": {
      "command": "uvx",
      "args": [
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_HOST": "YOUR_VALUE_HERE",
        "MYSQL_USER": "YOUR_VALUE_HERE",
        "MYSQL_PASSWORD": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

uvx mysql_mcp_server

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

designcomputer/mysql_mcp_server connects MCP-compatible AI clients to MySQL through configurable STDIO or Streamable HTTP transports. It exposes SQL execution, schema metadata, table sampling, database resources, and guided prompts for exploring databases and analyzing tables. Use it when an agent needs structured access to MySQL data, including optional multi-database access or SSH-tunneled connections. Credentials and connection behavior are configured with environment variables.

Use cases

  • Explore available MySQL tables and databases
  • Inspect schemas before writing queries
  • Sample table data for structure discovery
  • Run read or write SQL through an MCP client
  • Analyze MySQL databases through an SSH jump host

Key features

  • Execute standard SQL and DML statements
  • Inspect columns, types, defaults, and comments
  • Preview up to 20 rows from a table
  • Support single-database and multi-database modes
  • Run over STDIO or Streamable HTTP/SSE
  • Connect through optional SSH tunneling

Tools3

What Mysql MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~42 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

61/61 checks healthy over the last 98d

Supply-chain signal

1 high-severity advisory on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 1High 0Medium 0Low 3

Scanned 11d ago via OSV.dev · mysql_mcp_server (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1.4kStargazers on the source repository.
Last commit18d agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Tools exposed3Callable tools this server registers over MCP.
Directory activity1 upvotesConfig copies, upvotes, and views on AllMCPs.

How Mysql MCP Server works

What designcomputer/mysql_mcp_server does

designcomputer/mysql_mcp_server gives MCP clients a controlled interface to MySQL databases. Agents can run SQL, inspect database structure, preview table contents, and enumerate available tables through MCP resources. The server is suitable for database exploration, analysis, and operations that require standard SQL, including SELECT, SHOW, DESCRIBE, INSERT, UPDATE, and DELETE statements.

Two guided MCP prompts provide higher-level workflows. explore_database discovers tables, examines their schemas, samples data, and produces a summary. analyze_table performs a similar focused workflow for one table and can accept a qualified database.table name.

How it works

The server connects to MySQL using connection details supplied through environment variables. It can run over STDIO for local MCP host integrations or over Streamable HTTP/SSE for hosted and remote deployments. The optional SSH tunneling configuration lets the server reach a MySQL instance through a jump host.

Set MYSQL_DATABASE to work primarily within one database. If it is omitted, multi-database mode exposes user databases while filtering system databases. In that mode, queries and tool arguments can use fully qualified names such as sales.orders. Each SQL request must contain one statement; sequences such as USE sales; SELECT ... are not supported.

Setup and configuration

Install the package from PyPI with pip install mysql-mcp-server, then launch the mysql_mcp_server entry point through an MCP client or a compatible runner such as uvx. Claude Desktop, Claude Code, and Visual Studio Code examples use STDIO configuration. A .env file can be loaded from the process working directory or its parent directories when the server is launched locally.

Provide MYSQL_HOST, MYSQL_USER, and MYSQL_PASSWORD for the database connection. MYSQL_PORT defaults to 3306, while MYSQL_DATABASE is optional. Additional settings control TLS mode, connection timeout, SQL mode, character encoding, authentication plugin, warning behavior, and the transport. For HTTP/SSE deployments, configure the listener host, port, and allowed Host headers. SSH tunneling requires the jump-host, key, remote-host, and local-port settings.

When Claude Desktop or Claude Code launches the process from its own working directory, place the MYSQL_* values in the client's MCP environment block rather than relying on a project-local .env file.

Tools and capabilities

  • execute_sql accepts a SQL string and returns the query result with error handling. Data-changing statements are marked with a destructive hint.
  • get_schema_info reports column names, types, nullability, defaults, and comments for a selected table or the configured database context.
  • get_table_sample returns a small data preview, with a maximum limit of 20 rows.
  • Resource listing exposes available MySQL tables or user databases, depending on the configured mode.
  • Qualified names support cross-database schema inspection and sampling. Table and database identifiers are restricted to alphanumeric characters, underscores, dollar signs, and an optional dot separator.
  • The explore_database and analyze_table prompts coordinate schema inspection and sampling for repeatable investigation workflows.

Limitations and notes

SQL execution supports only one statement per request. Sampling is intentionally limited to 20 rows, and identifier validation applies to schema and table tool arguments. HTTP/SSE deployments should configure an appropriate bind host and allowed Host headers. The server is intended to run through an MCP host or inspector rather than as a standalone Python script.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mysql MCP Server

designcomputer/mysql_mcp_server is an MCP server that connects AI clients to MySQL databases through STDIO or Streamable HTTP. Its main tools execute SQL, inspect schema metadata, and sample table data, with support for multi-database queries, guided exploration prompts, and optional SSH tunneling.

Install it from PyPI with `pip install mysql-mcp-server`, then launch the `mysql_mcp_server` command through an MCP client or runner such as `uvx`. Claude Code and Visual Studio Code configuration examples use STDIO transport.

Set `MYSQL_HOST`, `MYSQL_USER`, and `MYSQL_PASSWORD` as environment variables, with `MYSQL_PORT` optional and defaulting to 3306. You may also set `MYSQL_DATABASE`; client-launched processes should receive these values in their MCP environment configuration.

Yes. Omit `MYSQL_DATABASE` to enable multi-database mode, then use qualified names such as `database.table` in SQL and table-oriented tools. Resource listing filters out system databases, and each SQL request must contain only one statement.

Yes. Enable SSH tunneling with `MYSQL_SSH_ENABLE=true` and configure the jump host, SSH credentials, remote MySQL endpoint, and local port through the related `MYSQL_SSH_*` and `MYSQL_LOCAL_PORT` variables.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMysql MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/designcomputer-mysql-mcp-server?style=directory)](https://allmcps.com/mcp/designcomputer-mysql-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/designcomputer-mysql-mcp-server"><img src="https://allmcps.com/api/badge/designcomputer-mysql-mcp-server?style=directory" alt="Mysql MCP Server on AllMCPs" /></a>