Function

handle

Handle an incoming MCP request and write the response to the output-stream.

The response may consist of zero or more notifications and server-sent requests before concluding with the result.

The handler receives ownership of the request resource, allowing it to either process the request or forward it to the next handler in the chain.

handle: func(req: request, out: output-stream);