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 tablesmysql://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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05bb4b35d922a1f8fc313a23f3b7c0cb0bb178c8b1a100582992a821aed3ccc9
|
|
| MD5 |
88661509de28a62288f8c260d4f02b22
|
|
| BLAKE2b-256 |
ed5ad47773cd1276f016e84584b4999fc105aeb26c9998a29f28f6f77d0abe2b
|
Provenance
The following attestation bundles were made for mysql_mcp_zag-1.3.0.tar.gz:
Publisher:
main.yml on Michaelzag/mysql-mcp-zag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mysql_mcp_zag-1.3.0.tar.gz -
Subject digest:
05bb4b35d922a1f8fc313a23f3b7c0cb0bb178c8b1a100582992a821aed3ccc9 - Sigstore transparency entry: 701172287
- Sigstore integration time:
-
Permalink:
Michaelzag/mysql-mcp-zag@6a3744843aa2290f76e83d8331649119ab7943a4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Michaelzag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@6a3744843aa2290f76e83d8331649119ab7943a4 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61451ffff21dfb0554157b11e4baf6e045a7f0b6df67e9929af147a02207b032
|
|
| MD5 |
63141ef174bed570201d30b187f137e9
|
|
| BLAKE2b-256 |
902178420854ada608e2bcb5462daac17b974cb5c11c0a4792b0f2f4f5acc815
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mysql_mcp_zag-1.3.0-py3-none-any.whl -
Subject digest:
61451ffff21dfb0554157b11e4baf6e045a7f0b6df67e9929af147a02207b032 - Sigstore transparency entry: 701172289
- Sigstore integration time:
-
Permalink:
Michaelzag/mysql-mcp-zag@6a3744843aa2290f76e83d8331649119ab7943a4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Michaelzag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@6a3744843aa2290f76e83d8331649119ab7943a4 -
Trigger Event:
push
-
Statement type: