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

    Type Alias McpOperationContext

    Context passed to an MCP-over-ACP server handler for one operation.

    type McpOperationContext = {
        serverId: string;
        requestId: string;
        method: string;
        params: Record<string, unknown> | undefined;
        protocolVersion: string;
        clientCapabilities: Record<string, unknown>;
        clientInfo: unknown;
        sessionId: string | undefined;
        toolCallId: string | undefined;
        envelopeMeta: Record<string, unknown> | undefined;
        signal: AbortSignal;
        notify(
            method: string,
            params?: Record<string, unknown> | null,
        ): Promise<void>;
    }
    Index
    serverId: string

    The declared server receiving this request.

    requestId: string

    The caller's logical MCP request ID, also the inner JSON-RPC ID.

    method: string

    Inner MCP method, such as tools/call or server/discover.

    params: Record<string, unknown> | undefined

    Inner MCP params. null and omission are both undefined.

    protocolVersion: string

    MCP protocol version from the inner _meta.

    clientCapabilities: Record<string, unknown>

    MCP client capabilities from the inner _meta.

    clientInfo: unknown

    MCP client info from the inner _meta, if supplied.

    sessionId: string | undefined

    The ACP session whose work caused this request, if the caller named one. For a child session's work it is the child's ID. undefined means the caller named no session, not that there is none.

    It is a statement by the caller, not a credential. Before a request acts on a session by it, check that the session is active on this connection, or an announced child of an active session, and that this server was declared to it or to one of its ancestors. Make that check, and the decision that a request needs a session at all, in McpServerOptions.admit, which runs before the handler.

    toolCallId: string | undefined

    The tool call in that session that this request is part of, if the caller named one: the toolCallId of a tool call it reports in session/update. The report can arrive after this request. Only set with sessionId.

    envelopeMeta: Record<string, unknown> | undefined

    Optional outer ACP metadata from the envelope.

    signal: AbortSignal

    Aborts when the caller cancels this request, the server registration is disposed, or the ACP connection closes.

    • Sends an MCP notification scoped to this request. Notifications sent after the request has completed are dropped.

      Parameters

      • method: string
      • Optionalparams: Record<string, unknown> | null

      Returns Promise<void>