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 tablesmysql://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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mysql_mcp_zag-2.0.0.tar.gz | 78.4 kB | With provenance | Details for mysql_mcp_zag-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mysql_mcp_zag-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for mysql_mcp_zag-2.0.0-py3-none-any.whl |
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 logRelease 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 logSecurity for mysql-mcp-zag 2.0.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mysql_mcp_zag-2.0.0.tar.gz
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 logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.