mcp-mysql-connector MCP Server
MCP server exposing MySQL database functionalities as tools
mcp-mysql-connector scores 27 (Limited), licensed MIT and written in Python. It installs as a local process. It declares 21 tools. Filed under Databases. GitHub shows 0 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Limited trust
27 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
78/100 for listing completeness. Lost points: 18 of 21 tools barely described, short summary.
How quality is graded
Where the 27 comes from
0 + 6 + 0 + 10 + 4 + 7 = 27. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 6 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 0 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "daedalus-mcp-mysql-connector": { "command": "uvx", "args": [ "mcp-mysql-connector" ] } }}
Environment variables
This server does not declare environment variables.
Tools21Tool docs quality grade D
All capabilitiescreate_databasetoolCreate a new database
create_indextoolCreate an index
create_tabletoolCreate a new table
create_usertoolCreate a MySQL user
database_existstoolCheck if database exists
describe_tabletoolGet table schema
drop_databasetoolDrop a database
drop_indextoolDrop an index
drop_tabletoolDrop a table
drop_usertoolDrop a MySQL user
execute_querytoolExecute raw SQL query and return results
grant_privilegestoolGrant privileges to user
About
mcp-mysql-connector
MCP server exposing MySQL database functionalities as tools for LLM agents.
mcp-name: io.github.daedalus/mcp-mysql-connector
Overview
mcp-mysql-connector is a Model Context Protocol (MCP) server that provides MySQL database operations as tools for LLM agents. It allows AI assistants to interact with MySQL databases through a standardized protocol, enabling:
- Database and table management
- Query execution
- User authentication and privilege management
- Schema introspection
- Transaction control
Install
pip install mcp-mysql-connector
Quick Start
Running the Server
# Run with stdio transport (default)
mcp-mysql-connector
# Or run programmatically
python -c "from mcp_mysql import mcp; mcp.run()"
Configuration
Connect to MySQL using the connect tool:
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "your_password",
"database": "your_database"
}
MCP Tools
Connection Management
| Tool | Description |
|---|---|
connect | Connect to a MySQL database |
disconnect | Disconnect from MySQL |
is_connected | Check connection status |
commit | Commit current transaction |
rollback | Rollback current transaction |
Query Execution
| Tool | Description |
|---|---|
execute_query | Execute raw SQL query and return results |
Database Operations
| Tool | Description |
|---|---|
list_databases | List all databases on server |
create_database | Create a new database |
drop_database | Drop a database |
database_exists | Check if database exists |
Table Operations
| Tool | Description |
|---|---|
list_tables | List tables in a database |
describe_table | Get table schema |
create_table | Create a new table |
drop_table | Drop a table |
table_exists | Check if table exists |
Column & Index Operations
| Tool | Description |
|---|---|
show_columns | Show column details |
show_indexes | Show index details |
create_index | Create an index |
drop_index | Drop an index |
User Management
| Tool | Description |
|---|---|
create_user | Create a MySQL user |
drop_user | Drop a MySQL user |
grant_privileges | Grant privileges to user |
revoke_privileges | Revoke privileges from user |
show_privileges | Show user privileges |
Server Information
| Tool | Description |
|---|---|
server_status | Get MySQL server status |
MCP Resources
The server provides dynamic resources for database and table metadata:
database://{name}- Database metadata including table listtable://{db}/{table}- Table metadata including schema, columns, and indexes
Usage Examples
Connect and Query
# First, connect to database
connect(host="localhost", user="root", password="secret", database="mydb")
# Execute a query
execute_query(sql="SELECT * FROM users WHERE active = true")
# List all tables
list_tables(database="mydb")
Create Database and Table
# Create a database
create_database(name="newapp")
# Create a table
create_table(name="users", schema="id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), email VARCHAR(255) UNIQUE")
User Management
# Create a new user with password
create_user(username="app_user", host="localhost", password="secure_password")
# Grant privileges
grant_privileges(privileges="SELECT,INSERT,UPDATE,DELETE", on="newapp.*", username="app_user", host="localhost")
Transaction Control
# Start transaction
execute_query(sql="BEGIN")
# Execute operations
execute_query(sql="INSERT INTO accounts (balance) VALUES (100)")
# Commit or rollback
commit() # or rollback()
Environment Variables
The server supports configuration via environment variables:
export MYSQL_HOST=localhost
export MYSQL_PORT=3306
export MYSQL_USER=root
export MYSQL_PASSWORD=secret
export MYSQL_DATABASE=mydb
Development
# Clone repository
git clone https://github.com/daedalus/mcp-mysql-connector.git
cd mcp-mysql-connector
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -e ".[test]"
# Run tests
pytest
# Format code
ruff format src/ tests/
# Lint
ruff check src/ tests/
# Type check
mypy src/
Architecture
mcp-mysql-connector/
├── src/mcp_mysql/
│ ├── core/models.py # Data models (QueryResult, TableSchema, etc.)
│ ├── adapters/mysql.py # MySQL connection & pooling
│ ├── services/connection.py # Connection manager
│ ├── tools/mysql_tools.py # MCP tool implementations
│ └── mcp.py # FastMCP server setup
└── tests/ # Test suite
Requirements
- Python 3.11+
- fastmcp >= 2.0.0
- pymysql >= 1.1.0
- sqlparse >= 0.4.0
License
MIT License - see LICENSE for details.
Frequently asked questions
What is mcp-mysql-connector MCP Server?
MCP server exposing MySQL database functionalities as tools
How do I install mcp-mysql-connector MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. mcp-mysql-connector MCP Server runs locally from the PyPI package mcp-mysql-connector with the command uvx mcp-mysql-connector.
Is mcp-mysql-connector MCP Server free and open source?
Yes. mcp-mysql-connector MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does mcp-mysql-connector MCP Server support remote (HTTP) connections?
No remote endpoint is listed for mcp-mysql-connector MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does mcp-mysql-connector MCP Server provide?
mcp-mysql-connector MCP Server provides 21 tools, including create_database, create_index, create_table, and create_user. See the full tool list for descriptions and parameters.
How is mcp-mysql-connector MCP Server's trust score calculated?
mcp-mysql-connector MCP Server scores 27 out of 100 (Limited). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.