A tool for integrating MCP with OpenAI Agents SDK
Project description
安装方法:pip install mcptool。
使用示例: from openai_agents import Agent
创建 MCPTool 实例
mcp_tool = MCPTool(server_name="database_server", auth_token="your_auth_token")
创建代理并注册工具
agent = Agent(tools=[mcp_tool])
为代理设置指令
agent.set_instructions( "如果用户请求数据库中的数据,使用 MCPTool 的 query_resource 方法;" "如果用户需要执行特定操作,使用 MCPTool 的 call_tool 方法。" )
运行测试: 安装 pip install mcp
python -m unittest discover
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_agents_mcptools-0.1.1.tar.gz.
File metadata
- Download URL: openai_agents_mcptools-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af375ba3b7f77c72ca039e81da294d842a5d64ce5153d6b9c3bedc5f1edf7bb1
|
|
| MD5 |
285541ac26b5e18cd42d8f903a35f3ec
|
|
| BLAKE2b-256 |
4cc31d7a20e5812e37a82f782947e9bf89c23ef1b23915490c68f6ffc0e4eed9
|
File details
Details for the file openai_agents_mcptools-0.1.1-py3-none-any.whl.
File metadata
- Download URL: openai_agents_mcptools-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eef7b725b2c8a7333264fe03f4553bfb675cafeb6d7f8ee0eee1bcd70807afe
|
|
| MD5 |
3013f9900348205cae9a7686417dcc0e
|
|
| BLAKE2b-256 |
eb7036752aac9ac30644072839cf7092bd790e80590f9ac793178642e8fa8b35
|