MCP Mysql Server logo

MCP Mysql Server

by f4ww4z

Connects MCP clients to MySQL for parameterized queries, data changes, table listing, and schema inspection.

Install MCP Mysql Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "f4ww4z-mcp-mysql-server": {
      "command": "npx",
      "args": [
        "-y",
        "@f4ww4z/mcp-mysql-server"
      ],
      "env": {
        "MYSQL_HOST": "YOUR_VALUE_HERE",
        "MYSQL_USER": "YOUR_VALUE_HERE",
        "MYSQL_PASSWORD": "YOUR_VALUE_HERE",
        "MYSQL_DATABASE": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y @f4ww4z/mcp-mysql-server

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 1mo ago.

Overview

The f4ww4z/mcp-mysql-server MCP server exposes MySQL database operations through MCP tools. It connects using either a MySQL connection URI or separate host, user, password, and database settings. Available operations include SELECT queries, INSERT/UPDATE/DELETE statements, table listing, and table structure inspection, with prepared statement parameters supported for SQL operations. Reach for it when an MCP-compatible client needs controlled access to a MySQL database.

Use cases

  • Query MySQL records from an MCP client
  • Insert, update, or delete database rows
  • List tables in a connected database
  • Inspect MySQL table structures

Key features

  • Parameterized SELECT queries
  • INSERT, UPDATE, and DELETE execution
  • Table listing and schema inspection
  • MySQL URI or environment-based configuration
  • Prepared statement support
  • Automatic connection cleanup

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

18/18 checks healthy over the last 76d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · @f4ww4z/mcp-mysql-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars169Stargazers on the source repository.
npm downloads791Package downloads in the last 30 days.
Last commit11mo agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Mysql Server works

What f4ww4z/mcp-mysql-server MCP server does

The f4ww4z/mcp-mysql-server MCP server gives AI models a standardized MCP interface for working with a MySQL database. It supports establishing a database connection, reading data with SELECT statements, changing data with INSERT, UPDATE, or DELETE statements, listing tables, and inspecting an individual table's structure.

The project is implemented for Node.js and includes TypeScript support. It is intended for use from MCP clients such as Claude Desktop, with configuration examples also provided for Codex on macOS and Windows.

How it works

The client starts the server with npx and supplies database connection details. Configuration can use a single MySQL URI, such as a connection string containing the user, password, host, port, and database name. Alternatively, the settings can be supplied through MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE environment variables.

After the server has access to the database, the client can call these tools:

  • connect_db establishes a connection using supplied credentials.
  • query runs SELECT statements and accepts optional prepared-statement parameters.
  • execute runs INSERT, UPDATE, or DELETE statements with optional parameters.
  • list_tables returns the tables in the connected database.
  • describe_table reports the structure of a named table.

The query and execute examples use ? placeholders with a separate params array. The project describes automatic connection management and cleanup, along with validation and error messages for connection failures, invalid queries, missing parameters, and database errors.

Setup and configuration

Install or run the package with the Node package runner:

Terminal
npx -y @f4ww4z/mcp-mysql-server

An MCP configuration can pass the connection URI as an argument:

config.json
{
  "command": "npx",
  "args": ["-y", "@f4ww4z/mcp-mysql-server", "mysql://user:password@localhost:3306/database"]
}

The alternative environment-based configuration passes the package without a URI and defines the four MySQL variables in the MCP server's env section. Replace the example credentials and database values with the target database's actual settings.

Tools and capabilities

The f4ww4z/mcp-mysql-server MCP server provides database access at the level of explicit MCP tool calls rather than a separate application interface. Its documented capabilities include:

  • Running parameterized read queries.
  • Running parameterized data modification statements.
  • Connecting with supplied MySQL credentials.
  • Enumerating tables in the active database.
  • Inspecting a selected table's columns and structure.
  • Handling passwords through environment variables.

Prepared statements are documented as a measure against SQL injection. Connections are automatically closed when finished, according to the project documentation.

Limitations and notes

It does not specify support for other database engines, migrations, transactions, stored procedures, or administrative operations. The execute tool is described for INSERT, UPDATE, and DELETE statements; other SQL statement types should not be assumed to be supported.

Database credentials and connection details must be supplied by the operator. The project is released under the MIT license.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Mysql Server

Run `npx -y @f4ww4z/mcp-mysql-server`, or add that command and package to an MCP client configuration.

Pass a MySQL connection URI as an argument, or set MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE in the server environment.

The `query` tool runs SELECT statements, while `execute` handles INSERT, UPDATE, and DELETE statements. Both support optional prepared-statement parameters.

Yes. The README provides an automatic Smithery installation option and manual Claude Desktop configuration.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Mysql Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/f4ww4z-mcp-mysql-server?style=directory)](https://allmcps.com/mcp/f4ww4z-mcp-mysql-server)
HTML Embed
<a href="https://allmcps.com/mcp/f4ww4z-mcp-mysql-server"><img src="https://allmcps.com/api/badge/f4ww4z-mcp-mysql-server?style=directory" alt="MCP Mysql Server on AllMCPs" /></a>