MySQL MCP Server

MCP server that provides direct access to MySQL databases

Local serverstdio

What is the MySQL MCP Server?

MCP server that provides direct access to MySQL databases

What it actually does

A powerful MCP server that provides direct access to MySQL databases. This server enables AI agents to interact with MySQL databases, execute SQL queries, and manage database content through a simple interface.

Configuration

  • Node.js 18 or higher - MySQL server installed and running - A database with appropriate permissions

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
create_noteCreate new text notes in the database
list_tablesList all tables in the connected database
count_tablesGet the total number of tables in the database
search_tablesSearch for tables using LIKE pattern
describe_tableGet the structure of a specific table
execute_sqlExecute custom SQL queries

How to install the MySQL MCP Server

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": [
        "/path/to/mysql-server/build/index.js"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "YOUR_MYSQL_PASSWORD",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Node.js 18 or higher - MySQL server installed and running - A database with appropriate permissions
VariableDescriptionRequired
MYSQL_HOSTDeclared in the maintainer’s client configuration.Check documentation
MYSQL_USERDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
MYSQL_DATABASEDeclared in the maintainer’s client configuration.Check documentation

Example prompts to try

  • “Use MySQL to create note.”
  • “Use MySQL to list tables.”
  • “Use MySQL to count tables.”

Frequently asked questions

You need Node.js 18 or higher, a running MySQL server, and a database with appropriate permissions.