Server profile

MCP Server for MySQL

MCP Server for MySQL lets Claude and other AI clients inspect schemas and execute SQL. It defaults to read-only access, with optional write flags, SSH tunneling, multi-database support, and result redaction.

Server facts

MCP Server for MySQL

Project

Author
benborla
License
MIT
Category
Databases

Tech

Runtime / language
node
Transports
stdio
Remote available
No
Authentication
Not specified

Activity

GitHub stars
2,166
Last commit
Data as of

Tags

  • Database Security
  • Mysql
  • Read Only
  • Schema Inspection
  • Sql

Overview

MCP Server for MySQL connects Claude and other language-model clients to MySQL databases for schema inspection and SQL execution. Its named query tool runs SQL, while a separate resource presents table and column metadata. Read-only behavior is the default: insert, update, and delete operations each require an explicit environment flag. This gives the integration a clearer separation between exploratory database access and workflows that modify records. The README also highlights per-database permissions and multi-database operation without reconnecting, which are useful when a single assistant needs to work across more than one schema.

The documented feature set includes built-in SSH tunneling for remote databases, automatic masking of sensitive result data, and encrypted database connections with an optional mutual-TLS setup. A remote HTTP mode with bearer authentication is listed, while the quick-start client examples launch the npm package locally. Those examples supply host, port, username, password, and database through environment variables. Requirements are Node.js 20 or newer and MySQL 5.7 or newer, with MySQL 8.0 or newer recommended. A database user must have privileges appropriate to the intended operations. Detailed remote deployment, redaction behavior, and advanced configuration are delegated to linked documentation rather than fully described in the supplied README. Users can therefore start with the documented read-only local configuration before deliberately enabling broader permissions.

Install & configure

Requirements

  • Node.js 20 or newer
  • MySQL 5.7 or newer; 8.0 or newer recommended
  • A MySQL account with suitable privileges
  • An MCP-compatible client
Documented launch / install command
npx -y @benborla29/mcp-server-mysql

The local quick-start remains read-only unless write flags are enabled. ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, and ALLOW_DELETE_OPERATION opt into the corresponding writes. HTTP remote mode is listed but its setup is delegated to other documentation.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "mcp-server-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<MySQL server hostname or address>",
        "MYSQL_PORT": "<MySQL server port>",
        "MYSQL_USER": "<MySQL username with appropriate privileges>",
        "MYSQL_PASS": "<MySQL user password>",
        "MYSQL_DB": "<Target database name>"
      }
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "mcp-server-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<MySQL server hostname or address>",
        "MYSQL_PORT": "<MySQL server port>",
        "MYSQL_USER": "<MySQL username with appropriate privileges>",
        "MYSQL_PASS": "<MySQL user password>",
        "MYSQL_DB": "<Target database name>"
      }
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "mcp-server-mysql": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<MySQL server hostname or address>",
        "MYSQL_PORT": "<MySQL server port>",
        "MYSQL_USER": "<MySQL username with appropriate privileges>",
        "MYSQL_PASS": "<MySQL user password>",
        "MYSQL_DB": "<Target database name>"
      }
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "mcp-server-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<MySQL server hostname or address>",
        "MYSQL_PORT": "<MySQL server port>",
        "MYSQL_USER": "<MySQL username with appropriate privileges>",
        "MYSQL_PASS": "<MySQL user password>",
        "MYSQL_DB": "<Target database name>"
      }
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "mcp-server-mysql": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@benborla29/mcp-server-mysql"
      ],
      "env": {
        "MYSQL_HOST": "<MySQL server hostname or address>",
        "MYSQL_PORT": "<MySQL server port>",
        "MYSQL_USER": "<MySQL username with appropriate privileges>",
        "MYSQL_PASS": "<MySQL user password>",
        "MYSQL_DB": "<Target database name>"
      }
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
mysql_queryExecute SQL with read-only defaults and individually enabled write operations.

Names, permissions, and defaults can change. Check the current upstream documentation before granting access.

Use cases

  • Inspect table and column metadata from an AI client.
  • Run read-only SQL for database exploration.
  • Enable selected data modifications through explicit operation flags.
  • Query multiple databases or reach a remote database through SSH.

Strengths

  • Keeps write operations disabled by default.
  • Documents schema-specific permissions and automatic PII masking.
  • Supports SSH tunneling and SSL/TLS with an mTLS option.

Limitations

  • Requires Node.js 20 or newer and MySQL 5.7 or newer.
  • Advanced remote-mode and redaction configuration are delegated to separate documentation.

Frequently asked questions

No. Insert, update, and delete operations are disabled unless their respective environment flags are enabled.

The mysql://tables resource exposes tables and column metadata for the connected database.

Yes. SSH tunneling is listed, and a separate HTTP remote mode with bearer authentication is also described.

The README requires MySQL 5.7 or higher and recommends 8.0 or higher, alongside Node.js 20 or higher.

Independent listing, not an affiliation or security review. Grant the least access needed and verify the upstream instructions before running code.

Related MCP servers

MySQL MCP Server

Databases

Expose MySQL schema inspection, data samples, and SQL execution to MCP assistants. It supports multi-database access, optional SSH tunnels, and local or network deployment, with database permissions controlling available operations.

Neon MCP Server

Databases

Manage Neon Postgres projects, branches, queries, and migrations through an AI assistant. The hosted MCP service supports OAuth or API keys, read-only access, and project-level scoping.

MCP Toolbox for Databases

Databases

MCP Toolbox for Databases connects agents and IDEs to enterprise data through prebuilt tools or custom query definitions. It combines database access with connection pooling, authentication integration, and observability.

DBHub

Databases

DBHub exposes SQL execution and database discovery through a small MCP interface. It spans five database engines, supports multiple configured connections, and includes a web workbench for use without an assistant.

Supabase MCP Server

Databases

Connect AI assistants to Supabase projects for SQL, schema changes, debugging, and Edge Functions. Hosted HTTP setup supports project scoping, read-only access, and selectable feature groups.

Postgres MCP Pro

Databases

Give assistants PostgreSQL schema access, SQL execution, health checks, and performance analysis. Postgres MCP Pro adds query plans and hypothetical index evaluation with configurable read-only operation.

MongoDB MCP Server

Databases

MongoDB MCP Server connects AI clients to MongoDB databases and Atlas. Its tools cover queries, schema inspection, database changes, and MongoDB knowledge searches, with read-only launch examples for safer exploration.

Query MCP for Supabase

Databases

Query MCP connects coding assistants to Supabase SQL, schema changes, project management, and user administration. It includes SQL risk controls, but its author has stopped active maintenance.