MySQL Database Integration

v1.0.0Databasesstable

This server enables AI models to interact with MySQL databases through a standardized interface.

mcp-mysqlmcpai-integration
Share:
160
Stars
0
Downloads
0
Weekly
0/5

What is MySQL Database Integration?

MySQL Database Integration is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this server enables ai models to interact with mysql databases through a standardized interface.

This server enables AI models to interact with MySQL databases through a standardized interface.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • connect_db
  • query
  • execute
  • list_tables
  • describe_table

Use Cases

Interact with MySQL databases
Standardized database interface
AI model database queries
f4ww4z

Maintainer

LicenseMIT License
Languagejavascript
Versionv1.0.0
UpdatedMay 14, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @f4ww4z/mcp-mysql-server

Manual Installation

npx -y @f4ww4z/mcp-mysql-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MySQL Database Integration

MCP MySQL Server is a Node.js MCP server that lets AI assistants connect to and interact with MySQL databases through a standardized interface. It exposes tools for establishing connections, executing SELECT queries with prepared statements, running INSERT/UPDATE/DELETE operations, listing tables, and describing table schemas — making it straightforward for Claude to answer questions about data, generate reports, or assist with database administration tasks without requiring a separate SQL client.

Prerequisites

  • Node.js 16+ and npx available
  • An accessible MySQL server (local or remote) with valid credentials
  • Database user with appropriate SELECT, INSERT, UPDATE, DELETE permissions
  • Claude Desktop or another MCP-compatible client
1

Add the server to your Claude Desktop config

Add the mcp-mysql entry to your MCP client config with your MySQL connection details as environment variables. The server will use these to connect when tools are invoked.

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_db_user",
        "MYSQL_PASSWORD": "your_db_password",
        "MYSQL_DATABASE": "your_database_name"
      }
    }
  }
}
2

Restart Claude Desktop

Save the configuration and fully restart Claude Desktop so it picks up the new MySQL server.

3

Connect to the database

Ask Claude to connect to the MySQL database. It will use the connect_db tool with the credentials from the environment variables.

4

Explore the schema

Have Claude list tables and describe their structure before running queries. This helps Claude understand the database schema and write accurate SQL.

5

Run queries and operations

Use Claude to run SELECT queries (via the query tool with prepared statement support) or data modification operations (via the execute tool for INSERT/UPDATE/DELETE).

MySQL Database Integration Examples

Client configuration

Add this to your Claude Desktop claude_desktop_config.json. All four MySQL environment variables are required for the connection to succeed.

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "appuser",
        "MYSQL_PASSWORD": "s3cur3password",
        "MYSQL_DATABASE": "production_db"
      }
    }
  }
}

Prompts to try

Use these prompts to explore and query your MySQL database through Claude.

- "List all tables in the database"
- "Describe the structure of the users table"
- "How many orders were placed in the last 30 days?"
- "Show me the top 10 customers by total order value"
- "Insert a new product with name 'Widget B', price 29.99, and category 'hardware' into the products table"

Troubleshooting MySQL Database Integration

Connection refused or ECONNREFUSED error

Verify MYSQL_HOST is correct and the MySQL server is running. For Docker-based MySQL, use the container's network address or 127.0.0.1. If connecting to a remote host, check firewall rules allow port 3306 from your machine.

Access denied for user error

Double-check MYSQL_USER and MYSQL_PASSWORD in the env block. Ensure the MySQL user has the required privileges on the specified MYSQL_DATABASE. Run 'SHOW GRANTS FOR your_user@localhost;' in MySQL to verify permissions.

npx does not find the package or installs an old version

Run 'npx -y @f4ww4z/mcp-mysql-server' in a terminal to see the error. Clear the npx cache with 'npx clear-npx-cache' if a stale version is cached. Ensure you have internet access to reach the npm registry.

Frequently Asked Questions about MySQL Database Integration

What is MySQL Database Integration?

MySQL Database Integration is a Model Context Protocol (MCP) server that this server enables ai models to interact with mysql databases through a standardized interface. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MySQL Database Integration?

Install via npm with the command: npx -y @f4ww4z/mcp-mysql-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with MySQL Database Integration?

MySQL Database Integration works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MySQL Database Integration free to use?

Yes, MySQL Database Integration is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-mysql": { "command": "npx", "args": ["-y", "@f4ww4z/mcp-mysql-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MySQL Database Integration?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides