buzz icon indicating copy to clipboard operation
buzz copied to clipboard

feat(acp): support remote HTTP MCP servers

Open custard-pirate opened this issue 4 months ago • 12 comments

Summary

  • extend the versioned typed MCP document from #4164 with a resolved transport: "http" variant
  • pass ACP Streamable HTTP MCP servers alongside stdio servers without adding a second configuration surface
  • validate adapter HTTP capability on initial startup, lazy wake-up, and every respawn before the pool becomes ready
  • redact stdio environment values, HTTP URLs, and HTTP header values from ACP wire logs and observer events

Dependency and scope

This PR is stacked directly on #4164. That PR owns the versioned document, stdio transport, ordering, validation, redaction foundation, and BUZZ_ACP_MCP_COMMAND compatibility input. The HTTP commits should be folded into #4164 before merge so schema version 1 ships with one stable meaning.

Concrete endpoints and credentials remain project-owned configuration. The shared launch document accepts only final resolved URLs and header values; secret-file and environment selectors are intentionally outside the shared schema.

Security and behavior

  • remote endpoints require HTTPS
  • plain HTTP is accepted only for credential-free literal IPv4 or IPv6 loopback endpoints
  • header values must be non-empty and free of control characters
  • credential-bearing values use redacted Debug implementations and are removed from wire logging and observer frames
  • fallback substring redaction ignores short and common public values to avoid corrupting unrelated diagnostics
  • runtimes without advertised HTTP MCP support fail closed before the pool is marked ready
  • legacy name collisions are checked across both stdio and HTTP servers
  • transport support does not bypass adapter-local tool approval; deployments must pre-authorize only the required per-agent tools and fail closed

Validation

  • cargo test -p buzz-core --lib — 257 passed
  • cargo test -p buzz-acp --lib — 737 passed
  • cargo test -p buzz-acp --test config_env — passed
  • cargo clippy -p buzz-core -p buzz-acp --all-targets -- -D warnings
  • cargo fmt --all --check
  • git diff --check

The fake-adapter coverage includes the exact mixed legacy-stdio plus HTTP session/new payload. Release acceptance additionally requires exercising a harmless tool through each transport with a real adapter and publishing through constrained send.

custard-pirate avatar Aug 02 '26 07:08 custard-pirate

@custard-pirate, I had already built #4164 before I came across this PR. It covers named stdio MCP servers, isolated per-server environments, compatibility with the existing command setting and secret-safe launch configuration. This PR covers remote HTTP transport, so the work is complementary, but both currently define the configuration shape that reaches ACP.

The practical win is one reviewable configuration for both local and hosted tools, with credentials scoped to the individual server. I think the clean merge is a single versioned typed document with stdio and http transports, while BUZZ_ACP_MCP_COMMAND remains a compatibility input rather than a second permanent schema. Projects should own concrete endpoints and credentials; portable agent templates should declare logical tool requirements.

I opened #4301 with the broader product shape and proposed PR split. I would like to align these schemas rather than leave Buzz with two permanent configuration surfaces.

wolfyy970 avatar Aug 02 '26 11:08 wolfyy970

Thanks — agreed. A single versioned, typed MCP configuration with stdio and http transports is a cleaner long-term shape than introducing parallel configuration surfaces. Keeping BUZZ_ACP_MCP_COMMAND as a compatibility input also makes sense.

I’m happy to align #4271 with #4164. I’ll review its configuration model and #4301 in more detail, then we can coordinate the shared types and PR boundary so the two changes remain complementary. In particular, I’d like to preserve per-server credential isolation for HTTP servers without putting concrete endpoints or secrets into portable agent templates.

custard-pirate avatar Aug 02 '26 15:08 custard-pirate

Thanks. I have rebased #4164 and tagged every config entry with its transport. Version 1 remains stdio-only, so #4271 can add HTTP to the same document. Concrete endpoints and credentials should stay with Project connections, outside portable agent templates.

wolfyy970 avatar Aug 03 '26 15:08 wolfyy970

Thanks — I’ve reviewed the rebased #4164 and I’m aligned with this boundary. The tagged ConfiguredMcpServer enum provides the extension point #4271 needs.

Assuming the maintainers are happy with that division of work, I’ll adapt #4271 to add HTTP as another transport in the same versioned document, reusing the existing config path, ordering, validation, and redaction behavior rather than retaining a separate HTTP configuration surface.

Concrete URLs, headers, and credentials will remain Project-owned and outside portable agent templates. I’ll also ensure HTTP credential values receive the same no-log/no-diagnostics treatment as stdio environment values.

custard-pirate avatar Aug 04 '26 04:08 custard-pirate

@wolfyy970 I have updated #4271 on top of the current #4164 head and removed the separate HTTP configuration surface.

The HTTP transport now extends the same versioned ConfiguredMcpServer document and reuses its ordering, validation, compatibility, and redaction behavior. The HTTP-specific commit is 981d39ad3; the PR remains draft while the stack evolves.

The local validation is green: 703 buzz-acp library tests, Clippy with warnings denied, formatting, and diff checks. Please flag any place where this has drifted from the schema or boundary you intend for #4164.

custard-pirate avatar Aug 05 '26 16:08 custard-pirate

@wpfleger96 @tlongwell-block an open question here is if buzz-agent is intended to gain HTTP MCP, or is remote MCP deliberately harness-only? That answer decides whether the client-side work is worth anyone building (have this done btw, ~150 LoC)

I think it'd be great to configure tools once in Buzz and bind them to a team instead of hand-wiring each agent's harness config - which I think is the same direction #4735 is heading 🚀

RowanAldean avatar Aug 05 '26 21:08 RowanAldean

Not harness-only. buzz-acp should resolve the server list and pass it in session/new; the ACP agent owns the MCP session. buzz-agent already owns the stdio lifecycle, so HTTP belongs beside it there.

I’m retiring #4735 as the implementation branch and restacking the binding work around the relay-canonical agent path in #4940. The useful seam remains: Project setup resolves into the same MCP document for any runtime. If your client work is ready, please put it up against #4271’s HTTP transport.

wolfyy970 avatar Aug 05 '26 22:08 wolfyy970

Thanks for aligning this. I have replaced #4164 with the reviewed four-commit stack on current main. The ConfiguredMcpServer shape and stdio boundary are unchanged; only the commit IDs changed because I removed the repair history.

The stack now includes a real two-server, two-session agent proof. Please rebase your HTTP commit onto the new #4164 head and I will review it against the shared validation and redaction cases.

wolfyy970 avatar Aug 06 '26 00:08 wolfyy970

Rebased onto the replacement #4164 four-commit stack at 780561c85. HTTP is now an additional variant of the shared buzz-core MCP launch document; harness-only URL/header credential resolution, ACP capability gating, and wire/observer redaction remain in place. Local validation passed: 713 buzz-acp unit tests, 256 buzz-core unit tests, strict Clippy for both crates with warnings denied, formatting, and diff checks. The HTTP commit is now ddce72035 and is ready for the requested review against the shared validation and redaction cases.

custard-pirate avatar Aug 06 '26 05:08 custard-pirate

@wolfyy970 — #4271 has now been updated and rebased onto the replacement #4164 head at 780561c85. The HTTP change is the single child commit ddce72035 and extends the shared buzz-core ConfiguredMcpServer document rather than defining a parallel schema. The affected suites are green: 713 buzz-acp tests, 256 buzz-core tests, strict Clippy with warnings denied, formatting, and diff checks. It is ready for your requested review against the shared validation and redaction cases.

custard-pirate avatar Aug 06 '26 05:08 custard-pirate

@wolfyy970 Thank you for the careful review — the security, lifecycle, and composition notes were very helpful.

We addressed the findings in signed commit 749ef0c628e3e8923fe8e9bd12a74ee7f72e795c:

  • removed secondary file/environment secret selectors from the shared v1 schema; it now accepts only final resolved URLs and header values
  • require HTTPS except for credential-free literal IPv4/IPv6 loopback HTTP, rejecting RFC1918/ULA cleartext and URL userinfo or headers on loopback
  • reject empty/control-bearing final header values and redact HTTP URLs/header values from Debug, wire logs, and observer events
  • constrained fallback substring redaction so short/common values cannot corrupt unrelated diagnostics
  • validate HTTP capability during initial startup, lazy wake-up, and every respawn before the pool is marked ready
  • include HTTP entries in the legacy-name collision check
  • added a fake-adapter test asserting the exact mixed legacy-stdio plus HTTP session/new payload

Our additional deployment findings were that transport negotiation and tool approval need to remain separate fail-closed gates: unattended agents must pre-authorize only the required tools per agent/server, without a global dontAsk bypass. We also found that config parsing and model completion alone are insufficient acceptance evidence. The release gate now calls a harmless tool through both legacy stdio and structured HTTP using the real adapter, then verifies publication through constrained send. This specifically guards against the mixed-session failure mode where the legacy stdio tools were absent despite the HTTP server being configured.

Validation is clean: 257 buzz-core tests, 737 buzz-acp tests, config_env, formatting, Clippy with -D warnings, and git diff --check all pass. DCO also passes on the updated PR.

I agree that HTTP should be folded into #4164 before either PR merges so v1 never changes meaning. GitHub denied this account permission to fast-forward your fork branch (403), so I left the exact two signed commits and validation handoff on #4164: 3204b925970a38265d96bfb5a54c11736832e814 followed by 749ef0c628e3e8923fe8e9bd12a74ee7f72e795c. Once they are applied there, this PR can be closed as superseded.

custard-pirate avatar Aug 06 '26 15:08 custard-pirate

I folded 3204b925 and 749ef0c6 into #4164, rebased the combined series onto current main, and ran the full repository gate. Thanks for the clean handoff. This PR can now close as superseded by #4164.

wolfyy970 avatar Aug 07 '26 12:08 wolfyy970

Closing as superseded by #4164, which now includes the HTTP MCP transport and hardening commits from this PR on the shared configuration model. Thanks @wolfyy970 for the careful review, schema alignment, integration work, and full-repository validation — your help made this a much stronger and cleaner result.

custard-pirate avatar Aug 07 '26 14:08 custard-pirate