透過 MCP 伺服器組合路由器、評估器與交接工作流程 (搭配 mcp-agent)
透過路由器、評估器-最佳化器和編排器流程等可組合模式,將 LLM 連接至 MCP 伺服器,無需手動管理伺服器生命週期。
先決條件
Python 執行環境、MCP 伺服器、LLM API 金鑰、可選用 Temporal 實現持久化工作流程
安裝
使用符合您環境的上游安裝或設定路徑:
- uv init
- uv add "mcp-agent[openai]"
- uv run main.py
- uv add "mcp-agent"
上游的需求與注意事項:
- python
- 我們建議使用 uv 來管理您的 Python 專案 (uv init)。
基本使用或入門說明:
-
最小範例
-
async with app.run():
-
摘自上游文件:https://raw.githubusercontent.com/lastmile-ai/mcp-agent/HEAD/README.md