Function

handle-request

Handle an MCP request from the client

This is the primary entry point for processing client requests. Handlers should:

  1. Check if they can handle this request type
  2. If yes, process it and return a server-response
  3. If no, delegate to downstream by importing and calling server-handler

The client-context provides session information and identity claims that may be used for authorization, personalization, or session management.

https://spec.modelcontextprotocol.io/specification/basic/requests

handle-request: func(id: request-id, request: client-request, client: client-context) -> result​<server-response, error-code>;