# f4ww4z/mcp-mysql-server [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/f4ww4z/mcp-mysql-server  
**GitHub Stars:** 168  
**npm Downloads (last month):** 30651  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/f4ww4z-mcp-mysql-server

## Description
Node.js-based MySQL database integration that provides secure MySQL database operations

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-mysql-server": {
    "command": "npx",
    "args": ["-y","@smithery/cli"],
    "env": {
      "MYSQL_HOST": "",
      "MYSQL_USER": "",
      "MYSQL_PASSWORD": "",
      "MYSQL_DATABASE": ""
    }
  }
}
```

**Requires environment variables:** `MYSQL_HOST`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_DATABASE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## 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:

```bash
npx -y @f4ww4z/mcp-mysql-server
```

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

```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. The README also documents this package in Claude Desktop configuration and in Codex configuration files.

## 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

The supplied material documents MySQL support only. 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 README shows both URI-based and environment-variable-based configuration, but it does not describe a built-in credential store or OAuth flow. The project is released under the MIT license.

_Full upstream README: https://allmcps.com/mcp/f4ww4z-mcp-mysql-server/readme_

