MySQL MCP Server

MySQL MCP server project

Local serverstdio

What is the MySQL MCP Server?

MySQL MCP server project

What the server does

This is a Model Context Protocol (MCP) server that provides access to a MySQL database. It allows agent to execute SQL queries against a MySQL database.

  • Execute SQL queries against a MySQL database:
  • Read data (SELECT statements)
  • Create tables (CREATE TABLE statements)
  • Insert data (INSERT INTO statements)
  • Update data (UPDATE statements)
  • Delete data (DELETE FROM statements)

Credentials and setup notes

  • Node.js (v14 or higher) - MySQL server - MCP SDK

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
run_sql_query
create_table
insert_data
update_data
delete_data

How to install the MySQL MCP Server

{
  "mcpServers": {
    "mysql-mcp-server": {
      "autoApprove": [],
      "disabled": false,
      "timeout": 60,
      "command": "node",
      "args": [
        "/path/to/mysql-mcp-server/build/index.js"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "mcp101",
        "MYSQL_PASSWORD": "YOUR_MYSQL_PASSWORD",
        "MYSQL_DATABASE": "mcpdb"
      },
      "transportType": "stdio"
    }
  }
}

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

Configuration

  • Node.js (v14 or higher) - MySQL server - MCP SDK
VariableDescriptionRequired
MYSQL_HOSTDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PORTDeclared 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 run sql query.”
  • “Use MySQL to create table.”
  • “Use MySQL to insert data.”

Frequently asked questions

It is an MCP server that allows AI agents to execute SQL queries against a MySQL database, supporting SELECT, CREATE, INSERT, UPDATE, and DELETE operations.