MCP
ローカルMCP + Groq + OpenAI Agents SDK
この授業用のサンプルには以下が含まれています:
app.py: 複数のツールを備えた、ローカルで永続的に動作するStreamable HTTP MCPサーバー。mcp_groq_agent.ipynb: それらのツールを発見して呼び出すエージェント。
セットアップ
Python 3.10以降を使用してください。ターミナルでこのプロジェクトフォルダーに移動し、仮想環境を作成して、サーバーとノートブックの両方に必要なものをすべてインストールしてください(必要に応じて、python3.3を現在お使いの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: mcp-file-system-lmstudio
MCPサーバーを実行する
一方のターミナルでMCPサーバーを起動し、実行したままにしてください:
source .venv/bin/activate
.venv/bin/python app.pyStreamable HTTPエンドポイントは、次の場所で利用できるようになりました:
http://127.0.0.1:8000/mcpそのターミナルは開いたままにしてください。サーバーを停止する場合はCtrl+Cを押します。
エージェントノートブックを実行する
2つ目のターミナルで:
cd /Users/somenathmandal/Documents/transfer/grok-playground/MCP
source .venv/bin/activate
jupyter lab mcp_groq_agent.ipynbJupyterが求められたら、.venvのPythonカーネルを選択し、セルを上から下まで実行してください。ノートブックはhttp://127.0.0.1:8000/mcpに直接接続し、app.pyを起動したりインポートしたりすることはありません。Groq APIキーは.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 toolsMCP接続セルを実行する前に、サーバーが起動している必要があります。ノートブックが接続エラーを報告した場合は、まずサーバーを起動したターミナルにUvicornがhttp://127.0.0.1:8000で実行中と表示されているかを確認してください。
ノートブックはまた、ノートブックランチャーから引き継がれることがある古い証明書ファイル環境変数もガードします。参照先のパスが存在しない場合にのみ証明書変数を削除し、有効なカスタム証明書設定は保持されます。
This server cannot be deployed
Maintenance
Related MCP Connectors
Exposes FEDLIN's public security scanners as agent-callable tools over Streamable HTTP.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Discover, compare, route, and execute machine-accessible capabilities for AI agents.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Related MCP Servers
AlicenseBqualityBmaintenanceExposes Granoflow's local REST API and CLI as tools for AI agents, IDEs, and automation, enabling task and project management via natural language.19121 npmMIT- AlicenseNot gradedqualityCmaintenanceExposes local LM Studio language models as MCP tools, enabling chat completions and model listing through a local OpenAI-compatible API without requiring API keys.MIT
- FlicenseNot gradedqualityCmaintenanceExposes local Python tools via a persistent Streamable HTTP endpoint, allowing an OpenAI Agents SDK notebook to discover and invoke them while using Groq for reasoning and tool selection.-
- FlicenseNot gradedqualityCmaintenanceEnables an agent to discover and call local MCP tools over a Streamable HTTP endpoint using Groq for reasoning and tool selection.-