MCP ExplorerExplorer

Openai Agents Sdk Mcp

@tegnikeon 9 months ago
13 MIT
FreeCommunity
AI Systems
Create AI agents using OpenAI Agents SDK with MCP server.

Overview

What is Openai Agents Sdk Mcp

openai-agents-sdk-mcp is a minimal SDK that utilizes OpenAI’s Agents to create AI agents powered by the MCP server.

Use cases

Use cases include developing intelligent chatbots, automating information retrieval from the web, and creating interactive AI applications that leverage OpenAI’s capabilities.

How to use

To use openai-agents-sdk-mcp, clone the repository, set up a Python virtual environment, install the required packages, configure environment variables in a .env file, and run the main application using ‘python main.py’.

Key features

Key features include integration with OpenAI API and Brave Search API, easy setup through a virtual environment, and a simple command structure for executing AI agents.

Where to use

openai-agents-sdk-mcp can be used in various fields such as AI development, chatbot creation, and automated search applications.

Content

openai-agents-sdk-mcp minimal

Python Version OpenAI Agents Brave Search

OpenAIのAgents SDKを使用して、MCPサーバーを利用したAIエージェントを作成します。

目次

環境のセットアップ

  1. このリポジトリをクローンします。

  2. Python仮想環境を作成してアクティベートします。

# uvをインストール(初回のみ)
sudo snap install astral-uv --classic

# 仮想環境の作成
uv venv

# 仮想環境のアクティベート
source .venv/bin/activate
  1. 必要なパッケージをインストールします。
uv pip install -r requirements.txt
  1. .envファイルを作成します。
cp .env.example .env

環境変数

以下の環境変数を.envファイルに設定する必要があります:

環境変数 説明 取得方法
OPENAI_API_KEY OpenAI APIのキー OpenAIのダッシュボードから取得
BRAVE_API_KEY Brave Search APIのキー Brave Search APIから取得
OPENAI_API_KEY=your_openai_api_key
BRAVE_API_KEY=your_brave_api_key

環境に応じた設定

main.pyのnpxコマンドのパスは、使用する環境に応じて変更してください:

"command": "npx"

参考:

"command": "/Users/user/.volta/bin/npx",  # MacOS環境用(volta利用時)
"command": "C:\\Program Files\\nodejs\\npx.cmd",  # Windows環境用

実行方法

プログラムを実行します:

python main.py

プロジェクト構造

.
├── main.py           # メインのアプリケーションファイル
├── README.md         # プロジェクトのドキュメント
├── requirements.txt  # Pythonの依存関係
├── .env.example     # 環境変数のテンプレート
└── .gitignore       # Gitの除外設定

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers