GitHub Copilot CLI
The CopilotACPAdapter shipped in Band SDK Python 1.3.0 and is part of the acp extra. The Docker topologies below are deployment templates from the SDK repository. They require Docker, live Band credentials, and a Copilot-entitled GitHub token, so they are not exercised in CI.
The GitHub Copilot CLI exposes an ACP server with copilot --acp. CopilotACPAdapter drives that server from Band, so a Band participant is backed by Copilot. Copilot speaks vanilla ACP with no copilot/* extension methods, so no custom client profile is needed. For how ACP works and what the generic client adapter does, see ACP Overview and ACP Client Adapter.
Prerequisites
Complete the Setup tutorial first, then add the requirements specific to Copilot.
Install the ACP extra:
Install the Copilot CLI and make sure copilot is on your PATH. See Set up Copilot CLI.
Authenticate Copilot. The CLI resolves credentials in this order:
COPILOT_GITHUB_TOKENGH_TOKENGITHUB_TOKEN- A stored
copilot login(OS keychain, or<COPILOT_HOME>/config.json, default~/.copilot) - An authenticated
ghCLI - BYOK, your own LLM provider keys, with no GitHub token needed
Add an agent entry named copilot_acp_agent to agent_config.yaml:
A Copilot-entitled token must be a v2 fine-grained PAT with the “Copilot Requests” permission, or a Copilot / gh OAuth token. Classic ghp_ and Actions ghs_ tokens are rejected.
Connect Copilot CLI Locally
In the local setup the adapter spawns copilot --acp as a subprocess over stdio and injects Band tools through a loopback HTTP/SSE MCP server that Copilot calls over ACP.
Run it:
Environment variables
Configuration reference
CopilotACPAdapterConfig is a frozen dataclass passed as the adapter’s first argument.
The adapter also accepts additional_tools and features as keyword arguments.
command (stdio) and host / port (TCP) are mutually exclusive. Setting a non-default command together with host or port raises ValueError. Over TCP the already-running server owns its own environment, so github_token and env are ignored and the adapter logs a warning.
Run in Docker
Both Docker topologies put Copilot in a container and connect the host-side Band SDK over TCP. Because Copilot cannot reach the SDK host’s loopback, both set inject_band_tools=False and point Copilot at a band-mcp server through an explicit mcp_servers entry.
Shared points for both topologies:
copilot --acp --port <N>binds127.0.0.1only and has no host-bind flag, so Docker port publishing cannot reach it. Both images front the stdio ACP server withsocat TCP-LISTEN:8080,fork,reuseaddr EXEC:"copilot --acp --allow-all-tools"on a routable port.,forkexecs a freshcopilot --acpper TCP connection, so a reconnect lands on a process with no prior in-memory sessions. The SDK replays the Band room’s transcript into the fresh session’s first prompt, so conversation context survives the restart.- band-mcp speaks the older MCP SSE transport at
/sse, not streamable HTTP, which is why themcp_serversentry is{"type": "sse", ...}. - band-mcp holds one Band identity,
BAND_AGENT_KEY, and MCP clients present no credentials. That key must be the same agent as the hostclient.pyuses,copilot_acp_agentinagent_config.yaml, or room tools return 404. - band-mcp rejects SSE requests with HTTP 421 unless the caller’s
Hostheader is allow-listed throughALLOWED_HOSTS. - band-mcp’s chat and message tools take a
chat_idargument per call. This differs from the in-processinject_band_toolspath, which injects aroom_idper tool. - The ACP port is published on
127.0.0.1only. Thiscopilot --acpis unauthenticated and runs--allow-all-tools, so expose it off-host only behind your own auth.
Sidecar (Compose)
Source: examples/acp/copilot_docker/compose/. Copilot and band-mcp are independent, separately scalable services on one compose network. This is the cloud-style topology.
The copilot service publishes 127.0.0.1:8080:8080 and depends on band-mcp. The band-mcp service only uses expose: 3000, so it is reachable inside the compose network and never published to the host. Compose sets ALLOWED_HOSTS='["band-mcp:*"]' for it, and points its BAND_BASE_URL at BAND_REST_URL.
BAND_AGENT_KEY must be a Band agent key (band_a_...), not a user key. The host client raises ValueError if it does not match copilot_acp_agent in agent_config.yaml.
Colocated
Source: examples/acp/copilot_docker/colocated/. Copilot and band-mcp run in one image. Copilot reaches Band tools over the container’s own loopback, and only the ACP port is published. This is the self-contained single unit with the simplest networking, one image, and no cross-service DNS.
entrypoint.sh requires GITHUB_TOKEN and BAND_AGENT_KEY, sets ALLOWED_HOSTS='["localhost:*","127.0.0.1:*"]' and BAND_BASE_URL="${BAND_REST_URL:-https://app.band.ai}", starts band-mcp on 127.0.0.1:3000, then execs socat.
Choosing between them
Both clients default COPILOT_ACP_CWD to / because the ACP server runs in a container. Set another path only when it exists inside the Copilot container.
Run in a Docker Sandbox
examples/acp/copilot_sandbox/ runs the Copilot CLI inside a Docker microVM sandbox (sbx) and drives it over ordinary stdio, with no TCP, no socat, and no port publishing. It adds microVM isolation, a host-side secret proxy so the GitHub token never enters the sandbox, and an auditable default-deny egress firewall.
One-time setup:
The adapter drives the sandbox through its command:
SBX_SANDBOX names the sandbox and SBX_WORKSPACE is the absolute workspace path, which with sbx’s direct mount is also the in-sandbox cwd. Set BAND_MCP_SSE_URL=http://127.0.0.1:3000/sse only when the sandbox was created with the included band-mcp-kit, which installs band-mcp and starts it on the sandbox’s loopback.
Use sbx exec -i, not sbx run. -i keeps STDIN open with raw pipes, which keeps the ACP NDJSON stream byte-clean. sbx run allocates a PTY and prepends --yolo. Without the kit, this example is conversation relay only, because the sandbox’s egress firewall blocks the SDK host’s loopback MCP server.
Test Your Agent
Start the Bridge
Run the local client, or bring up a container and then run its client.py. You should see the bridge log that it is connecting to the Copilot ACP server.
Add the Agent to a Chat Room
Go to Band, open or create a multi-agent chat, and add your agent as a participant under the Remote section.