🔎 MCP服务器资源管理器笔记本
一个交互式笔记本环境,用于探索、列出和调用MCP(模型上下文协议)服务器中的工具,使用 fastmcp 和 fast-agent-mcp.
非常适合使用OpenAI或Claude等LLM构建和测试工具驱动的AI代理,并辅以Playwright和Brave Search等外部工具服务器。
🚀 入门指南
1.️⃣ 克隆存储库
git clone https://github.com/messeb/py-mcp-server-explorer-notebook.git
cd py-mcp-server-explorer-notebook🔐 环境设置
2.️⃣ 设置API密钥
重命名提供的 example.env 向 .env:
mv example.env .env编辑 .env 并填写您的API密钥:
# .env
ANTHROPIC_API_KEY=your_claude_key
OPENAI_API_KEY=your_openai_key
BRAVE_API_KEY=your_brave_key⚙️ FastAgent配置
3.️⃣ 配置fastagent.config
重命名 example.fastagent.config 向 fastagent.config.yaml:
mv example.fastagent.config fastagent.config.yaml编辑配置以包含您的环境变量(例如,对于Brave Search):
mcp:
servers:
brave_websearch:
command: npx
args: ["-y", "@modelcontextprotocol/server-brave-search"]
env:
BRAVE_API_KEY: ""📒 运行笔记本
打开 mcp-server-explor-notelbook.ipynb 致:
- 列出MCP服务器上的可用工具
- 直接调用工具(例如Brave Search、Playwright)
- 通过LLM路由工具使用
FastAgent
🧠 鸣谢
技术支持:
