ACP v2 (Preview) TypeScript SDK — UNSTABLE - v2.12.1
    Preparing search index...

    Class McpOverAcpCaller

    Calls MCP servers that an ACP peer declared with "type": "acp".

    Create one caller per app and register handleNotification for mcp/message notifications so progress and subscription events reach the request that owns them:

    const mcp = new McpOverAcpCaller({ clientInfo: { name: "my-agent", version: "1" } });
    agent()
    .onNotification(methods.agent.mcp.message, mcp.handleNotification)
    .onRequest(methods.agent.session.prompt, async ({ client }) => {
    const outcome = await mcp.request(client, serverId, "tools/call", { name, arguments: {} });
    // ...
    });
    Index
    • Sends one MCP request to a declared server over the connection behind context, and returns its inner outcome.

      Required MCP 2026-07-28 metadata is added to params._meta unless already present. Outer ACP failures, including cancellation and binding errors, reject with a RequestError; inner MCP errors resolve as { error }.

      options.sessionId and options.toolCallId name the ACP session and tool call the request is sent for. A toolCallId without a sessionId rejects before anything is sent.

      Parameters

      Returns Promise<McpOutcome>