mcp-mysql-connector
mcp-mysql-connector
MySQL 데이터베이스 기능을 LLM 에이전트용 도구로 제공하는 MCP 서버입니다.
mcp-name: io.github.daedalus/mcp-mysql-connector
개요
mcp-mysql-connector는 MySQL 데이터베이스 작업을 LLM 에이전트용 도구로 제공하는 Model Context Protocol (MCP) 서버입니다. 표준화된 프로토콜을 통해 AI 어시스턴트가 MySQL 데이터베이스와 상호작용할 수 있게 하며, 다음과 같은 기능을 지원합니다:
데이터베이스 및 테이블 관리
쿼리 실행
사용자 인증 및 권한 관리
스키마 조회
트랜잭션 제어
Related MCP server: MCP Server MySQL
설치
pip install mcp-mysql-connector빠른 시작
서버 실행
# Run with stdio transport (default)
mcp-mysql-connector
# Or run programmatically
python -c "from mcp_mysql import mcp; mcp.run()"설정
connect 도구를 사용하여 MySQL에 연결합니다:
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "your_password",
"database": "your_database"
}MCP 도구
연결 관리
도구 | 설명 |
| MySQL 데이터베이스에 연결 |
| MySQL 연결 해제 |
| 연결 상태 확인 |
| 현재 트랜잭션 커밋 |
| 현재 트랜잭션 롤백 |
쿼리 실행
도구 | 설명 |
| 원시 SQL 쿼리를 실행하고 결과 반환 |
데이터베이스 작업
도구 | 설명 |
| 서버의 모든 데이터베이스 나열 |
| 새 데이터베이스 생성 |
| 데이터베이스 삭제 |
| 데이터베이스 존재 여부 확인 |
테이블 작업
도구 | 설명 |
| 데이터베이스의 테이블 나열 |
| 테이블 스키마 조회 |
| 새 테이블 생성 |
| 테이블 삭제 |
| 테이블 존재 여부 확인 |
컬럼 및 인덱스 작업
도구 | 설명 |
| 컬럼 세부 정보 표시 |
| 인덱스 세부 정보 표시 |
| 인덱스 생성 |
| 인덱스 삭제 |
사용자 관리
도구 | 설명 |
| MySQL 사용자 생성 |
| MySQL 사용자 삭제 |
| 사용자에게 권한 부여 |
| 사용자 권한 회수 |
| 사용자 권한 표시 |
서버 정보
도구 | 설명 |
| MySQL 서버 상태 확인 |
MCP 리소스
서버는 데이터베이스 및 테이블 메타데이터에 대한 동적 리소스를 제공합니다:
database://{name}- 테이블 목록을 포함한 데이터베이스 메타데이터table://{db}/{table}- 스키마, 컬럼, 인덱스를 포함한 테이블 메타데이터
사용 예시
연결 및 쿼리
# 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 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")사용자 관리
# 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")트랜잭션 제어
# Start transaction
execute_query(sql="BEGIN")
# Execute operations
execute_query(sql="INSERT INTO accounts (balance) VALUES (100)")
# Commit or rollback
commit() # or rollback()환경 변수
서버는 환경 변수를 통한 설정을 지원합니다:
export MYSQL_HOST=localhost
export MYSQL_PORT=3306
export MYSQL_USER=root
export MYSQL_PASSWORD=secret
export MYSQL_DATABASE=mydb개발
# 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/아키텍처
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요구 사항
Python 3.11+
fastmcp >= 2.0.0
pymysql >= 1.1.0
sqlparse >= 0.4.0
라이선스
MIT License - 자세한 내용은 LICENSE를 참조하세요.
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