Skip to content

feat(agent-acp): support remote HTTP and SSE MCP servers - #19

Merged
huntharo merged 3 commits into
mainfrom
feat/agent-acp-http-mcp
Aug 8, 2026
Merged

feat(agent-acp): support remote HTTP and SSE MCP servers#19
huntharo merged 3 commits into
mainfrom
feat/agent-acp-http-mcp

Conversation

@huntharo

@huntharo huntharo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

I made @pwrdrvr/agent-acp authoritative for ACP v1 MCP server configuration
across stdio, streamable HTTP, and HTTP+SSE transports.

I added:

  • a backward-compatible public MCP config union plus exact pinned-protocol wire types
  • env/header normalization from records or { name, value }[] collections
  • explicit HTTP/SSE capability normalization and gating helpers
  • per-thread MCP forwarding for session/new, session/load, and the existing reopenThread path
  • pooled-client isolation for MCP payloads and approval-policy server names
  • lifecycle error redaction for HTTP URLs, header values, and stdio env values
  • a minor Changeset and consumer migration documentation

The pinned @zed-industries/agent-client-protocol@0.4.5 exposes session/new
and session/load, but no separate session/resume, so I did not invent a
hot-reconfiguration or resume method outside the ACP spec.

Why

PwrAgent currently carries its own ACP stdio/HTTP/SSE union and capability gate,
while PwrSnap is constrained by the stdio-only public type in
@pwrdrvr/agent-acp@0.12.2. This change lets both hosts use the shared package
for per-thread remote HTTP MCP injection without another custom ACP client or an
HTTP-to-stdio shim.

Migration notes

PwrAgent

I expect PwrAgent to replace its local MCP config union with
AcpMcpServerConfig. Existing HTTP/SSE
headers: Array<{ name, value }> values are accepted unchanged. It can keep
gating through the normalized agentCapabilities.mcp.http / .sse data or use
acpRuntimeSupportsHttpMcp, acpRuntimeSupportsSseMcp,
client.supportsHttpMcp(), and client.supportsSseMcp().

PwrSnap

I expect PwrSnap to pass its selected MCP list per thread through
startThreadNative, reopenThread, or loadThreadNative. A shared
AcpAgentClientPool remains safe: session payloads and approval context contain
only that thread's configured servers.

Stdio callers need no migration. Their existing
{ name, command, args?, env?: Record<string, string> } inputs remain valid.

Verification

I verified the complete repository CI sequence locally:

  • pnpm lint:licenses
  • pnpm lint:deps
  • pnpm lint:boundaries
  • pnpm build
  • pnpm typecheck
  • pnpm test — 296 passing, 1 pre-existing skip

The focused agent-acp suite has 146 passing tests, including exact validation
against the pinned ACP mcpServerSchema, HTTP/SSE lifecycle payloads,
capability gating, pooled two-thread isolation, in-flight session/load history
replay and rollback, and credential redaction/non-logging.

@huntharo
huntharo marked this pull request as ready for review August 8, 2026 17:47
@huntharo
huntharo merged commit 27157ba into main Aug 8, 2026
1 check passed
@huntharo
huntharo deleted the feat/agent-acp-http-mcp branch August 9, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant