MCP MySQL Server

Provides MySQL database operations via MCP, enabling AI models to interact with MySQL databases through a standardized interface.
  • typescript

30

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "enemyrr-mcp-mysql-server": {
      "command": "node",
      "args": [
        "/absolute/path/to/mcp-mysql-server/build/index.js"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_USER": "your_user",
        "DB_DATABASE": "your_database",
        "DB_PASSWORD": "your_password",
        "DATABASE_URL": "mysql://user:password@host:3306/database"
      }
    }
  }
}

You can run the MCP MySQL Server to let AI models interact with MySQL databases through a standardized, secure interface. This server exposes a set of tools for connecting, querying, and managing your MySQL schemas and data, enabling practical database operations from AI-powered workflows.

How to use

To use this MCP server with your client, start the local server and connect your MCP client to it. You can perform actions such as connecting to a database, querying data, updating records, and managing tables and indexes. The tools are designed to support prepared statements and provide clear results and errors to help you build reliable AI-driven database interactions.

How to install

Prerequisites: You need Node.js installed on your system. You may also want a code editor or IDE for managing files and environment configurations.

Option A: Install via Smithery (automatic for Claude Desktop)

npx -y @smithery/cli install @enemyrr/mcp-mysql-server --client claude

Option B: Install Manually (clone, build, then run)

git clone https://github.com/enemyrr/mcp-mysql-server.git
cd mcp-mysql-server
npm install
npm run build

Start the server by pointing your MCP client to the runtime command shown in the manual setup. Use the following command as the runtime entry point after you have built the project. Replace the path with your actual build location.

node /absolute/path/to/mcp-mysql-server/build/index.js

Available tools

connect_db

Connect to a MySQL database using a URL, workspace path, or direct credentials.

query

Execute SELECT queries with optional prepared statement parameters.

execute

Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.

list_tables

List all tables in the connected database.

describe_table

Get the structure of a specific table.

create_table

Create a new table with specified fields and indexes.

add_column

Add a new column to an existing table.

alter_column

Modify an existing column (type, nullable, default, or rename).

drop_column

Remove a column from a table.

drop_table

Delete a table (requires confirmation).

truncate_table

Remove all rows from a table (requires confirmation).

list_databases

List all accessible databases on the server.

get_indexes

List all indexes on a table.

get_foreign_keys

List all foreign key relationships for a table.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational