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

    Function assertSupportedMcpServers

    • Experimental

      Throws -32602 (Invalid params) for the first MCP server the agent cannot accept: one whose name repeats an earlier server's, whose transport the agent did not advertise in session.mcp, or whose stdio command is not an absolute path.

      Call it from session/new, session/resume, or session/fork handlers with the capabilities.session.mcp value the agent sent in its initialize response. Each server name must be unique within the list; a duplicate is rejected with error data { name }. A server is accepted only when its type is a transport key in that object with a non-null value, for example stdio with { stdio: {} }. Everything else is rejected, including v1's sse, unknown types, and custom _-prefixed types; agents that support a custom transport should handle those servers before calling this. The error data for a transport is { type } with the rejected server's transport.

      The command of a stdio server must be an absolute path. A relative one, such as npx or ./server, is rejected with error data { name, command }. This function does not know which machine the agent runs on, so it accepts a path that is absolute in POSIX or in Windows syntax: /usr/bin/server, C:\tools\server.exe, or \\host\share\server.exe. An agent that needs the native syntax of its own machine, for example to reject C:\tools\server.exe on Linux, checks that itself.

      Parameters

      • mcpServers: readonly McpServer[] | null | undefined
      • capabilities: McpCapabilities | null | undefined

      Returns void