# MySQL MCP Server (MCP server)

> MySQL MCP Server is an MCP server that enables secure interaction with MySQL databases. It has 1,398 GitHub stars, is released under the MIT license and runs locally with uvx mysql_mcp_server. It works with Claude Desktop, Claude Code, Cursor and VS Code and needs an API key.

# MySQL MCP Server A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/designcomputer/mysql_mcp_server |
| GitHub stars | 1,398 |
| License | MIT |
| Language | Python |
| Transport | stdio |
| Packages | pypi: mysql_mcp_server |
| Remote URL | none |
| Needs API key | yes |
| Official | no |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Databases |
| Latest release | v0.4.4 (Jul 30, 2026) |
| Last commit | Aug 2, 2026 |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mysql-mcp-server": {
      "command": "uvx",
      "args": [
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_PASSWORD": "your-value"
      }
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --env MYSQL_PASSWORD=your-value --transport stdio mysql-mcp-server -- uvx mysql_mcp_server
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mysql-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_PASSWORD": "your-value"
      }
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "mysql_password",
      "description": "MYSQL_PASSWORD",
      "password": true
    }
  ],
  "servers": {
    "mysql-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_PASSWORD": "${input:mysql_password}"
      }
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Environment variables

- `MYSQL_HOST`: Shown in the README's example configuration.
- `MYSQL_PORT`: Shown in the README's example configuration.
- `MYSQL_USER`: Shown in the README's example configuration.
- `MYSQL_PASSWORD` (secret): Shown in the README's example configuration.
- `MYSQL_DATABASE`: Shown in the README's example configuration.

## Tools

- `execute_sql`: Executes any standard SQL query.
- `get_schema_info`: Provides detailed metadata about database structures.
- `get_table_sample`: Fetches a representative sample of data.

## Similar MCP servers

- [Dbx](https://appsgit.com/mcp-servers/dbx): Query databases from AI agents using connections configured in DBX. (24,945 stars, Apache-2.0)
- [Butterbase AI MCP Server](https://appsgit.com/mcp-servers/butterbase-ai-mcp-server): Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys. (3,686 stars, Apache-2.0, needs API key)
- [DBHub](https://appsgit.com/mcp-servers/dbhub): Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite. (3,610 stars, MIT, needs API key)
- [LINQ to DB](https://appsgit.com/mcp-servers/linq-to-db): Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB. (3,332 stars, MIT)
- [Mindwtr](https://appsgit.com/mcp-servers/mindwtr): Task automation via SQLite, desktop Local API, or Mindwtr Cloud; read-only by default. (2,211 stars, AGPL-3.0, needs API key)
- [MCP Memory Service](https://appsgit.com/mcp-servers/mcp-memory-service): Open-source persistent memory for AI agent pipelines (LangGraph, CrewAI, AutoGen) and Claude. (1,988 stars, Apache-2.0)

---

Canonical page: https://appsgit.com/mcp-servers/mysql-mcp-server
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
