MySQL MCP Server

Databasestdiov2.0.0
Repository

MCP server for MySQL and MariaDB that lets AI agents inspect schemas, list tables, and run parameterized SQL queries. Supports read-only or read-write modes so agents can explore data, debug, and prototype against a MySQL database with controlled access.

Connect

Add this configuration to .claude/mcp.json

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<YOUR_MYSQL_HOST>",
        "MYSQL_USER": "<YOUR_MYSQL_USER>",
        "MYSQL_PASS": "<YOUR_MYSQL_PASS>",
        "MYSQL_DB": "<YOUR_MYSQL_DB>"
      }
    }
  }
}

Tools (3)

run_query

Execute a SQL query against the configured MySQL database.

{
  "type": "object",
  "required": [
    "sql"
  ],
  "properties": {
    "sql": {
      "type": "string",
      "description": "SQL statement to execute"
    }
  }
}

list_tables

List tables in the current database.

{
  "type": "object",
  "properties": {
    "database": {
      "type": "string",
      "description": "Optional database name to scope results"
    }
  }
}

describe_table

Return the column definitions for a table.

{
  "type": "object",
  "required": [
    "table"
  ],
  "properties": {
    "table": {
      "type": "string",
      "description": "Table name"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
Benborla (@benborla)
Repository
https://github.com/benborla/mcp-server-mysql
License
MIT
Version
2.0.0
Stars
980
Last Updated
June 24, 2026
MySQL MCP Server - MCP Server | OpenModels