MySQL MCP Server

Provides read-only access to MySQL databases.

Local serverstdio 69

What is the MySQL MCP server?

Provides read-only access to MySQL databases. That is what the mysql mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The tools it exposes

The server publishes 4 tools. What each one is for:

  • list_databases — The list_databases tool exposed by this server
  • list_tables — The list_tables tool exposed by this server
  • describe_table — The describe_table tool exposed by this server
  • execute_query — The execute_query tool exposed by this server

What it needs from you

Configuration is passed through the environment: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_CONNECTION_LIMIT, MYSQL_QUEUE_LIMIT, MYSQL_CONNECT_TIMEOUT. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

@smithery/cli on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

How it compares

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MySQL's toolset — list_databases, list_tables, describe_table and 1 more — is a fair guide to whether it matches your workflow. It is maintained by dpflucas; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
list_databasesThe list_databases tool exposed by this server.
list_tablesThe list_tables tool exposed by this server.
describe_tableThe describe_table tool exposed by this server.
execute_queryThe execute_query tool exposed by this server.

How to install the MySQL MCP server

If you built from source (Option 2):
```json
{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-mcp-server/build/index.js"],
      "env": {
        "MYSQL_HOST": "your-mysql-host",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your-mysql-user",
        "MYSQL_PASSWORD": "your-mysql-password",
        "MYSQL_DATABASE": "your-default-database"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
MYSQL_HOSTEndpoint or connection string the server talks to.Optional
MYSQL_PORTConfiguration value read at startup.Optional
MYSQL_USERConfiguration value read at startup.Optional
MYSQL_PASSWORDConfiguration value read at startup.Optional
MYSQL_DATABASEConfiguration value read at startup.Optional
MYSQL_CONNECTION_LIMITConfiguration value read at startup.Optional
MYSQL_QUEUE_LIMITConfiguration value read at startup.Optional
MYSQL_CONNECT_TIMEOUTConfiguration value read at startup.Optional

Example prompts to try

  • Use MySQL to list databases.
  • Use MySQL to list tables.
  • Use MySQL to describe table.

Frequently asked questions

Yes, the tool features a query timeout functionality. This prevents long-running queries from consuming excessive resources and potentially impacting database performance.