Skip to main content

Unified Agent Protocol — Universal interoperability layer for AI agents and tools

Project description

Unified Agent Protocol (UAP) — Core SDK

Version 1.0 · Apache-2.0 · Python 3.10+

UAP is the universal interoperability layer for AI agents and tools.

Define an agent once in UAP — then ship it to MCP, A2A, OpenAI Assistants, Anthropic Tool Use, Google Gemini Functions, OpenAPI 3, OpenWebUI, LangChain — without rewriting a single field. Every adapter is bidirectional and declares its LossInfo explicitly. No silent data loss.

What UAP gives you over MCP / A2A alone

Concern MCP A2A UAP
Tool description schema
Agent-to-Agent runtime ✅ (via bridges)
Cross-vendor bridges ✅ (9 formats)
Bidirectional round-trip
Auth modelling (OAuth2/mTLS/SigV4/…) partial partial
RBAC / Capabilities
Compliance (GDPR/HIPAA/residency)
Cost / latency hints
URN identity
Versioned wire format

Install

pip install unified-agent-protocol            # core SDK only
pip install unified-agent-protocol[runtime]   # + FastAPI runtime
pip install unified-agent-protocol[all]       # + every optional dep

Quick start

from unifiedagentprotocol import (
    Tool, Agent, Skill, Parameter, ParameterSchema,
    Capabilities, SideEffects, Compliance, DataClassification,
    AuthConfig, AuthType, Endpoint, Transport, Envelope,
)

weather = Tool(
    id="urn:uap:tool:get-weather",
    name="get_weather",
    description="Return current weather for a city.",
    parameters=[Parameter(name="city", schema=ParameterSchema(type="string"))],
    endpoint=Endpoint(transport=Transport.HTTP,
                      url="https://api.example.com/weather", method="POST"),
    auth=AuthConfig(type=AuthType.API_KEY,
                    secret_ref="vault://kv/data/weather#token"),
    capabilities=Capabilities(idempotent=True,
                              side_effects=SideEffects.READ_ONLY,
                              deterministic=False,
                              requires_human_approval=False),
    compliance=Compliance(data_classification=DataClassification.PUBLIC,
                          regulations=["GDPR"], data_residency=["EU"]),
)

agent = Agent(
    id="urn:uap:agent:weather-bot",
    name="WeatherBot",
    description="Provides weather information.",
    tools=[weather],
    skills=[Skill(id="answer-weather", name="answer-weather",
                  description="Answer weather questions.")],
    endpoints=[Endpoint(transport=Transport.HTTP, url="https://bot.example.com")],
)

print(Envelope.of(agent).to_wire())

Ship it to every ecosystem:

from unifiedagentprotocol.bridges.mcp        import to_mcp
from unifiedagentprotocol.bridges.a2a        import to_a2a
from unifiedagentprotocol.bridges.openai     import to_openai
from unifiedagentprotocol.bridges.anthropic  import to_anthropic
from unifiedagentprotocol.bridges.gemini     import to_gemini
from unifiedagentprotocol.bridges.openapi    import to_openapi

mcp_payload,    _ = to_mcp(agent)
a2a_card,       _ = to_a2a(agent)
oai_assistant,  _ = to_openai(agent)
claude_tool,    _ = to_anthropic(weather)
gemini_decl,    _ = to_gemini(weather)
openapi_spec,   _ = to_openapi(agent)

Every bridge also has an inverse from_<format>(…) returning (uap_object, LossInfo).

CLI

uap version
uap schema-export --output-dir schemas/uap/1.0
uap bind  --input my_tool.json --format mcp --show-loss
uap validate --input my_agent.json
uap lint --input my_agent.json
uap serve --registry-path ./registry --port 8000

The auto-detect bind accepts MCP, A2A, OpenAI, Anthropic, OpenWebUI, LangChain, OpenAPI 3, Swagger 2 and bare UAP envelopes.

Architecture

┌──────────────────────────────────────────────────────────────┐
│  Runtime  (optional)   FastAPI adapter, /.well-known/agent   │
├──────────────────────────────────────────────────────────────┤
│  Registry (optional)   In-memory / Filesystem / pluggable    │
├──────────────────────────────────────────────────────────────┤
│  Bridges               MCP, A2A, OpenAI, Anthropic, Gemini,  │
│  (bidirectional)       OpenAPI, Swagger, OpenWebUI, LangChain│
├──────────────────────────────────────────────────────────────┤
│  Core IR (Schema)      Tool, Agent, Parameter (JSON-Schema), │
│                        Auth, Capabilities, Compliance, Cost, │
│                        Endpoint, Trigger, Envelope, LossInfo │
├──────────────────────────────────────────────────────────────┤
│  Wire Spec             schemas/uap/1.0/*.schema.json         │
└──────────────────────────────────────────────────────────────┘

Layer rules:

  • core/ depends on nothing but Pydantic + stdlib.
  • bridges/<x>/ depends only on core/.
  • runtime/ depends on core/, bridges/, registry_impl/.
  • cli/ is the only module allowed to import anywhere.

See docs/adr/0001-architecture-overview.md and docs/spec/uap-1.0-wire-format.md.

Examples

Testing

pytest -q

Bridge round-trip tests live under tests/bridges/ and assert from_x(to_x(obj)) == obj on the representable subset, with LossInfo covering the rest.

License

Apache 2.0 — see LICENSE.

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

unified_agent_protocol-1.1.0.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unified_agent_protocol-1.1.0-py3-none-any.whl (102.8 kB view details)

Uploaded Python 3

File details

Details for the file unified_agent_protocol-1.1.0.tar.gz.

File metadata

  • Download URL: unified_agent_protocol-1.1.0.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unified_agent_protocol-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ac4cf62b4f8ada7a36f239df722891756b52008abfc367a461c85ba29c4b5ced
MD5 a043d914ee88d4e5e33af58c6540b8c4
BLAKE2b-256 330736003c29f690948bd7c671e507a79a3a04cde7bdacea0b2eef54878298b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for unified_agent_protocol-1.1.0.tar.gz:

Publisher: publish.yml on WhoMeta-Inc/unifiedagentprotocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unified_agent_protocol-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unified_agent_protocol-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54638578ea41bb7e4a786e0c57219149e64e81f3e25c90dfe412f28fc4dd99b1
MD5 c7b093561b79923b9d5d46e0eca545cc
BLAKE2b-256 33f6477edfd354ec405d7d188f973482db55a26ca28a9134ea5ec079efb8f4ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for unified_agent_protocol-1.1.0-py3-none-any.whl:

Publisher: publish.yml on WhoMeta-Inc/unifiedagentprotocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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