Skip to content

Agent: accept client stdio MCP servers over ACP - #1622

Merged
AnthonyRonning merged 1 commit into
masterfrom
acp-stdio-mcp
Nov 17, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
acp-stdio-mcp

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Lets ACP clients attach stdio MCP servers in session/new and session/load. Maple refused them, so the session never opened for clients that send one: T3 Code and Buzz's buzz-acp both hit this (#1606).

Why the refusal goes. It guarded against running caller-supplied code on the host. But the ACP caller is always a local program that started maple-agent acp over a pipe, so it can already run commands as the same user. The stable ACP spec also requires agents to support stdio MCP servers; HTTP is the optional one.

What changes

  • A client's stdio server starts through the existing host-owned stdio lifecycle: the task's folder, the login shell's PATH, its own process group, and stopped on detach like the HTTP bindings.
  • The stdio transport gains an optional exact argv. A client sends a program and an argument list, not a typed command line, so the words are used as given, with no splitting and no ~ expansion. Saved servers keep their typed line and behave as before.
  • Only the program is kept as the server's shown command. Arguments may hold secrets and stay in argv.
  • Legacy SSE servers are still refused.

Decisions for review

  • The protected environment variables (PATH, loader variables and the like) apply to a client's server too, as they do to one configured in Maple. A client that sends one of them gets session/new refused with a message naming the variable.
  • There is no owner opt-in. ACP: investigate opt-in client-supplied stdio MCP support #1606 proposed one; this accepts stdio from any ACP client, for the reason above. The one case it does not cover is a sandboxed editor using an unsandboxed Maple host.

Rebased onto #1618, which added MCP over the ACP connection and per-model reasoning levels and kept stdio refused. Its two stdio-refusal tests are replaced by the acceptance tests here, and a session can now carry HTTP, stdio and acp servers together.

Refs #1606

Testing

  • New tests
    • A full ACP session that attaches a real stdio server, calls its tool, and checks the server got its exact arguments (one with a space and both kinds of quote) and environment, then stops when the client disconnects.
    • prepare_session_mcp keeps a stdio server's exact words, including an empty argument, and its environment.
  • Gates: just ci-lint, just ci-test and just ci-extra pass on macOS on the rebased tree (3,022 tests, 0 failed), with the MCP-over-ACP tests from Agent: serve MCP over ACP and model reasoning #1618 and the stdio tests passing together.
  • Live: a scripted ACP client against this build on a local stack attached a stdio server and a real model turn called its tool. The server saw the exact arguments, the client's environment variable and the task folder as its working directory, and was gone after the client closed the pipe.
  • Not tested: Windows and Linux (the end-to-end test is Unix-only and CI will run it on Linux), and T3 Code or buzz-acp themselves.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

ACP's stable spec requires agents to support stdio MCP servers;
Maple refused them, so session/new failed outright for clients
that send one (T3 Code, Buzz's buzz-acp). The refusal guarded
against running caller-supplied code on the host, but the ACP
caller is always a local program that started `maple-agent acp`
and can already run commands as the same user.

session/new and session/load now start a client's stdio server
through the existing host-owned stdio lifecycle: the task's
folder, the login shell's PATH, its own process group, the same
protected environment variables, and stopped on detach like the
HTTP bindings.

A client sends a program and argument list, not a typed command
line, so the stdio transport gains an optional exact `argv` that
is used as given, with no splitting or `~` expansion. Saved
servers keep their typed line. Only the program is kept as the
shown command, since arguments may hold secrets.

Refs #1606

Co-Authored-By: Claude <[email protected]>
@AnthonyRonning
AnthonyRonning merged commit 46cc82c into master Nov 17, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the acp-stdio-mcp branch November 17, 2026 15:32
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