MySQL MCP Server

Community
Databases
stdio

Enable AI agents to connect to MySQL databases for schema inspection, query execution, and data exploration. Community-maintained server supporting connection pooling and configurable access controls.

Quick Install

$ npx -y @benborla29/mcp-server-mysql

Environment Variables

VariableDescriptionRequired
MYSQL_HOSTMySQL server hostnameYes
MYSQL_USERDatabase usernameYes
MYSQL_PASSWORDDatabase passwordYes
MYSQL_DATABASEDatabase nameYes

In-Depth Setup Guide

Complete setup walkthrough & security best practices

Read Guide

Configuration by Client

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "",
        "MYSQL_DATABASE": "mydb"
      }
    }
  }
}

Need a different client? Use the Config Generator for Windsurf, Cline, Antigravity, and more.

Available Tools (1)

query

MySQL FAQ

What is the MySQL MCP server?

Enable AI agents to connect to MySQL databases for schema inspection, query execution, and data exploration. Community-maintained server supporting connection pooling and configurable access controls.

How do I install the MySQL MCP server?

Run: npx -y @benborla29/mcp-server-mysql

Which AI clients support the MySQL MCP server?

The MySQL MCP server works with Claude Desktop, Cursor, Codex CLI, Antigravity, Windsurf, and any MCP-compatible client using stdio transport.

What tools does the MySQL MCP server provide?

The server provides 1 tools: query.