mcp-use TypeScript API
    Preparing search index...

    Interface NodeServerResponseLike

    Minimal duck-typed shape of a Node.js ServerResponse.

    interface NodeServerResponseLike {
        destroyed?: boolean;
        end(chunk?: string | Uint8Array<ArrayBufferLike>): unknown;
        on(event: string, listener: (...args: unknown[]) => void): unknown;
        write(chunk: string | Uint8Array<ArrayBufferLike>): unknown;
        writeHead(statusCode: number, headers?: Record<string, string>): unknown;
    }
    Index
    destroyed?: boolean

    Whether the underlying response stream has already been destroyed.

    • Completes the response, optionally with a final body chunk.

      Parameters

      • Optionalchunk: string | Uint8Array<ArrayBufferLike>

      Returns unknown

    • Subscribes to response lifecycle events such as close and drain.

      Parameters

      • event: string
      • listener: (...args: unknown[]) => void

      Returns unknown

    • Writes a response-body chunk and returns false when backpressure applies.

      Parameters

      • chunk: string | Uint8Array<ArrayBufferLike>

      Returns unknown

    • Writes the HTTP status and response headers.

      Parameters

      • statusCode: number
      • Optionalheaders: Record<string, string>

      Returns unknown