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 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

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-2.0.0.tar.gz (78.4 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-2.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysql_mcp_zag-2.0.0.tar.gz
  • Upload date:
  • Size: 78.4 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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 75a82c126f67aa6cb3ef1188a87f3a1177fef156985de04cc745c5f377f59dc4
MD5 2bd7a530d4b6d6e0775735eb76e9d05d
BLAKE2b-256 ea6a048638c4f81070dec449f10c204d1b623ccc09bc2a355d95f31bf73403ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysql_mcp_zag-2.0.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-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: mysql_mcp_zag-2.0.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-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7f84dd2a0aca5e25cc67ea42c23be44496106f80e44ce33995ee709727dac6f
MD5 b12af5044d9c99d2d2e0f0e6919b51f6
BLAKE2b-256 5423e8209974aa545bf72c9463a6b2f397c5d0fa224a03800cb5053716f7f1f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysql_mcp_zag-2.0.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