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

    Class McpSessionError

    Rejects an MCP-over-ACP request because of its sessionId: the request has none and the server needs one, or the server's own check refuses the one it has.

    Throw it from a server's McpServerOptions.admit check, where McpAdmissionRequest.requireSession and McpAdmissionRequest.rejectSession throw it for you. The caller gets an outer ACP -32602 (Invalid params) with this error's message. It is not an inner MCP error, and not a binding failure (-33002).

    A McpRequestHandler can also throw it, before doing any of the request's work, with the same result. It has to reach the provider: the MCP SDK catches what a tool throws, so an McpSessionError thrown inside a tool registered through fromMcpServer becomes an ordinary tool error result.

    Hierarchy

    • Error
      • McpSessionError
    Index