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

Uploaded Python 3

File details

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

File metadata

  • Download URL: openai_agents_mcptools-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6553506c63c393acdfa2b89d258c8710a113f3eb279b5f92a8cf471727901cbf
MD5 27e5e548b7bda0694fa61d4dfe9e291c
BLAKE2b-256 e0fb32ff8d6dfd3aba0e2de1ee5225d0927546db82a767de56d4f400a1c939ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_agents_mcptools-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f2231d1758ea94efae5dd21b8ad640a6e66d1eb1fa151cec542f5fc090faea
MD5 57a5e906517f3ceb97e0639752cb07a5
BLAKE2b-256 ed7b6af56f8683c3c32a3fae890e234d1fd35d0ed89928eddc82a2bb925f61ff

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