安装方法: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
Metadata
Release files for openai-agents-mcptools 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openai_agents_mcptools-0.1.2.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openai_agents_mcptools-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / openai_agents_mcptools-0.1.2.tar.gz
| Download URL | openai_agents_mcptools-0.1.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6553506c63c393acdfa2b89d258c8710a113f3eb279b5f92a8cf471727901cbf
|
|
BLAKE2b-256 checksum How to use checksums |
e0fb32ff8d6dfd3aba0e2de1ee5225d0927546db82a767de56d4f400a1c939ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.11
|
Release files / openai_agents_mcptools-0.1.2-py3-none-any.whl
| Download URL | openai_agents_mcptools-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8f2231d1758ea94efae5dd21b8ad640a6e66d1eb1fa151cec542f5fc090faea
|
|
BLAKE2b-256 checksum How to use checksums |
ed7b6af56f8683c3c32a3fae890e234d1fd35d0ed89928eddc82a2bb925f61ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.11
|
Security for openai-agents-mcptools 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.