Enemyrr MCP MySQL Server

Provides a MySQL database operations MCP server enabling models to interact with MySQL via a standardized interface.
  • typescript

1

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": {
    "mcp-mirror-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 an MCP server that exposes MySQL database operations to AI models. This server provides a standardized interface for connecting to MySQL and performing common data operations, making it easier to integrate database access into your AI workflows while keeping security and schema management in clear focus.

How to use

You can use the MySQL MCP server from an MCP client by selecting the server configuration and invoking the available tools. The core capabilities let you connect to a MySQL database, run queries, manage schema, and inspect tables and columns. Use prepared statements for parameterized queries to protect against SQL injection and rely on the server to validate inputs before executing commands.

To interact with the server, you typically perform operations through the MCP client’s tool surfaces. Common tasks include connecting to the database, listing tables, describing a table, creating tables, adding columns, and running SELECT/INSERT/UPDATE/DELETE queries. Each operation maps to a dedicated tool that you call with the appropriate arguments.

If you need to inspect or modify the database schema, you can list all tables, describe a specific table to review its columns and types, and create or alter tables as needed. For data manipulation, you can execute DML statements or use prepared statements with defined parameters.

How to install

Prerequisites: you need Node.js and npm installed on your machine. You may also use a package manager or a script runner as shown in the instructions.

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

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

Option B: Install manually and build from source

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

Add the server to Cursor IDE (or your MCP client) by configuring a stdio server with the runtime command for the built index. In Cursor IDE, create a server entry with these values:

Name: mysql
Type: stdio
Command: node
Args: [/absolute/path/to/mcp-mysql-server/build/index.js]

Replace /absolute/path/to/ with the actual path where you cloned and built the project. This sets up the local MCP server that your clients will talk to.

Additional sections

Configuration and environment: you can provide connection details via environment variables or through direct tool arguments when you invoke a tool. The server supports multiple ways to specify the MySQL connection, including a full connection URL or individual host/user/password/database values.

Database connection variables shown here:

DATABASE_URL=mysql://user:password@host:3306/database
DB_HOST=localhost
DB_USER=your_user
DB_PASSWORD=your_password
DB_DATABASE=your_database

Security considerations: the server uses prepared statements to prevent SQL injection, supports secure password handling via environment variables, validates queries before execution, and automatically closes connections when they are no longer needed.

Error handling: you will receive detailed error messages for connection failures, invalid queries or parameters, missing configuration, database errors, and schema validation issues to help you diagnose problems quickly.

Available tools

connect_db

Connect to MySQL database using 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.

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