Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_agents_mcptools-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_agents_mcptools-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file openai_agents_mcptools-0.1.0.tar.gz.

File metadata

  • Download URL: openai_agents_mcptools-0.1.0.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

Hashes for openai_agents_mcptools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d56dbca249c86aa9a7e3598bb5a2734dbffc27c609194833ac3d69c662f2083
MD5 aec340c86e89f095099d206ef3f860f3
BLAKE2b-256 6b8c24a060ca5c54c52d54516f2ac924c261652b0850ef2359c81ec9f8ccc64f

See more details on using hashes here.

File details

Details for the file openai_agents_mcptools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_agents_mcptools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c2602fa2d645b92bf7d3ac295fdc2e5911d11970c647da95ddecae6ae56e61a
MD5 2114adc4d80271e2905ac797b62ec987
BLAKE2b-256 56179e0cd31096bbd08ce4563f929e2305845ca840586762c6db5ad33834cb15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page