← Back to directory
M

MySQL MCP Server

Community
Manage and query MySQL databases through an AI assistant.
Category
Database #79 of 86
Stars
★ 83 Popular
Transport
Streamable HTTP
Runtime
Node.js 18+
Credentials
API key / credential required
Last commit
⚠
Tools
8
41FMRS · D

The README describes connection management, SQL execution, and database inspection tools, and provides a StreamableHTTP configuration example. The manifest was not cached, and the source metadata lists the license as unknown; the README claims Apache 2.0, so the license status needs verification.

Strongest · Setup experience 11/20 Weakest · Maintenance 4/20

Reliability
8/20
Security and permissions
7/20
Maintenance
4/20
Documentation
11/20
Setup experience
11/20
Why each score
Reliability 8/20
The README describes StreamableHTTP, connection management, query tools, runtime requirements, and troubleshooting, making a basic run path plausible. However, no manifest, source, CI, or test evidence is provided to verify initialization, tool behavior, error handling, or connection-pool claims. The v4.0.5 date in the version history is also later than the date shown for this review material, so the score reflects limited static evidence.
Security and permissions 7/20
The README recommends preconfigured headers, HTTPS, IP restrictions, and least-privilege database users, and says credentials are supplied by the AI when adding a connection dynamically. There is no source or data-flow evidence to verify credential storage, HTTP access controls, query restrictions, or session isolation. execute_query is described as supporting any SQL operation, with no evidence of confirmation for dangerous operations. No red-line behavior is shown, but the permission boundaries are insufficiently evidenced.
Maintenance 4/20
The material lists version history, GitHub Issues and Discussions, and a contact email; repository metadata says it is not archived and has open issues. There is no verifiable evidence of recent commits, issue responses, dependency updates, or a security response process. The supplied metadata says the license is unknown while the README claims Apache 2.0, and the license file itself is unavailable for confirmation, so maintenance and governance evidence is limited.
Documentation 11/20
The README provides installation steps, client configuration examples, tool names and purposes, permission guidance, environment variables, and troubleshooting. Tool parameters, response formats, query limits, transaction and rollback support, costs, and security data flows are not adequately documented. The project description mentions transaction management and smart rollback, but the v4 tool list does not show corresponding tools, leaving a capability inconsistency.
Setup experience 11/20
The README specifies Node.js 18+, MySQL 5.7+/8.0+, dependency installation, build and start steps, and a StreamableHTTP configuration example for a mainstream client. Users must still prepare and run the server and database and supply credentials. No verifiable container setup, automated installation, CI, or tests are provided, and the actual startup configuration cannot be confirmed from source.

Static review · not runReviewed 2026-11-30

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkConnects to a database

Best for

  • Developers and teams that need to inspect or operate MySQL through an MCP client.
  • Use cases that require managing multiple MySQL connections.

Not for

  • Users who need support for database systems other than MySQL.
  • Scenarios requiring enforced read-only access; the tools support writes and deletes.

Required permissions

  • Requires access to the configured MySQL host, port, user, password, and database.
  • The database permissions required depend on the configured account's grants; the README recommends a dedicated MCP user with limited permissions.
  • Adding a connection dynamically requires supplying its database connection details.

Risks and side effects

  • execute_query supports write operations such as INSERT, UPDATE, and DELETE, so incorrect or inappropriate SQL can modify or remove data.
  • Dynamically adding a connection supplies credentials in conversation; the README recommends preconfiguring headers to avoid exposing credentials to the AI.
  • For HTTP deployment, consider HTTPS, IP access restrictions, and log monitoring. The README says sessions are stored in memory and are lost when the server restarts.

Setup

Before you start

Runtime:Node.js 18+

Other optional settings (2)
PORT optional Optional; sets the HTTP server port. The documentation uses 3001 by default.
NODE_ENV optional Optional; sets the Node.js runtime environment. The production example uses production.

Requires Node.js 18+, MySQL 5.7+ or 8.0+, and an MCP client. Clone the repository, install npm dependencies, build, and start the server; the README example uses http://localhost:3001/mcp. Replace the example database credentials with actual values and add the configuration to the MCP client config file. Alternatively, omit preconfigured headers and let the AI add connections with add_connection.

claude_desktop_config.json
{
  "mcpServers": {
    "mysql-mcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "timeout": 600,
      "headers": {
        "X-MySQL-Host": "localhost",
        "X-MySQL-Port": "3306",
        "X-MySQL-User": "root",
        "X-MySQL-Password": "your_password",
        "X-MySQL-Database": "your_database"
      }
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "mysql-mcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "timeout": 600,
      "headers": {
        "X-MySQL-Host": "localhost",
        "X-MySQL-Port": "3306",
        "X-MySQL-User": "root",
        "X-MySQL-Password": "your_password",
        "X-MySQL-Database": "your_database"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.mysql-mcp]
url = "http://localhost:3001/mcp"
http_headers = { X-MySQL-Host = "localhost", X-MySQL-Port = "3306", X-MySQL-User = "root", X-MySQL-Password = "your_password", X-MySQL-Database = "your_database" }

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add --transport http mysql-mcp http://localhost:3001/mcp --header 'X-MySQL-Host: localhost' --header 'X-MySQL-Port: 3306' --header 'X-MySQL-User: root' --header 'X-MySQL-Password: your_password' --header 'X-MySQL-Database: your_database'

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm show_tables and execute_query appear in the client's tool list. Call show_tables; a returned table list confirms the server is connected and can access the database.

Troubleshooting

  1. For connection failures, check that MySQL is running and verify the host, port, username, password, and firewall settings.
  2. If the port is occupied, check or change the PORT setting.
  3. For Session not found, reinitialize or refresh the MCP client.
  4. For closed connection errors, the README suggests restarting the server and says v4.0.5+ uses a connection pool, keep-alive, and automatic reconnection.

Things to try

Once connected, you can ask your AI assistant things like:

  • Show all tables in the current database.
  • Describe the users table.
  • Query the first 10 rows from the users table.
  • List the database connections and switch to the test database.

Tools 8

add_connection writes
Add a database connection.
list_connections read-only
List current database connections.
select_database writes
Select the active database connection.
remove_connection destructive
Remove a database connection.
execute_query writes
Execute SQL queries or operations, including SELECT, INSERT, UPDATE, and DELETE.
show_tables read-only
Show tables in the current database.
describe_table read-only
Inspect a table's structure, field types, and sample data.
show_databases read-only
Show accessible databases.

Use cases

Inspect databases, tables, and table structures.
Run SQL queries and data insertion, update, or deletion operations.
Manage multiple database connections and switch between them.

Supported clients

Claude Desktop
CursorPartial support

Listed from the project's documentation, not tested by this site.

Overview

MySQL MCP Server is an MCP server using StreamableHTTP. It lets AI assistants inspect database structure, execute SQL, and manage multiple database connections. The README describes use with MCP clients including Claude Desktop and Cursor.

Similar servers

Source revision e585363a7194 Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/mysql-mcp.svg)](https://followmcp.com/en/servers/mysql-mcp)