Skip to main content

AClientP

PyPI License Package status Monthly downloads Distribution format Wheel availability Python version Implementation Releases Github Contributors Github Discussions Github Forks Github Issues Github Issues Github Watchers Github Stars Github Repository size Github last commit Github release date Github language count Github commits this month Package status PyUp

Read the documentation!

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), and RoutedAgentConnection serves a client with the v1 or v2 agent, chosen by its initialize request, 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
bridge 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).

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aclientp 0.1.1
File Size Uploaded Provenance Actions
aclientp-0.1.1.tar.gz 159.6 kB With provenance Details for aclientp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aclientp 0.1.1
File Interpreter ABI Platform Actions
aclientp-0.1.1-py3-none-any.whl Python 3 none any Details for aclientp-0.1.1-py3-none-any.whl

Total release size: 365.8 kB

Release files / aclientp-0.1.1.tar.gz

Download URL aclientp-0.1.1.tar.gz
Size 159.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5b0ea4825d65da9dda5a668da4dbb1d0bea44dfdb4781e805e4908ee87035b7d
BLAKE2b-256 checksum
How to use checksums
cc01e16f68121495bacf1b081036feb987c5330da2772f6be67bc4b0c5e8cfbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / aclientp-0.1.1-py3-none-any.whl

Download URL aclientp-0.1.1-py3-none-any.whl
Size 206.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42ed5b4c73f6f288201dea80c05bcba1a8e69ebe84c1ba063b4795ad86c971e2
BLAKE2b-256 checksum
How to use checksums
142adfba078edabd04c1b3a5c78cb708cb25192f6e737e790cb825358248218e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for aclientp 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aclientp-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page