mcp-server-multitask
mcp_training
MCPサーバー(天気、ジオコーディング、通貨のツール付き)と、それらを使用できるOpenAIモデルと対話するコンソールクライアント。
Tú › ¿Qué tiempo hace en Madrid?
Modelo:
En Madrid hay 24,3 °C, humedad del 41 % y cielo despejado.
· get_lat_lon_from_city → get_current_weather仕組み
main_client.py ──> OpenAI (Responses API) ──> [túnel] ──> main_server.py (MCP)
tu terminal el modelo decide 5 herramientas
qué herramientas usa sobre APIs públicasクライアントはツールを実行しません。OpenAIにMCPサーバーの公開URLを渡し、OpenAIがツールの一覧表示、呼び出し、連鎖(都市→座標→天気)を行います。そのため、サーバーはインターネットからアクセス可能である必要があります。OpenAIは自社のサーバーから接続するため、あなたのマシンからではありません。
ツール
ツール | 入力 | 出力 |
| 都市名 | 緯度と経度 |
| 座標 | 気温、湿度、天気状態 |
| 座標 | 7日間の予報 |
| 2つのISOコード | 現在の為替レート |
| 金額 + レート | 換算後の金額 |
天気とジオコーディングはOpen-Meteo(無料、キー不要)を使用。通貨はExchangeRate-APIを使用し、キーが必要です。20通貨に対応(CLIでは/monedas)。
構造
config/settings.py configuración y logging (todo sale del .env)
server/ herramientas + clientes HTTP de las APIs externas
client/ cliente de OpenAI + interfaz de terminal
main_server.py arranca el servidor MCP
main_client.py arranca la conversaciónRelated MCP server: Python Weather MCP Server
インストール
**Python 3.11+**が必要。uv(推奨)を使用する場合:
git clone <url-del-repo>
cd mcp_training
uv syncまたはpipと仮想環境を使用する場合:
python -m venv .venv
.venv\Scripts\activate # Windows; en Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt設定
サンプルをコピーしてキーを入力:
cp .env.example .env必須の変数は2つだけ:
変数 | 用途 |
| 為替レート(こちらで無料キーを取得) |
| クライアントのモデル |
そして3つ目の変数MCP_PUBLIC_URLは次のステップで設定します。その他(モデル、ポート、トランスポート、タイムアウト、ログレベル)は適切なデフォルト値があり、.env.exampleに記載されています。
使用方法
3つのターミナルが必要:サーバー、トンネル、クライアント。
1. MCPサーバーを起動
uv run python main_server.pyhttp://127.0.0.1:8002/mcpで待機します。
2. トンネルでサーバーを公開
OpenAIがサーバーに到達するには公開URLが必要です。devtunnelを使用:
devtunnel port create -p 8002 --allow-anonymous
devtunnel host表示されたURL(https://xxxxxxx-8002.euw.devtunnels.ms)をコピーして.envに設定:
MCP_PUBLIC_URL=https://xxxxxxx-8002.euw.devtunnels.msどのトンネルでも構いません(ngrok、Cloudflare Tunnelなど)。URLが外部からアクセス可能であることだけが重要です。クライアントはURLに/mcpが含まれていない場合は自動的に追加します。
3. クライアントを起動
uv run python main_client.pyクエリを入力してEnterキーを押します。会話にはメモリがあり、マドリッドについて尋ねた後、「では明日は?」とだけ言うことができます。
Convierte 100 USD a EUR
¿Cuál es el clima actual en Madrid?
Dame el pronóstico del tiempo para Nueva YorkCLIコマンド:
コマンド | 機能 |
| ツール、例、コマンドを表示 |
| 対応通貨コードを表示 |
| 終了(Ctrl+C、Ctrl+Dも可) |
クライアントなしでサーバーを使用する
サーバーは標準のMCPサーバーです。互換性のあるクライアントで使用できます。サブプロセスとして接続する場合(Claude Desktop、Claude Codeなど)は、.envにMCP_TRANSPORT=stdioを設定します。これによりトンネルやポートは不要になります。
よくある問題
症状 | 原因 |
起動時に |
|
クライアントが起動せず |
|
モデルがツールを使用できないと言う | サーバーまたはトンネルがダウンしているか、 |
OpenAIのクォータエラー | 残高不足。再試行しても解決しない |
各呼び出しの詳細(引数、応答、URL)を確認するには、.envにLOG_LEVEL=DEBUGを設定します。ログはstderrに出力されるため、python main_client.py > charla.txtとすると会話のみが保存されます。
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
- Alicense-qualityDmaintenanceA server that integrates the MCP library with OpenAI's API, allowing users to interact with various tools, such as the weather tool, through natural language queries.MIT
- AlicenseBqualityDmaintenanceEnables AI agents to fetch real-time weather data for any location using the OpenWeatherMap API. Demonstrates how to build a simple MCP server that exposes weather information as a tool for LLMs.1GPL 3.0
- Alicense-qualityDmaintenanceAn MCP server that enables AI assistants to call weather tools, read resources, and use prompt templates for live weather data integration.1,299MIT
- Flicense-qualityCmaintenanceAn MCP server that integrates ExchangeRate-API and Open-Meteo to provide currency conversion and weather tools, enabling natural language queries for exchange rates, weather, and geocoding.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server for AI dialogue using various LLM models via AceDataCloud
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/Jotarose/mcp-server-multitask'
If you have feedback or need assistance with the MCP directory API, please join our Discord server