Skip to main content

MySQL MCP Server

A modern MySQL Model Context Protocol (MCP) server built with FastMCP.

Features

  • Execute SQL queries via MCP tools
  • Browse database tables and structure via MCP resources
  • SSL certificate support
  • Connection pooling and error handling

Configuration

Command Line Arguments

Required Arguments

Argument Description Default
--user MySQL username (required)
--password MySQL password (required)
--database MySQL database name (required)

Database Connection (Optional)

Argument Description Default
--host MySQL server host localhost
--port MySQL server port 3306

SSL Configuration (Optional)

Argument Description Default
--ssl-ca Path to SSL CA certificate file (none - SSL auto-negotiated)
--ssl-cert Path to SSL client certificate file (none)
--ssl-key Path to SSL client private key file (none)
--ssl-disabled Disable SSL connection entirely false

Note: If --ssl-cert is provided, --ssl-key must also be provided, and vice versa.

Advanced Options (Optional)

Argument Description Default
--charset Character set for the connection utf8mb4
--collation Collation for the connection utf8mb4_unicode_ci
--sql-mode MySQL SQL mode TRADITIONAL

Usage

Simple Configuration

{
  "mcpServers": {
    "mysql": {
      "command": "uvx",
      "args": [
        "mysql-mcp-zag",
        "--host", "localhost",
        "--port", "3306",
        "--user", "your_user",
        "--password", "your_password",
        "--database", "your_database"
      ]
    }
  }
}

Complex Configuration

{
  "mcpServers": {
    "mysql": {
      "command": "uvx",
      "args": [
        "mysql-mcp-zag",
        "--host", "your-remote-host.com",
        "--port", "25060",
        "--user", "your_user",
        "--password", "your_password",
        "--database", "your_database",
        "--ssl-ca", "/path/to/ca-certificate.pem"
      ]
    }
  }
}

Available Tools

  • execute_sql: Execute SQL queries

Available Resources

  • mysql://tables: List all tables
  • mysql://tables/{table}: Describe table structure

Requirements

  • Python 3.13+
  • MySQL server
  • uvx (for installation and usage)

Created by Michael Zag, Michael@MichaelZag.com

Metadata

Release files for mysql-mcp-zag 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mysql-mcp-zag 2.0.0
File Size Uploaded
mysql_mcp_zag-2.0.0.tar.gz 78.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mysql-mcp-zag 2.0.0
File Interpreter ABI Platform
mysql_mcp_zag-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.2 kB

Release files / mysql_mcp_zag-2.0.0.tar.gz

Download URL mysql_mcp_zag-2.0.0.tar.gz
Size 78.4 kB
Tags Source
SHA-256 checksum
How to use checksums
75a82c126f67aa6cb3ef1188a87f3a1177fef156985de04cc745c5f377f59dc4
BLAKE2b-256 checksum
How to use checksums
ea6a048638c4f81070dec449f10c204d1b623ccc09bc2a355d95f31bf73403ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Release files / mysql_mcp_zag-2.0.0-py3-none-any.whl

Download URL mysql_mcp_zag-2.0.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7f84dd2a0aca5e25cc67ea42c23be44496106f80e44ce33995ee709727dac6f
BLAKE2b-256 checksum
How to use checksums
5423e8209974aa545bf72c9463a6b2f397c5d0fa224a03800cb5053716f7f1f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page