universal-tool-calling-protocol/python-utcp

Official python implementation of UTCP. UTCP is an open standard that lets AI agents call any API directly, without extra middleware.

644 ★46 forksPythonUpdated 1mo ago

What you need to know

The Python implementation of the Universal Tool Calling Protocol (UTCP) — a secure, scalable standard for defining and interacting with tools across HTTP, SSE, CLI, MCP, text, WebSocket, and more, built on a modular core with plugin-based protocol support.

Install

pip install utcp utcp-http  # core + HTTP plugin (most common)
pip install utcp-cli utcp-mcp utcp-text  # additional protocol plugins
Editable dev install: git clone ... && pip install -e "core[dev]" && pip install -e plugins/communication_protocols/http

Usage

  • client = await UtcpClient.create(config={...manual_call_templates...}); result = await client.call_tool("my_api.get_data", {"id":"123"})
  • Expose your own tools: FastAPI app with a /utcp discovery endpoint returning a UtcpManual (via @utcp_tool decorator or hand-written JSON)
  • Ingest any OpenAPI spec as tools with zero infrastructure: OpenApiConverter(openapi_spec).convert() or point a call_template URL at an openapi.json
  • Enforce security: set allowed_communication_protocols so a manual can only call tools of permitted protocols

Key features

  • Plugin-based communication protocols: utcp-http (HTTP/REST/SSE/streaming), utcp-cli, utcp-mcp, utcp-text, utcp-websocket (stable); utcp-socket (TCP/UDP) and utcp-gql (GraphQL) in progress
  • OpenAPI ingestion converts OpenAPI 2.0/3.0 specs into UTCP tools automatically — no wrapper servers, selective auth for protected endpoints
  • Protocol restrictions (allowed_communication_protocols) prevent dangerous protocol escalation (secure by default)
  • Pydantic data models (Tool, CallTemplate, UtcpManual, Auth), pluggable tool repositories and search strategies, variable substitution namespacing
  • Docs/examples show both UTCP-decorated and dependency-free server implementations

Best for

Python developers building multi-protocol tool registration and calling infrastructure for AI agents, including automatic OpenAPI-to-tool conversion.

Caveats

  • 1.0.0 introduces breaking changes from 0.x — migration guide included (call_template_type replaces provider_type, http_stream renamed to streamable_http, tool names namespaced as manual.tool)
  • socket and gql plugins are marked in progress
  • mcp plugin config requires transport (e.g., stdio) and command in the config block
Platforms: Linux · macOS · Windows
Documentation ↗

Reviewed 2026-08-07

Topics

aiai-agentai-agent-toolsdeveloper-toolsllmmcpmodel-context-protocolpythonutcp
View on GitHub ↗
Stars
644★
Forks
46
Language
Python
License
MPL-2.0
Created
2025-06-24
Last push
2026-06-24