Skip to main content

Simple ACP Client

Simple ACP Client is a Python SDK for the Agent Client Protocol (ACP), providing a high-level, async-friendly interface for interacting with ACP-compatible agents. Build powerful agent-based applications with support for streaming messages, terminal operations, and filesystem capabilities.

Features

Requirements

  • Python 3.12 or higher
  • agent-client-protocol>=0.6.3

Installation

Install Simple ACP Client using pip:

pip install simple-acp-client

Or with uv:

uv add simple-acp-client

Quick Start

Here's a simple example to get you started:

import asyncio
from simple_acp_client.sdk.client import PyACPSDKClient, PyACPAgentOptions

async def main():
    # Configure the agent options
    options = PyACPAgentOptions(
        model="claude-sonnet-4-5",  # Optional: specify model
        cwd="/path/to/working/directory"  # Optional: set working directory
    )

    # Create and connect the client
    async with PyACPSDKClient(options) as client:
        await client.connect(["codex-acp"])  # Path to your ACP agent

        # Send a query and stream responses
        await client.query("What files are in the current directory?")

        async for message in client.receive_messages():
            if hasattr(message, 'text'):
                print(f"Agent: {message.text}")
            elif hasattr(message, 'thinking'):
                print(f"[Thinking]: {message.thinking}")

asyncio.run(main())

Core Concepts

PyACPSDKClient

The main client class that manages connections to ACP agents and handles protocol operations.

Key Methods

  • connect(agent_command): Establish connection to an ACP agent
  • query(prompt): Send a prompt to the agent (non-blocking)
  • receive_messages(): Stream messages from the agent until end of turn
  • interrupt(): Cancel the current agent operation
  • disconnect(): Close the connection and cleanup resources

Example Usage

from simple_acp_client.sdk.client import PyACPSDKClient, PyACPAgentOptions

# Initialize with options
options = PyACPAgentOptions(
    model="claude-sonnet-4-5",
    cwd="/workspace",
    env={"DEBUG": "true"}
)

client = PyACPSDKClient(options)

# Connect to agent
await client.connect(["path/to/agent", "--arg1", "--arg2"])

# Send query
await client.query("Analyze this codebase")

# Receive streaming responses
async for message in client.receive_messages():
    # Handle different message types
    print(message)

# Cleanup
await client.disconnect()

PyACPAgentOptions

Configuration options for the ACP agent connection.

Fields

  • model (str | None): Model identifier to use (e.g., "claude-sonnet-4-5")
  • cwd (str | Path | None): Working directory for the agent session
  • env (dict[str, str]): Environment variables for the agent process
  • max_turns (int | None): Maximum number of conversation turns
  • agent_program (str | None): Path to ACP agent executable
  • agent_args (list[str]): Arguments to pass to the agent program

Capabilities: Terminal (create/manage sessions, buffer output, exit/signals) and secure filesystem (read/write text files, absolute paths) are supported natively via the ACP protocol.

ACP Agent Compatibility

PyACP is compatible with ACP agents that implement the Agent Client Protocol. Popular agents include:

  • Codex ACP: npm install @zed-industries/codex-acp
  • Claude Code ACP: npm install -g @zed-industries/claude-code-acp

TODO

  • Right now the code in scripts always gives full capabilities to the agent, so only run it in docker/heavy sandboxing.

Release files for simple-acp-client 0.1.6

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

Source distribution (sdist)

Source distribution for simple-acp-client 0.1.6
File Size Uploaded
simple_acp_client-0.1.6.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-acp-client 0.1.6
File Interpreter ABI Platform
simple_acp_client-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / simple_acp_client-0.1.6.tar.gz

Download URL simple_acp_client-0.1.6.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8f23d3e2ad2a3584899111b3c79f65821114ada1eb3d7cd220c3bf5eda4cd97f
BLAKE2b-256 checksum
How to use checksums
06361df716b4c7afa4b9ed596c830e4e1d95c8bd01a9b162db9e784043e26c6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / simple_acp_client-0.1.6-py3-none-any.whl

Download URL simple_acp_client-0.1.6-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb916fc457492742866ee9acadb36b686bf35057de72ee77888e7a9aa02104ea
BLAKE2b-256 checksum
How to use checksums
a7d5f17b3051b726a0dfc2aadae388e860f96e3407efccc539b671b7f0f33cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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