カスタマイズされたMCPプロジェクト
このプロジェクトは、CLI サポート付きのmcpライブラリを活用し、OpenAI の API と統合します。
要件
プロジェクトを実行する前に、必要な依存関係を必ずインストールしてください。
pip install -r requirements.txtRelated MCP server: OpenAI API MCP Server
使用法
OpenAI API キーを環境変数として設定します。
export OPENAI_API_KEY="your-api-key"MCP サーバーを起動します。
python server.pyクライアントを使用してサーバーと対話します。
python client.pyあるいは、オーケストレーターを使用して LLM とツールをクエリします。
python main.py
例
天気ツールのクエリ
クライアントを実行し、 get_weatherツールを呼び出します。
python client.pyやり取りの例:
You: List tools
Assistant: {
"tools": [
{
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {
"city": {
"type": "string",
"description": "Name of the city"
}
}
}
]
}
You: Call get_weather with {"city": "Beijing"}
Assistant: 北京的天气是晴天依存関係
openai==1.70.0mcp[cli]==1.6.0
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています。
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.