mcpField
M
MySQL MCP Server

MySQL MCP Server

Local
github.com/ganganbiz1Databases1Updated 77w ago

About MySQL MCP Server

A Python MySQL MCP server built with FastMCP 2.0. It provides tools for queries and database structure inspection, and supports Docker-based deployment.

Key features

  1. 01Execute SQL queries and updates
  2. 02List database tables
  3. 03Retrieve table schemas
  4. 04Describe database structure
  5. 05Docker and docker-compose packaging

Use cases

  1. 01Run queries against MySQL
  2. 02Inspect table schemas
  3. 03Review database structure

MCP support

The server exposes MCP tools for query execution, updates, table listing, schema retrieval, and database description.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mysql-mcp-server-ganganbiz1": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"build"
]
}
}
}
Run commanddocker run -i --rm build

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocibuild

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MySQL MCP Server

A MySQL Model Context Protocol (MCP) server implemented with FastMCP 2.0 and Python.

Features

  • Execute SQL queries via MCP functions
  • Get database schema information
  • Fully containerized with Docker and docker-compose
  • Packaged with Poetry for dependency management

MCP Tools

The server provides the following MCP tools:

  • execute_query: Execute a SQL query and return results
  • execute_update: Execute an update/insert SQL query
  • get_tables: Get a list of tables in the database
  • get_table_schema: Get schema information for a specific table
  • describe_database: Get comprehensive database structure information

Setup

Prerequisites
  • Docker and docker-compose
  • Poetry (for local development)
  • Python 3.13+

Cursor Integration

To integrate with Cursor, add the following to your ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "mysqlMcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MYSQL_HOST",
        "-e",
        "MYSQL_PORT",
        "-e",
        "MYSQL_USER",
        "-e",
        "MYSQL_PASSWORD",
        "-e",
        "MYSQL_DATABASE",
        "mysql-mcp-server"
      ],
      "env": {
        "MYSQL_HOST": "host.docker.internal",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "password",
        "MYSQL_DATABASE": "mcpdb"
      }
    }
  }
}

Docker Build

To build the Docker image separately:

docker build -t mysql-mcp-server .

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.