Skip to main content

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

Project description

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 Usage (Streamable HTTP Default)

Launch the server:

uvx mysql-mcp-zag \
  --host localhost \
  --port 3306 \
  --user your_user \
  --password your_password \
  --database your_database

This starts a Streamable-HTTP MCP endpoint listening on http://127.0.0.1:8000/mcp. Configure your MCP client accordingly, e.g. in Codex:

{
  "mcpServers": {
    "mysql": {
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

If you need to reach a remote MySQL instance, pass the appropriate database host/port/SSL flags—transport stays Streamable-HTTP so clients remain spec-compliant.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysql_mcp_zag-1.3.0.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mysql_mcp_zag-1.3.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mysql_mcp_zag-1.3.0.tar.gz.

File metadata

  • Download URL: mysql_mcp_zag-1.3.0.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mysql_mcp_zag-1.3.0.tar.gz
Algorithm Hash digest
SHA256 05bb4b35d922a1f8fc313a23f3b7c0cb0bb178c8b1a100582992a821aed3ccc9
MD5 88661509de28a62288f8c260d4f02b22
BLAKE2b-256 ed5ad47773cd1276f016e84584b4999fc105aeb26c9998a29f28f6f77d0abe2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysql_mcp_zag-1.3.0.tar.gz:

Publisher: main.yml on Michaelzag/mysql-mcp-zag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mysql_mcp_zag-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: mysql_mcp_zag-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mysql_mcp_zag-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61451ffff21dfb0554157b11e4baf6e045a7f0b6df67e9929af147a02207b032
MD5 63141ef174bed570201d30b187f137e9
BLAKE2b-256 902178420854ada608e2bcb5462daac17b974cb5c11c0a4792b0f2f4f5acc815

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysql_mcp_zag-1.3.0-py3-none-any.whl:

Publisher: main.yml on Michaelzag/mysql-mcp-zag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page