Skip to main content

Function: dispatchInProcess()

dispatchInProcess(__namedParameters): Promise<InProcessResponse>

Defined in: dispatchInProcess.ts:147

Serves one request against a Koa app in this process, with no socket and no port: the app's whole middleware chain runs, exactly as it would for a request that arrived over the network.

Useful when one surface of an application calls another — an MCP tool dispatching to the REST route it was generated from — without a second implementation of validation, authorization or error handling, and without a loopback request to the process's own port.

An error that escapes the middleware answers as Koa would answer it (its status, or 500) and is emitted on the app's error event when it has a listener.

Parameters​

ParameterType
__namedParametersInProcessRequest & object

Returns​

Promise<InProcessResponse>