MySQL (f4ww4z)

Databases

A Model Context Protocol server for MySQL database operations.

Your AI app calls the MySQL (f4ww4z) MCP server, which does the databases work and sends the result back to the chat.

About MySQL (f4ww4z)

MySQL (f4ww4z) is a community MCP server from f4ww4z, filed in our directory under databases. A Model Context Protocol server for MySQL database operations.

MySQL (f4ww4z) runs on your own machine: your AI app starts it with the command npx -y @smithery/cli and talks to it over standard input and output.

At a glance

Publisher
f4ww4z (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @smithery/cli
Written in
JavaScript
License
MIT
GitHub stars
171

How to set up MySQL (f4ww4z)

  1. Install Node.js on the machine that runs your AI app, because MySQL (f4ww4z) starts with npx and downloads its package on first run.
  2. Check the MySQL (f4ww4z) README for keys or settings; the registry lists none that MySQL (f4ww4z) requires.
  3. Add MySQL (f4ww4z) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the MySQL (f4ww4z) tools to confirm the connection.
  5. Run one read-only task with MySQL (f4ww4z) first, and keep your app asking before each tool call until the results look right.

MySQL (f4ww4z) compared with similar servers

  • Werbot by werbot has fewer GitHub stars than MySQL (f4ww4z) (171 against 171); both are community servers, and both run locally.
  • Mongo (QuantGeekDev) by QuantGeekDev has more GitHub stars than MySQL (f4ww4z) (175 against 171); both are community servers, and both run locally.
  • PostgreSQL Ops by call518 has fewer GitHub stars than MySQL (f4ww4z) (164 against 171); both are community servers, and both run locally.

Before you connect MySQL (f4ww4z)

  • Give MySQL (f4ww4z) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each MySQL (f4ww4z) tool call until you trust what it does with them.
  • Treat text that MySQL (f4ww4z) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for MySQL (f4ww4z) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for MySQL (f4ww4z)

How marketing and sales teams put MySQL (f4ww4z) to work, by company size. Pick the size closest to yours and start MySQL (f4ww4z) on one use case.

Small business

  • A small business with its own app can ask MySQL (f4ww4z) plain questions about customers and orders, without writing SQL.
  • Owners can use MySQL (f4ww4z) to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • MySQL (f4ww4z) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing analysts can connect MySQL (f4ww4z) to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use MySQL (f4ww4z) to build audience lists from product data and check counts before a send.
  • Start MySQL (f4ww4z) on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should point MySQL (f4ww4z) at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through MySQL (f4ww4z), so marketing gets self-serve answers without access to raw customer tables.
  • MySQL (f4ww4z) is a community server, so have security review the code and pin a version before MySQL (f4ww4z) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

MySQL (f4ww4z) README

From f4ww4z/mcp-mysql-server on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@f4ww4z/mcp-mysql-server

A Model Context Protocol server that provides MySQL database operations. This server enables AI models to interact with MySQL databases through a standardized interface.

Installation

Installing via Smithery

To install MySQL Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude
Manual Installation
npx @f4ww4z/mcp-mysql-server

Configuration

The server requires the following environment variables to be set in your MCP settings configuration file:

recommended use

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server", "mysql://user:password@localhost:port/database"],
    }
  }
}
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "@f4ww4z/mcp-mysql-server"],
      "env": {
        "MYSQL_HOST": "your_host",
        "MYSQL_USER": "your_user",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

codex

mac

在 ~/.codex/config.toml

[mcp_servers.mcp-mysql-server]
command = "npx"
args = [
  "-y",
  "@f4ww4z/mcp-mysql-server",
  "mysql://user:password@127.0.0.1:3306/database"
]
windows

在 %USERPROFILE%\.codex\config.toml

[mcp_servers.mcp-mysql-server]
command = "npx"
args = [
  "-y",
  "@f4ww4z/mcp-mysql-server",
  "mysql://user:password@127.0.0.1:3306/database"
]

Running evals

The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found mcpevals.io/docs.

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

Available Tools

1. connect_db

Establish connection to MySQL database using provided credentials.

use_mcp_tool({
  server_name: "mysql",
  tool_name: "connect_db",
  arguments: {
    host: "localhost",
    user: "your_user",
    password: "your_password",
    database: "your_database"
  }
});
2. query

Execute SELECT queries with optional prepared statement parameters.

use_mcp_tool({
  server_name: "mysql",
  tool_name: "query",
  arguments: {
    sql: "SELECT * FROM users WHERE id = ?",
    params: [1]
  }
});
3. execute

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

use_mcp_tool({
  server_name: "mysql",
  tool_name: "execute",
  arguments: {
    sql: "INSERT INTO users (name, email) VALUES (?, ?)",
    params: ["John Doe", "john@example.com"]
  }
});
4. list_tables

List all tables in the connected database.

use_mcp_tool({
  server_name: "mysql",
  tool_name: "list_tables",
  arguments: {}
});
5. describe_table

Get the structure of a specific table.

use_mcp_tool({
  server_name: "mysql",
  tool_name: "describe_table",
  arguments: {
    table: "users"
  }
});

Features

  • Secure connection handling with automatic cleanup
  • Prepared statement support for query parameters
  • Comprehensive error handling and validation
  • TypeScript support
  • Automatic connection management

Security

  • Uses prepared statements to prevent SQL injection
  • Supports secure password handling through environment variables
  • Validates queries before execution
  • Automatically closes connections when done

Error Handling

The server provides detailed error messages for common issues:

  • Connection failures
  • Invalid queries
  • Missing parameters
  • Database errors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request to https://github.com/f4ww4z/mcp-mysql-server

License

MIT

Questions about MySQL (f4ww4z)

What is the MySQL (f4ww4z) MCP server?

A Model Context Protocol server for MySQL database operations. MySQL (f4ww4z) is maintained by f4ww4z on GitHub at f4ww4z/mcp-mysql-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the MySQL (f4ww4z) MCP server?

Add MySQL (f4ww4z) to your AI app's MCP config with the command npx -y @smithery/cli. In Claude Code, run claude mcp add --transport stdio mysql-server -- npx -y @smithery/cli. To run MySQL (f4ww4z) this way you need Node.js installed.

Does MySQL (f4ww4z) need an API key?

The registry lists no required keys for MySQL (f4ww4z). Check the MySQL (f4ww4z) README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is MySQL (f4ww4z) an official MCP server?

No. MySQL (f4ww4z) is a community server maintained by f4ww4z. Community servers can be excellent; read the code and the open issues before you give MySQL (f4ww4z) access to company data.

What license is MySQL (f4ww4z) under?

MySQL (f4ww4z) is released under the MIT license, according to its GitHub repository. The license covers the code of MySQL (f4ww4z); the service it connects to has its own terms.