Skip to main content
Glama
iamdylanngo

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

Install Server
A
license - permissive license
C
quality
A
maintenance

Maintenance

Maintainers
Response time
3dRelease cycle
3Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iamdylanngo/mysql-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server