mcp-mysql-connector
mcp-mysql-connector
MCP-Server, der MySQL-Datenbankfunktionen als Werkzeuge für LLM-Agenten bereitstellt.
mcp-name: io.github.daedalus/mcp-mysql-connector
Überblick
mcp-mysql-connector ist ein Model Context Protocol (MCP)-Server, der MySQL-Datenbankoperationen als Werkzeuge für LLM-Agenten bereitstellt. Er ermöglicht KI-Assistenten, über ein standardisiertes Protokoll mit MySQL-Datenbanken zu interagieren. Unterstützte Funktionen:
Datenbank- und Tabellenverwaltung
Abfrageausführung
Benutzerauthentifizierung und Berechtigungsverwaltung
Schema-Introspektion
Transaktionssteuerung
Related MCP server: MCP Server MySQL
Installation
pip install mcp-mysql-connectorSchnellstart
Den Server starten
# Run with stdio transport (default)
mcp-mysql-connector
# Or run programmatically
python -c "from mcp_mysql import mcp; mcp.run()"Konfiguration
Stellen Sie mit dem Tool connect eine Verbindung zu MySQL her:
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "your_password",
"database": "your_database"
}MCP-Werkzeuge
Verbindungsverwaltung
Werkzeug | Beschreibung |
| Stellt eine Verbindung zu einer MySQL-Datenbank her |
| Trennt die Verbindung zu MySQL |
| Prüft den Verbindungsstatus |
| Führt ein Commit der aktuellen Transaktion aus |
| Führt ein Rollback der aktuellen Transaktion aus |
Abfrageausführung
Werkzeug | Beschreibung |
| Führt eine SQL-Rohabfrage aus und gibt die Ergebnisse zurück |
Datenbankoperationen
Werkzeug | Beschreibung |
| Listet alle Datenbanken auf dem Server auf |
| Erstellt eine neue Datenbank |
| Löscht eine Datenbank |
| Prüft, ob eine Datenbank existiert |
Tabellenoperationen
Werkzeug | Beschreibung |
| Listet Tabellen in einer Datenbank auf |
| Ruft das Tabellenschema ab |
| Erstellt eine neue Tabelle |
| Löscht eine Tabelle |
| Prüft, ob eine Tabelle existiert |
Spalten- und Indexoperationen
Werkzeug | Beschreibung |
| Zeigt Spaltendetails an |
| Zeigt Indexdetails an |
| Erstellt einen Index |
| Löscht einen Index |
Benutzerverwaltung
Werkzeug | Beschreibung |
| Erstellt einen MySQL-Benutzer |
| Löscht einen MySQL-Benutzer |
| Erteilt einem Benutzer Berechtigungen |
| Entzieht einem Benutzer Berechtigungen |
| Zeigt die Berechtigungen eines Benutzers an |
Serverinformationen
Werkzeug | Beschreibung |
| Ruft den Status des MySQL-Servers ab |
MCP-Ressourcen
Der Server stellt dynamische Ressourcen für Datenbank- und Tabellenmetadaten bereit:
database://{name}- Datenbankmetadaten inklusive Tabellenlistetable://{db}/{table}- Tabellenmetadaten inklusive Schema, Spalten und Indizes
Anwendungsbeispiele
Verbinden und abfragen
# 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")Datenbank und Tabelle erstellen
# 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")Benutzerverwaltung
# 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")Transaktionssteuerung
# Start transaction
execute_query(sql="BEGIN")
# Execute operations
execute_query(sql="INSERT INTO accounts (balance) VALUES (100)")
# Commit or rollback
commit() # or rollback()Umgebungsvariablen
Der Server unterstützt die Konfiguration über folgende Umgebungsvariablen:
export MYSQL_HOST=localhost
export MYSQL_PORT=3306
export MYSQL_USER=root
export MYSQL_PASSWORD=secret
export MYSQL_DATABASE=mydbEntwicklung
# 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/Architektur
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 suiteVoraussetzungen
Python 3.11+
fastmcp >= 2.0.0
pymysql >= 1.1.0
sqlparse >= 0.4.0
Lizenz
MIT-Lizenz - siehe LICENSE für Details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.76133MIT
- AlicenseAqualityAmaintenanceEnables LLMs to interact with MySQL databases through standardized protocol, supporting database management, table operations, data queries, and modifications with configurable permission controls.15691MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to safely interact with MySQL/MariaDB databases, supporting read-only queries by default with optional write operations and access control.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.1
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
MemoryOracle - 10 agent memory tools: vector store, recall, summarization, redaction.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/daedalus/mcp-mysql-connector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server