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

    Type Alias McpRequestHandler

    McpRequestHandler: (context: McpOperationContext) => MaybePromise<McpOutcome>

    Handles one MCP request for a registered server.

    Return the MCP outcome. Throw an McpProtocolError to answer with an inner MCP error. Any other thrown error, including a RequestError, is reported as an outer binding failure (-33002), or as -32800 when the request was cancelled.

    Whether a request is served at all is decided before the handler runs, by McpServerOptions.admit. A handler can still throw an McpSessionError before it does any of the request's work, and the caller gets an outer -32602.

    Type Declaration