Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by iamdylanngo

MySQL MCP Server

A Model Context Protocol (MCP) server that connects Claude (or any MCP-compatible client) to a MySQL database. It exposes tools for schema inspection and running read/write queries over a stdio transport.

Tools

Tool

Description

select_mysql_version

Returns the connected MySQL server version

list_tables

Lists all tables in the connected database

describe_table

Shows columns, types, and constraints for a given table

query

Runs a read-only SELECT query with optional ? placeholder params

mutate

Runs an INSERT, UPDATE, or DELETE statement with optional params

Note: mutate rejects SELECT statements — use query for reads.

Related MCP server: mcp-mysql-server

Requirements

  • Node.js 18+

  • A running MySQL instance

1. Download the plugin

Go to the Releases page and download the latest .mcpb file (e.g. mysql-mcp-server-v1.0.1.mcpb).

2. Install the plugin

Via Claude Code CLI:

claude plugin install mysql-mcp-server-v1.0.1.mcpb

Via Claude Desktop:

Double-click the .mcpb file — Claude Desktop will prompt you to install it.

3. Configure your database connection

After installation, Claude will prompt you to fill in your connection details:

Field

Default

Description

Database Host

127.0.0.1

MySQL hostname or IP

Database Port

3306

MySQL port

Database User

root

MySQL username

Database Password

(empty)

MySQL password

Database Name

(required)

Database to connect to

Connection Pool Limit

10

Max concurrent connections

You can update these settings at any time in Claude's plugin settings under MySQL MCP Server.


Manual Setup (from source)

1. Clone and install dependencies

git clone https://github.com/iamdylanngo/mysql-mcp-server
cd mcp
npm install

2. Configure environment

Copy the sample env file and fill in your database credentials:

cp .env.sample .env
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=root
DB_NAME=mydb
DB_POOL_LIMIT=10

3. Build

npm run build

Usage

Run directly

node --env-file=.env build/index.js

Inspect with MCP Inspector

npm run mcp

Connect to Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/[absolute-path]/mysql-mcp-server/build/index.js"],
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database",
        "DB_POOL_LIMIT": "10"
      }
    }
  }
}

Environment Variables

Variable

Default

Description

DB_HOST

localhost

MySQL host

DB_PORT

3306

MySQL port

DB_USER

root

MySQL user

DB_PASSWORD

(empty)

MySQL password

DB_NAME

mydb

Database name

DB_POOL_LIMIT

10

Connection pool size

Tech Stack

  • MCP SDK — MCP server framework

  • mysql2 — MySQL client with promise support

  • Zod — Input schema validation

  • TypeScript

License

MIT

Available Tools

5 tools
describe_tableC

Show columns, types, and constraints for a table.

Inputs: tableName (required).

list_tablesB

Listing all table, that connected to the database.

Inputs: no named parameters.

mutateC

Run an INSERT, UPDATE, or DELETE statement with optional params

Inputs: sql (required), params.

queryB

Run a read-only SELECT query with optional params (? placeholders).

Inputs: sql (required), params.

select_mysql_versionD

MySQL version.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a distinct purpose: listing tables, describing a table, running SELECT queries, running INSERT/UPDATE/DELETE, and fetching MySQL version. There is no overlap.

    Naming Consistency3/5

    Tool names mix verb_noun patterns (list_tables, describe_table) with single-verb names (mutate, query) and a verbose name (select_mysql_version). The inconsistency could confuse an agent about naming conventions.

    Tool Count5/5

    With 5 tools covering listing, describing, querying, mutating, and version checking, the tool count is well-scoped for a MySQL server providing basic database interaction.

    Completeness3/5

    The tools cover essential read/write operations and schema inspection, but lack DDL tools like create or drop table. The mutate tool is limited to DML, so agents cannot perform schema changes.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol (MCP) server that connects Claude Code to MySQL databases. Supports SSH tunnels, SSL/TLS, and multiple simultaneous connections.
      28 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides a lightweight MySQL database interface via stdio, enabling query execution, data manipulation, schema inspection, and connection testing using FastMCP tools.
      3
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server for interacting with MySQL databases. Provides tools for querying, inspecting, and modifying databases directly from Claude.
      7
      8 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for MySQL/MariaDB/Aurora MySQL that enables executing SQL queries, explaining query plans, inspecting schema, checking health, and running diagnostic playbooks through Claude.
      Apache 2.0