Registry / llm-agents / agent-client-protocol

agent-client-protocol

JSON →
library0.12.1pypypi✓ verified 24d ago

The `agent-client-protocol` is a Python implementation of the Agent Client Protocol (ACP) by Zed Industries, designed to facilitate communication between AI agents and clients. It provides classes for building agents, clients, and handling protocol messages with schema validation. Currently at version 0.9.0, the library releases updates driven by upstream ACP schema changes and SDK improvements, typically every few months.

pip install agent-client-protocol
INSTALL
IMPORT
SIG · AGENT-CLIENT-PROTO
A
agent-client-protocol
llm-agentspythonv0.12.1
Install
3.1s avg
Import
2446ms
Disk
26MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 4s
py 3.11
✓ —
✓ 3s
py 3.12
✓ —
✓ 2.6s
py 3.13
✓ —
✓ 2.7s
py 3.9
✕ build_error
✕ build_error
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Agent
from acp import Agent
from acp.agents import Agent
Client
from acp import Client
PromptRequest
from acp import PromptRequest

This quickstart demonstrates how to define a basic `Agent` that responds to text messages. In a production environment, this agent would be instantiated and registered with an `AgentServer` which handles the underlying communication transport (e.g., standard I/O, sockets) to an ACP client. The `send_message` method is overridden here for demonstration purposes; normally it would leverage the server's transport.

import asyncio from acp.agents import Agent from acp.schemas import Message, MessageContents, TextResourceContents, MessageID class SimpleEchoAgent(Agent): """ A simple agent that echoes back any text message it receives. In a real application, this agent would be registered with an AgentServer and communicate via a transport layer (e.g., stdio). """ # In a full setup, send_message would use the transport for communication. # We override it here purely for demonstration purposes in this quickstart. async def send_message(self, message: Message) -> None: if message.contents and message.contents.text: print(f"Agent sending: '{message.contents.text.text}'") async def handle_message(self, message: Message) -> None: if message.contents and message.contents.text: response_text = f"Echo from agent: {message.contents.text.text}" response_message = Message( id=MessageID.new_id(), contents=MessageContents( text=TextResourceContents(text=response_text) ), parent_id=message.id, ) await self.send_message(response_message) else: print(f"Agent received non-text message: {message.id}") async def run_agent_example(): agent = SimpleEchoAgent() # Simulate an incoming message that a real server would pass to the agent incoming_message = Message( id=MessageID.new_id(), contents=MessageContents( text=TextResourceContents(text="Hello ACP!") ) ) print(f"Simulating client sending: '{incoming_message.contents.text.text}'\n") await agent.handle_message(incoming_message) print("\nAgent quickstart example finished.") if __name__ == "__main__": asyncio.run(run_agent_example())
Debug
Known issues
breakingVersion 0.7.0 introduced a major API refactor, moving core classes like `Agent` and `AgentServer` to `acp.agents` and standardizing method names to `snake_case`. Existing code using `camelCase` methods or older import paths will break.
fix
Update import paths (e.g., `from acp.sdk import Agent` to `from acp.agents import Agent`) and refactor method calls to use `snake_case` (e.g., `handleMessage` to `handle_message`).
affects: 0.7.0 and later
breakingIn version 0.5.0, helper functions `acp.helpers.embedded_text_resource` and `acp.helpers.embedded_blob_resource` changed their return type to directly yield `TextResourceContents` / `BlobResourceContents`. If you were implicitly relying on an outer `ResourceBlock` wrapper, you now need to explicitly use `helpers.resource_block(...)` when emitting embedded resources.
fix
If previously `my_resource = embedded_text_resource(...)`, now ensure it's `my_resource = resource_block(embedded_text_resource(...))` when embedding resources within a message.
affects: 0.5.0 and later
gotchaThe library has a strict Python version requirement: `>=3.10, <3.15`. Using Python 3.9 or older, or 3.15 or newer, will result in installation or runtime errors due to specific dependencies and tested environments.
fix
Ensure your project's Python interpreter is within the `3.10-3.14` range. Consider using `pyenv`, `conda`, or `venv` for environment management.
affects: All versions
gotchaThe SDK closely tracks the upstream Agent Client Protocol schema. Minor SDK version bumps (e.g., 0.8.0, 0.9.0) often include `feat(schema): upgrade ACP`, which can introduce new types or modify existing ones. While typically backward-compatible, be aware of potential subtle API shifts in message structures.
fix
Review changelogs for 'upgrade ACP' entries and consult the official ACP specification if unexpected behavior occurs after an update, especially when interacting with agents or clients on different protocol versions.
affects: All versions
Upgrade
Version history
0.12.1latest on PyPI · released Aug 16, 2026
Audit
Dependencies
pydanticrequiredUsed extensively for schema validation of ACP messages and data models. The SDK specifically requires Pydantic v2.
Agent activity
46 hits · last 30 days
node
36
OpenAI (training)
1
Resources
agent-client-protocol — pip install agent-client-protocol · libregistry