UTCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
UTCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
UTCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/universal-tool-calling-protocol/python-utcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"utcp--": {
"command": "npx",
"args": ["-y", "python-utcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 UTCP工具 执行以下任务... Claude: [自动调用 UTCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"utcp__": {
"command": "npx",
"args": ["-y", "python-utcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
The Universal Tool Calling Protocol (UTCP) is a secure, scalable standard for defining and interacting with tools across a wide variety of communication protocols. UTCP 1.0.0 introduces a modular core with a plugin-based architecture, making it more extensible, testable, and easier to package.
In contrast to other protocols, UTCP places a strong emphasis on:
UTCP uses a modular architecture with a core library and protocol plugins:
pip install -e "core[dev]"
python -m pytest
To run tests for a specific package (e.g., the core library):bash python -m pytest core/tests/
To run tests for a specific plugin (e.g., HTTP):bash python -m pytest plugins/communication_protocols/http/tests/ -v
To run tests with coverage:bash python -m pytest --cov=utcp --cov-report=xml ```
Install the core library and any required protocol plugins:
```bash
pip install utcp utcp-http
pip install utcp-cli utcp-mcp utcp-text ```
pip install -e plugins/communication_protocols/http ```
The build process now involves building each package (core and plugins) separately if needed, though they are published to PyPI independently.
pip install build.cd core).python -m build..whl and .tar.gz) will be in the dist/ directory.```python from utcp.utcp_client import UtcpClient
Version 1.0.0 introduces several breaking changes. Follow these steps to migrate your project.
1. Update Dependencies: Install the new utcp core package and the specific protocol plugins you use (e.g., utcp-http, utcp-cli). 2. Configuration: Configuration Object: UtcpClient is initialized with a UtcpClientConfig object, dict or a path to a JSON file containing the configuration. Manual Call Templates: The providers_file_path option is removed. Instead of a file path, you now provide a list of manual_call_templates directly within the UtcpClientConfig. Terminology: The term provider has been replaced with call_template, and provider_type is now call_template_type. Streamable HTTP: The call_template_type http_stream has been renamed to streamable_http. 3. Update Imports: Change your imports to reflect the new modular structure. For example, from utcp.client.transport_interfaces.http_transport import HttpProvider becomes from utcp_http.http_call_template import HttpCallTemplate. 4. Tool Search: If you were using the default search, the new strategy is TagAndDescriptionWordMatchStrategy. This is the new default and requires no changes unless you were implementing a custom strategy. 5. Tool Naming: Tool names are now namespaced as manual_name.tool_name. The client handles this automatically. 6. Variable Substitution Namespacing: Variables that are substituted in different call_templates, are first namespaced with the name of the manual with the _ duplicated. So a key in a tool call template called API_KEY from the manual manual_1 would be converted to manual__1_API_KEY.
You can find full examples in the examples repository.
Configuration examples for each protocol. Remember to replace provider_type with call_template_type.
```python from utcp_http.openapi_converter import OpenApiConverter import aiohttp
{
"name": "my_api",
"call_template_type": "http",
"url": "https://api.example.com/utcp",
"allowed_communication_protocols": ["http", "cli", "mcp"]
}
from utcp.utcp_client import UtcpClient
client = await UtcpClient.create(config={ "manual_call_templates": [{ "name": "github", "call_template_type": "http", "url": "https://api.github.com/openapi.json", "auth_tools": { # Authentication for generated tools requiring auth "auth_type": "api_key", "api_key": "Bearer ${GITHUB_TOKEN}", "var_name": "Authorization", "location": "header" } }] }) ```
client = await UtcpClient.create(config={ "manual_call_templates": [{ "name": "my_api", "call_template_type": "http", "url": "https://api.example.com/utcp" }] })
@app.get("/utcp") def utcp_discovery(): return UtcpManual.create_from_decorators(manual_version="1.0.0")
@utcp_tool(tool_call_template=HttpCallTemplate( name="get_weather", url=f"https://example.com/api/weather", http_method="GET" ), tags=["weather"]) @app.get("/api/weather") def get_weather(location: str): return {"temperature": 22.5, "conditions": "Sunny"}
No UTCP dependencies server version:
python from fastapi import FastAPI
app = FastAPI()
@app.get("/utcp") def utcp_discovery(): return { "manual_version": "1.0.0", "utcp_version": "1.0.2", "tools": [ { "name": "get_weather", "description": "Get current weather for a location", "tags": ["weather"], "inputs": { "type": "object", "properties": { "location": {"type": "string"} } }, "outputs": { "type": "object", "properties": { "temperature": {"type": "number"}, "conditions": {"type": "string"} } }, "tool_call_template": { "call_template_type": "http", "url": "https://example.com/api/weather", "http_method": "GET" } } ] }
@app.get("/api/weather") def get_weather(location: str): return {"temperature": 22.5, "conditions": "Sunny"} ```
{
"name": "multi_step_cli_tool",
"call_template_type": "cli", // Required
"commands": [ // Required - sequential command execution
{
"command": "git clone UTCP_ARG_repo_url_UTCP_END temp_repo",
"append_to_final_output": false
},
{
"command": "cd temp_repo && find . -name '*.py' | wc -l"
// Last command output returned by default
}
],
"env_vars": { // Optional
"GIT_AUTHOR_NAME": "UTCP Bot",
"API_KEY": "${MY_API_KEY}"
},
"working_dir": "/tmp", // Optional
"auth": null // Optional (always null for CLI)
}
CLI Protocol Features: - Multi-command execution: Commands run sequentially in single subprocess - Cross-platform: PowerShell on Windows, Bash on Unix/Linux/macOS - State preservation: Directory changes (cd) persist between commands - Argument placeholders: UTCP_ARG_argname_UTCP_END format - Output referencing: Access previous outputs with $CMD_0_OUTPUT, $CMD_1_OUTPUT - Flexible output control: Choose which command outputs to include in final result
multi_protocol_manual = HttpCallTemplate( name="flexible_manual", call_template_type="http", url="https://api.example.com/utcp", allowed_communication_protocols=["http", "cli"] # Explicitly allow both ) ```
await client.call_tool("my_api.some_cli_tool", {"arg": "value"}) ```
🚀 Transform any existing REST API into UTCP tools without server modifications!
UTCP's OpenAPI ingestion feature automatically converts OpenAPI 2.0/3.0 specifications into UTCP tools, enabling AI agents to interact with existing APIs directly - no wrapper servers, no API changes, no additional infrastructure required.
async def convert_api(): async with aiohttp.ClientSession() as session: async with session.get("https://api.github.com/openapi.json") as response: openapi_spec = await response.json() converter = OpenApiConverter(openapi_spec) manual = converter.convert() print(f"Generated {len(manual.tools)} tools from GitHub API!") return manual
The core/ directory contains the foundational components: - Data Models: Pydantic models for Tool, CallTemplate, UtcpManual, and Auth - Client Interface: Main UtcpClient for tool interaction - Plugin System: Extensible interfaces for protocols, repositories, and search - Default Implementations: Built-in tool storage and search strategies
UTCP supports multiple communication protocols through dedicated plugins:
| Plugin | Description | Status | Documentation |
|---|---|---|---|
[utcp-http](plugins/communication_protocols/http/) | HTTP/REST APIs, SSE, streaming | ✅ Stable | [HTTP Plugin README](plugins/communication_protocols/http/README.md) |
[utcp-cli](plugins/communication_protocols/cli/) | Command-line tools | ✅ Stable | [CLI Plugin README](plugins/communication_protocols/cli/README.md) |
[utcp-mcp](plugins/communication_protocols/mcp/) | Model Context Protocol | ✅ Stable | [MCP Plugin README](plugins/communication_protocols/mcp/README.md) |
[utcp-text](plugins/communication_protocols/text/) | Local file-based tools | ✅ Stable | [Text Plugin README](plugins/communication_protocols/text/README.md) |
[utcp-websocket](plugins/communication_protocols/websocket/) | WebSocket real-time bidirectional communication | ✅ Stable | [WebSocket Plugin README](plugins/communication_protocols/websocket/README.md) |
[utcp-socket](plugins/communication_protocols/socket/) | TCP/UDP protocols | 🚧 In Progress | [Socket Plugin README](plugins/communication_protocols/socket/README.md) |
[utcp-gql](plugins/communication_protocols/gql/) | GraphQL APIs | 🚧 In Progress | [GraphQL Plugin README](plugins/communication_protocols/gql/README.md) |
For development, you can install the packages in editable mode from the cloned repository:
```bash
高质量的开源MCP工具,实现UTCP标准
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MPL 2.0 — 文件级 Copyleft,修改的文件需开源,但可与闭源代码结合使用。
经综合评估,UTCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | python-utcp |
| 原始描述 | 开源MCP工具:Official python implementation of UTCP. UTCP is an open standard that lets AI ag。⭐644 · Python |
| Topics | mcpaiai-agentdeveloper-tools |
| GitHub | https://github.com/universal-tool-calling-protocol/python-utcp |
| License | MPL-2.0 |
| 语言 | Python |
收录时间:2026-06-24 · 更新时间:2026-06-24 · License:MPL-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端