Python MySQL MCP
pymcp
pymcpはFastMCPベースのPythonプロジェクトで、MySQLデータベースと対話するためのツールを提供します。このプロジェクトはサーバーとクライアント間の通信をサポートし、さまざまなツールを使用してデータを照会および分析できます。
プロジェクト構造
pymcp/
├── client.py # 클라이언트 코드
├── main.py # 서버 실행 코드
├── src/
│ ├── env.py # 로컬 환경 설정
│ ├── env_dev.py # 개발 환경 설정
│ ├── mcp_instance.py # MCP 인스턴스 초기화
│ ├── mysql_tool.py # MySQL 관련 도구 정의
├── pyproject.toml # 프로젝트 메타데이터 및 의존성
├── requirements.txt # 의존성 목록
└── README.md # 프로젝트 설명Related MCP server: Jewei MSSQL MCP Server
インストールと実行
1. 依存インストール
Python 3.13以降が必要です。依存関係をインストールするには、以下のコマンドを実行してください。
pip install -r requirements.txt2. サーバーの実行
サーバーを実行するには、 main.pyを実行してください。
python main.pyサーバーはデフォルトで0.0.0.0:8080で実行されます。
3. クライアントの実行
クライアントを実行するにはclient.pyを実行します。
python client.pyクライアントはサーバーと通信してMySQLクエリを実行したり、ツールのリストを検索したりできます。
環境設定
環境によっては MySQL 設定が異なる場合があります。
ローカル環境:
src/env.py開発環境:
src/env_dev.py
環境はAPP_ENV環境変数で設定できます。デフォルトはlocalです。
export APP_ENV=dev # 개발 환경 설정提供ツール
サーバーが提供するツールは次のとおりです。
describe_tools
利用可能なツールのリストと使用方法について説明します。query_mysql(sql: str)
与えられたSQLクエリを実行し、結果を返します。
例:query_mysql("SELECT * FROM users LIMIT 10;")
主なファイルの説明
main.py
サーバーを実行するエントリポイントです。 MCPインスタンスを初期化し、ツールを登録してサーバーを実行します。
client.py
サーバーと対話するクライアントコード。サーバーに接続してツールを呼び出すことができます。
src/mysql_tool.py
MySQL 関連ツールを定義したファイルです。 query_mysqlなどのツールを使用してSQLクエリを実行できます。
src/env.pyとsrc/env_dev.py
MySQL接続設定を含む環境変数ファイル。環境に応じて適切な設定を読み込みます。
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
- AlicenseAqualityDmaintenanceAn MCP server that provides read-only access to MySQL databases.451970MIT
- Alicense-qualityBmaintenanceA FastMCP-based server that enables executing Microsoft SQL Server data queries and table structure queries through a standardized MCP protocol interface.6MIT
- Flicense-quality-maintenanceAn MCP server that enables interaction with MySQL databases through the Model Context Protocol, allowing execution of SQL queries and database table listing operations from Cline AI.
- Alicense-qualityDmaintenanceA production-ready MCP server for MySQL database operations, providing secure HTTP endpoints for read-only queries, performance analysis, and server monitoring.4511MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
An MCP server giving access to Grafana dashboards, data and more.
MCP server for managing Prisma Postgres.
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/hoonzinope/pymcp-mysql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server