Skip to main content
Glama

ローカル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 .env
GROQ_API_KEY=replace_with_your_groq_key
GROQ_MODEL=openai/gpt-oss-20b

.envをコミットしたり共有したりしないでください。.gitignoreによって除外されています。

Related MCP server: MCP Python Server - Streamable HTTP

MCPサーバーを実行する

一方のターミナルでMCPサーバーを起動し、実行したままにしてください:

source .venv/bin/activate
.venv/bin/python app.py

Streamable 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.ipynb

Jupyterが求められたら、.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 tools

MCP接続セルを実行する前に、サーバーが起動している必要があります。ノートブックが接続エラーを報告した場合は、まずサーバーを起動したターミナルにUvicornがhttp://127.0.0.1:8000で実行中と表示されているかを確認してください。

ノートブックはまた、ノートブックランチャーから引き継がれることがある古い証明書ファイル環境変数もガードします。参照先のパスが存在しない場合にのみ証明書変数を削除し、有効なカスタム証明書設定は保持されます。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

  • 16 AI-native tools with dual SSE + streamable-http transport. Free tier available.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samtheAI/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server