MCP
python3 -m venv .venv or python -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt .venv\Scripts\python.exe app.py
本地 MCP + Groq + OpenAI Agents SDK
这个课堂示例包含:
app.py:一个持久的本地 Streamable HTTP MCP 服务器,带有几个工具。mcp_groq_agent.ipynb:一个能够发现并调用这些工具的智能体。
设置
请使用 Python 3.10 或更高版本。在终端中,进入此项目文件夹,创建虚拟环境,并安装服务器和笔记本所需的一切(如有必要,请将 python3.11 换成你现在用的较新 Python 命令):
cd /Users/somenathmandal/Documents/transfer/grok-playground/MCP
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt参照示例创建 .env,并在其中放入你的 Groq API 密钥:
cp .env.example .envGROQ_API_KEY=replace_with_your_groq_key
GROQ_MODEL=openai/gpt-oss-20b切勿提交或分享 .env;它已被 .gitignore 排除。
Related MCP server: nit-mcp-server
运行 MCP 服务器
在一个终端中启动 MCP 服务器,并让它保持运行:
source .venv/bin/activate
.venv/bin/python app.pyStreamable HTTP 端点现在可以访问了:
http://127.0.0.1:8000/mcp请保持该终端打开。当你想停止服务器时,按 Ctrl+C。
运行智能体笔记本
在第二个终端中:
cd /Users/somenathmandal/Documents/transfer/grok-playground/MCP
source .venv/bin/activate
jupyter lab mcp_groq_agent.ipynb如果 Jupyter 提示,请选择 .venv 的 Python 内核,然后从上到下运行各个单元格。该笔记本直接连接 http://127.0.0.1:8000/mcp;它从不启动或导入 app.py。Groq API Key 是从 .env 加载的,并且从不保存在笔记本中。
各部分如何连接
Notebook agent
-> Groq OpenAI-compatible API (model reasoning and tool selection)
-> http://127.0.0.1:8000/mcp (tool discovery and execution)
-> app.py MCP tools执行 MCP 连接单元格之前,必须确保服务器处于运行状态。如果笔记本报告连接错误,请先确认服务器终端显示 Uvicorn 正在 http://127.0.0.1:8000 上运行。
笔记本还会防御偶尔从笔记本启动程序继承的过期的证书文件环境变量。只有当引用的路径不存在时,它才会删除证书变量;有效的自定义证书设置会被保留。
MCP
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Exposes FEDLIN's public security scanners as agent-callable tools over Streamable HTTP.
Connect Grok by xAI to AI assistants via UniversalMCP stateless Streamable HTTP.
16 AI-native tools with dual SSE + streamable-http transport. Free tier available.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceFlask-based server that exposes callable tools via HTTP endpoints for AI agents like Gemini CLI, enabling agent orchestration, tool introspection, and workflow automation with a centralized tool registry.-
- FlicenseNot gradedqualityDmaintenanceExposes nit's code review agent as tools for Claude, enabling local path and GitHub PR/commit/URL review over Streamable HTTP.-
- FlicenseNot gradedqualityDmaintenanceEnables agents to discover and execute local tools via a Streamable HTTP endpoint using the Groq OpenAI-compatible API.-
- FlicenseNot gradedqualityDmaintenanceEnables an agent to discover and call local MCP tools over a Streamable HTTP endpoint using Groq for reasoning and tool selection.-