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.1.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.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for openai_agents_mcptools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 af375ba3b7f77c72ca039e81da294d842a5d64ce5153d6b9c3bedc5f1edf7bb1
MD5 285541ac26b5e18cd42d8f903a35f3ec
BLAKE2b-256 4cc31d7a20e5812e37a82f782947e9bf89c23ef1b23915490c68f6ffc0e4eed9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_agents_mcptools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5eef7b725b2c8a7333264fe03f4553bfb675cafeb6d7f8ee0eee1bcd70807afe
MD5 3013f9900348205cae9a7686417dcc0e
BLAKE2b-256 eb7036752aac9ac30644072839cf7092bd790e80590f9ac793178642e8fa8b35

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