Skip to main content

acpremote

acpremote is the generic remote transport package for ACP.

It exposes any existing acp.interfaces.Agent over WebSocket and can also turn a remote ACP server back into a local ACP agent proxy. It can also mirror any stdio ACP command by spawning it as a child process.

This package is transport-only. Use it when the runtime already speaks ACP and you want to move that ACP surface across a WebSocket boundary. If the runtime is still a Pydantic AI or LangChain target that needs adapter dispatch, use acpkit instead.

Docs:

Latest stable install:

uv add acpremote
pip install acpremote

CLI

The acpremote executable exposes the same transport jobs as the Python API.

Use this mapping:

You have... Run... Meaning
an exposed remote WebSocket endpoint acpremote mirror ws://host:8080/acp/ws connect to the remote endpoint and expose it locally as stdio ACP
a local stdio ACP command acpremote expose -- <command> spawn the command and expose it over WebSocket
a native Python acp.interfaces.Agent acpremote serve module:agent load the ACP agent and expose it over WebSocket

If a client such as Toad asks for an ACP command for an already exposed WebSocket, give it the mirror command:

acpremote mirror ws://remote.example.com:8080/acp/ws

Expose a native ACP Python target:

acpremote serve my_app:agent --host 0.0.0.0 --port 8080

serve expects my_app:agent to resolve to an existing acp.interfaces.Agent. For Pydantic AI, LangChain, or LangGraph targets, use the root CLI so adapter dispatch stays explicit:

acpkit serve examples.langchain.workspace_graph:acp_agent --host 0.0.0.0 --port 8080

Expose a stdio ACP command:

acpremote expose --host 0.0.0.0 --port 8080 -- npx @zed-industries/codex-acp

Pass command-specific flags after --:

acpremote expose --cwd /srv/agent --env MODEL=gpt-5 -- python agent.py --stdio

Mirror a remote WebSocket endpoint back to local stdio ACP:

acpremote mirror ws://remote.example.com:8080/acp/ws

Register ACP 0.11 unstable client routes on that receiving upstream connection when the remote agent uses elicitation:

acpremote mirror ws://remote.example.com:8080/acp/ws --unstable-protocol

That is the direct acpremote equivalent of:

acpkit run --addr ws://remote.example.com:8080/acp/ws

Bearer tokens can be passed directly or read from an environment variable:

acpremote expose --token-env ACPREMOTE_TOKEN -- npx @zed-industries/codex-acp
acpremote mirror ws://remote.example.com:8080/acp/ws --bearer-token "$ACPREMOTE_TOKEN"

Server

Expose any ACP agent on the remote host:

from acpremote import serve_acp

server = await serve_acp(agent=my_acp_agent, host='127.0.0.1', port=8080)
await server.serve_forever()

Expose a stdio ACP command instead of an in-memory agent:

from acpremote import serve_command

server = await serve_command(
    ['npx', '@zed-industries/codex-acp'],
    host='127.0.0.1',
    port=8080,
)
await server.serve_forever()

env={...} overrides selected variables while inheriting the parent process environment. That keeps command lookup through PATH intact while still letting the caller inject tokens or runtime flags.

If you need command cleanup tuning, pass CommandOptions to serve_stdio_command(...):

from acpremote import CommandOptions, serve_stdio_command

server = await serve_stdio_command(
    CommandOptions(
        command=('npx', '@zed-industries/codex-acp'),
        terminate_timeout=2.0,
    ),
    host='127.0.0.1',
    port=8080,
)
await server.serve_forever()

When a command-backed WebSocket flow ends, acpremote terminates the child process and falls back to kill after terminate_timeout. The timeout must be a positive finite number.

Typical remote-host flow:

acpkit serve examples.langchain.workspace_graph:acp_agent --host 0.0.0.0 --port 8080
acpremote expose --host 0.0.0.0 --port 8081 -- npx @zed-industries/codex-acp

Typical local mirror flow:

acpkit run --addr ws://remote.example.com:8080/acp/ws
acpremote mirror ws://remote.example.com:8081/acp/ws

Default routes:

  • metadata: http://127.0.0.1:8080/acp
  • health: http://127.0.0.1:8080/healthz
  • websocket: ws://127.0.0.1:8080/acp/ws

Custom mount paths must not use /healthz, which is reserved for the health endpoint.

Client Proxy

Turn a remote ACP endpoint back into a local ACP agent:

from acp import run_agent
from acpremote import connect_acp

agent = connect_acp('ws://127.0.0.1:8080/acp/ws')
await run_agent(agent)

That pattern is what powers a local stdio ACP facade in front of a remote ACP server.

If you want a launcher to open that local facade, wrap the same mirror command with Toad:

toad acp "acpremote mirror ws://remote.example.com:8080/acp/ws"

When the remote server advertises a remote_cwd in its metadata, connect_acp(...) treats that directory as authoritative for session lifecycle calls. This keeps a mirrored local ACP server from accidentally sending the local machine's spawn directory back to the remote host. Metadata discovery uses TransportOptions.open_timeout; a timeout leaves metadata unavailable without blocking the WebSocket proxy indefinitely.

By default connect_acp(...) also treats host-backed capabilities as remote-owned. Local client filesystem and terminal capabilities aren't forwarded unless TransportOptions(host_ownership="client_passthrough") is set explicitly.

Transport Timing

ACP Python SDK 0.11 elicitation routes require an explicit opt-in on the client connection that receives elicitation/create. Use either public mirror CLI:

acpremote mirror ws://remote.example.com:8080/acp/ws --unstable-protocol
acpkit run --addr ws://remote.example.com:8080/acp/ws --unstable-protocol

For object-level mirrors, set TransportOptions(use_unstable_protocol=True) on connect_acp(...) or connect_remote_agent(...). A sending agent can use plain run_agent(...); it does not need an agent-side unstable flag merely to issue elicitation. Capability advertisement remains an independent requirement. serve_command() is a raw frame relay and follows the same receiver-side rule.

TransportOptions can attach proxy-observed latency information to the ACP stream:

from acpremote import TransportOptions, connect_acp

agent = connect_acp(
    'ws://127.0.0.1:8080/acp/ws',
    options=TransportOptions(
        emit_latency_meta=True,
        emit_latency_projection=True,
    ),
)

TransportOptions also controls host ownership policy:

  • host_ownership="remote" is the default
  • host_ownership="client_passthrough" re-enables forwarding local filesystem and terminal client capabilities

Available signals:

  • streamed updates can carry field_meta["acpremote"]["transport_latency"]
  • a visible Transport Latency ACP card can be emitted after each prompt turn

The metrics are proxy-observed timings, not synchronized end-to-end host clock measurements.

Transport Notes

Current transport behavior:

  • one WebSocket text message carries one ACP JSON message
  • binary frames are rejected
  • bearer-token auth is supported
  • stdio ACP commands can be mirrored with serve_command(...)
  • custom command cleanup timeouts are available through CommandOptions
  • transport limits are configurable through TransportOptions

This package is transport-focused. It doesn't assume ACP Kit adapters or ACP Kit-owned runtime semantics.

Security guidance:

  • bind to loopback unless a reverse proxy owns TLS and authentication
  • allowlist command-backed servers instead of accepting arbitrary command strings
  • keep environment overrides minimal and avoid forwarding unnecessary secrets
  • see https://vcoderun.github.io/acpkit/security/

Release files for acpremote 1.9.0

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

Source distribution (sdist)

Source distribution for acpremote 1.9.0
File Size Uploaded
acpremote-1.9.0.tar.gz 18.2 kB Details

Built distribution (wheel)

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

Total release size: 41.3 kB

Release files / acpremote-1.9.0.tar.gz

Download URL acpremote-1.9.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
97cf5973630d370b0780627a6f6e471e4bc911ad7566bcc30372d0f7ca49e88b
BLAKE2b-256 checksum
How to use checksums
b0a40e3fc9c0dd2a963d97a579e6592d2423dcac829bd9c5c1864706d686cc85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / acpremote-1.9.0-py3-none-any.whl

Download URL acpremote-1.9.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
233781b4db7cb838701ebf16830c9f64c0aad838048ddc5e121cd90dc820ad3f
BLAKE2b-256 checksum
How to use checksums
cfd71cad5ee654439d5cb07498b4a398ff8cf18cf29d1fe9399f6342ba4cb877
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

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