MySQL MCP Server

![Tests](https://github.com/youngsu5582/mcp-server-mysql/actions/workflows/test.yml/badge.svg) > This project is a Java conversion of a Python

Local serverstdioPython

What is the MySQL MCP server?

MySQL MCP server exists for a simple reason — assistants are far more useful when they can act on MySQL directly instead of describing what you should do. Tests > This project is a Java conversion of a Python codebase from > a.

What you get

This project was created as a learning exercise to explore MCP (Model Context Protocol) concepts.

  • List available MySQL tables as resources
  • Read table contents
  • Execute SQL queries with proper error handling
  • Secure database access through environment variables
  • Comprehensive logging

Setting it up

The server ships on PyPI as mysql-mcp-server, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Configuration and credentials

You will need 5 environment variables: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mysql mcp server does with a few real requests.

Choosing this one

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. It is maintained by youngsu5582; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against MySQL's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

How to install the MySQL MCP server

{
  "mcpServers": {
    "server-mysql-youngsu5582": {
      "command": "uvx",
      "args": ["mysql-mcp-server"],
      "env": {
        "MYSQL_HOST": "your-value",
        "MYSQL_PORT": "your-value",
        "MYSQL_USER": "your-value",
        "MYSQL_PASSWORD": "your-value",
        "MYSQL_DATABASE": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
MYSQL_HOSTEndpoint or connection string the server talks to.Optional
MYSQL_PORTConfiguration value read at startup.Optional
MYSQL_USERConfiguration value read at startup.Optional
MYSQL_PASSWORDConfiguration value read at startup.Optional
MYSQL_DATABASEConfiguration value read at startup.Optional

Frequently asked questions

This project is a Java conversion of a Python codebase from [design-computer/mysql_mcp_server](https://github.com/designcomputer/mysql_mcp_server/tree/main), preserving the core functionality for Java environments.