Skip to content

feat: host MCP Apps from ACP clients - #813

Open
Blankeos wants to merge 2 commits into
agentclientprotocol:mainfrom
Blankeos:mcp-apps
Open

Blankeos wants to merge 2 commits into
agentclientprotocol:mainfrom
Blankeos:mcp-apps

Conversation

@Blankeos

@Blankeos Blankeos commented Nov 26, 2026 •

Copy link
Copy Markdown

Why

MCP servers increasingly ship an app with their tools: a chart for an analytics query, a map for a location search, a form to confirm an order, a picker to choose between results. Hosts like Claude, ChatGPT, VS Code and Goose already show these next to the tool call. An ACP client today only gets the text summary, so a user of an editor, a desktop chat app or a phone client built on ACP gets "Here are 3 flights" instead of the flight picker the server built.

With this extension, any ACP client can show the same app, and the app's buttons work: they run the server's tools through the agent's live session, with the client asking the user first when a call isn't read-only. Nothing changes for clients that don't opt in.

Before and after: a minimal ACP client showing the get-time tool call as text only (before) and with its MCP App rendered (after)

A minimal demo ACP client, using the get-time example from ext-apps, with real output from this branch.

Summary

MCP Apps (SEP-1865) lets an MCP tool declare a ui:// resource that the host shows next to the tool's result, in a sandboxed frame that can call the server's tools. Codex already supports this in its app server: MCP tool call items carry mcpAppUi, and the app server serves mcpServer/resource/read and mcpServer/tool/call. An ACP client has no way to reach any of it yet.

This PR passes that support through to ACP clients with a small, opt-in extension. It uses only _meta and _-prefixed methods, so clients that don't declare it see no change apart from one new key in the agent's initialize _meta.

  • Capability. The client declares _meta.mcpApps: {version: 1} in its initialize capabilities. The agent advertises _meta.mcpApps: {version, resourcesRead, toolsCall}, in agentCapabilities._meta on v1 and capabilities._meta on v2.
  • _meta.mcpApp on app tool calls. A finished mcpToolCall with a ui:// resource (mcpAppUi.resourceUri, or the older mcpAppResourceUri) gets {server, tool, resourceUri, toolResult} on its completion report, or on its tool_call when a session is replayed. It is sent only to clients that declared the capability, on v1 (AIR and standard reports) and v2.
  • _session/mcp/resources/read maps to mcpServer/resource/read on the session's thread. It is limited to ui:// URIs and passes an optional toolCallId on as originCallId.
  • _session/mcp/tools/call maps to mcpServer/tool/call on the session's thread. Its result goes to the client, not the model. Codex runs these calls without an approval, so checkPermissions: true is refused with Invalid request instead of running unchecked. The client can then ask the user itself.

The same extension is proposed for claude-agent-acp, so a client can host apps for both agents the same way. The full description is in docs/mcp-apps.md.

Changes

  • src/McpApps.ts: the capability, the _meta.mcpApp builder from the thread item, the request parsers, and the result mapping.
  • src/tool-calls/ClientCapabilities.ts, ToolFacts.ts, AcpToolCallRenderer.ts, reporters/McpToolReporter.ts: a new mcpApp fact, rendered as _meta.mcpApp for clients with mcpApps.
  • src/CodexAppServerClient.ts: mcpResourceRead and mcpServerToolCall.
  • src/CodexAcpServer.ts, src/AcpAgentRouter.ts: the capability in initialize, and the two methods on v1 and v2.
  • src/__tests__/McpApps.test.ts: unit tests.
  • src/__tests__/scenarios/baseline.ts: _meta.mcpApps in initialize is an allowed difference from the baseline. The AIR golden files and the initialize fixtures change only in that key.
  • docs/mcp-apps.md.

Testing

  • npm run typecheck and npm run build pass.
  • npm test: 2807 passed, 0 failed.
  • End to end, with Codex 0.172.0 and @modelcontextprotocol/server-basic-vanillajs (the get-time app from ext-apps) over stdio, on ACP v1 and v2. The model turn ran against a local stub of the Responses API that calls get_time in the mcp__basic namespace. Results:
    • initialize advertises the capability;
    • the call gets _meta.mcpApp with server: "basic", tool: "get-time", resourceUri: "ui://get-time/mcp-app.html" and the full result, including structuredContent;
    • _session/mcp/resources/read returns the 243,811-character text/html;profile=mcp-app page;
    • _session/mcp/tools/call returns structuredContent;
    • checkPermissions: true is refused, an unknown tool fails with Codex's message, and a non-ui:// read is refused;
    • the two methods send no session updates.

Notes

  • When auto review declines or fails an app tool call, _meta.mcpApp still comes, with the review's message as an isError result. The frame can show the failure.
  • An unknown tool comes back from mcpServer/tool/call as an Internal error with data.details, not as an isError result.
  • Out of scope for version 1: streaming tool input to the frame, the frame adding to the model's context, and hiding app-only tools (_meta.ui.visibility) from the model.

Adds an extension that lets an ACP client show MCP Apps (SEP-1865) for the
MCP servers that the agent connects to:

- `_meta.mcpApp` on the tool call of a tool with a `ui://` resource: the
  server, the tool, the resource and the server's own result;
- `_session/mcp/resources/read`: reads the `ui://` resource through the agent;
- `_session/mcp/tools/call`: runs a tool for the app on the live session,
  with the result kept out of the model's context.

The client opts in with `_meta.mcpApps: {version: 1}` in its initialize
capabilities; the agent advertises the methods in its own. See
docs/mcp-apps.md.
Adds `_session/mcp/tools/list`: the tools of one MCP server of the session
with their annotations and MCP Apps `_meta.ui`, so a host can run an app's
read-only calls at once and ask the user about the others. Advertised as
`toolsList` in `_meta.mcpApps`.

This branch has not been deployed

No deployments
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