A previous release had provenance metadata, but this release does not. View details.
AClientP
AClientP implements the Agent Client Protocol (ACP, the protocol between code editors and AI coding agents) in typed Python: both the agent and the client side, for the released v1 protocol and the draft v2.
The name sets it apart from the other "ACP"s (Agent Communication Protocol, Agent Connect Protocol, Agentic Commerce Protocol): agent client protocol.
Why another ACP library?
- Checked against upstream. The models are hand-written, but every release pins
an upstream schema release (
schema/v1,schema/v2) and a conformance check compares the models with it: fields, required/optional, nullability, limits, enums, union variants and methods. Known differences are documented with a reason. - v1 and v2. v2 lives next to v1 (
aclientp.schema.v2,aclientp.v2), andRoutedAgentConnectionserves a client with the v1 or v2 agent, chosen by itsinitializerequest, like the official TypeScript SDK's router. - Typed throughout. Pydantic models,
mypy --strict, discriminated unions with fallback variants that keep unknown fields (so custom and future messages survive a round trip). - Small core. pydantic, anyio, anyenv, httpx, structlog and upathtools; web servers, WebSockets and tracing are extras.
Installation
uv add aclientp
| Extra | Adds |
|---|---|
websocket |
WebSocket transport |
http2 |
HTTP/2 for the Streamable HTTP client |
bridge |
HTTP server transport, aclientp-bridge: expose a stdio agent over HTTP / WebSocket |
debug |
aclientp-debug-server: a mock agent with a web UI |
tracing |
logfire spans for handled requests |
Quick start
A v1 agent over stdio
import anyio
from aclientp import Agent, run_agent
from aclientp.schema import (
InitializeRequest,
InitializeResponse,
NewSessionRequest,
NewSessionResponse,
PromptRequest,
PromptResponse,
)
class EchoAgent(Agent):
async def initialize(self, params: InitializeRequest) -> InitializeResponse:
return InitializeResponse(protocol_version=1)
async def new_session(self, params: NewSessionRequest) -> NewSessionResponse:
return NewSessionResponse(session_id="session-1")
async def prompt(self, params: PromptRequest) -> PromptResponse:
return PromptResponse(stop_reason="end_turn")
anyio.run(run_agent, EchoAgent())
Serving v1 and v2
from aclientp.router import RoutedAgentConnection
from aclientp.stdio import stdio_streams
async def main() -> None:
stdin, stdout = await stdio_streams()
conn = RoutedAgentConnection(stdout, stdin, v1=MyV1Agent(), v2=MyV2Agent)
await conn.wait_closed()
A v2 agent subclasses aclientp.v2.agent.Agent and overrides the methods it supports;
the rest answer -32601. v2 models follow the v2 patch rules: optional fields default
to MISSING and are left out, None is sent as null. Serialize with to_wire and
test fields with is_set (MISSING is truthy).
Remote agents over Streamable HTTP (experimental)
connect_remote_transport is the client side of ACP's remote transports (the
"Streamable HTTP & WebSocket Transport" RFD), compatible with the TypeScript SDK's
experimental server: http(s):// URLs use Streamable HTTP (connect_http_transport),
ws(s):// URLs the WebSocket transport (connect_websocket_transport, needs the
websocket extra). It yields byte streams like a stdio agent's:
from aclientp import connect_remote_transport
from aclientp.client.connection import ClientSideConnection
async with connect_remote_transport(url, headers={"X-API-Key": key}) as (reader, writer):
conn = ClientSideConnection(lambda agent: MyClient(), writer, reader)
await conn.initialize(InitializeRequest(protocol_version=1))
Serving an agent the same way (Streamable HTTP and WebSocket on one endpoint, compatible with the TypeScript SDK's experimental clients):
from aclientp import HttpTransport, serve
from aclientp.http_server import bearer_token_auth
auth = bearer_token_auth(token)
await serve(lambda conn: MyAgent(conn), HttpTransport(host="0.0.0.0", port=8765, authenticate=auth))
aclientp-bridge -- my-agent --flag serves a stdio agent this way, one subprocess per
connection.
For clients that only launch local agents, aclientp-connect relays stdio to a remote
agent (either transport, by URL scheme). Header values may reference environment
variables:
{
"command": "uvx",
"args": ["--from", "aclientp[http2]", "aclientp-connect", "https://example.com/api/acp",
"-H", "X-API-Key: ${MY_API_KEY}"],
"env": { "MY_API_KEY": "..." }
}
Staying in sync with upstream
uv run python -m aclientp.schema_reference latest # pinned vs newest tag
uv run python -m aclientp.schema_reference sync --dry-run # changelog of the newest tag
uv run python -m aclientp.schema_reference sync # pin it
uv run python -m aclientp.schema_reference check # models vs pinned schema
uv run python -m aclientp.schema_reference refs # changes in reference implementations
Use --protocol 2 for v2. schema/<version>/conformance.toml lists renames and known
differences; the test suite runs the same check, so undocumented drift fails CI.
schema/references.toml pins reference implementations (the official TypeScript SDK
and claude-agent-acp) by commit; refs lists the upstream commits since each pin with
a compare link.
Status
v1 follows schema-v1.33.0, v2 follows the draft schema-v2.0.0-alpha.17. The v2
API is unstable and follows the draft as it changes.
Metadata
Release files for aclientp 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aclientp-0.1.7.tar.gz | 177.2 kB | Without provenance | Details for aclientp-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aclientp-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for aclientp-0.1.7-py3-none-any.whl |
Total release size: 401.3 kB
Release files / aclientp-0.1.7.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | aclientp-0.1.7.tar.gz |
|---|---|
| Size | 177.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6f60c4505d51031c3dad7fa7382371aec541f50393e9b7948cf586407544503
|
|
BLAKE2b-256 checksum How to use checksums |
9d058a15561973f0dc900bacb9be647f40ab459a5ffacdef8581fa104c7978fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / aclientp-0.1.7-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | aclientp-0.1.7-py3-none-any.whl |
|---|---|
| Size | 224.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65c82a7222bbfa2690b3536b02cd00a4192dc67b0333deb33856474b37cf525d
|
|
BLAKE2b-256 checksum How to use checksums |
1cee7e0b7a664575b2b1432fe77fb7149ba67af6be0a088aa38dcef5e072caa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for aclientp 0.1.7
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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 0.1.1 2 files With provenance
- Added 0.1.7 2 files Without provenance
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.