v0.4.0 · Interface
server-handler
Server-side MCP request/response handler interface
This interface defines the contract for processing MCP protocol messages on the server side.
Components implementing this interface receive client requests, process them, and return
server responses. They also handle bidirectional communication through responses and notifications.
Handler components form a linear pipeline where each handler can:
- Process requests it understands and return a response
- Delegate unknown requests downstream by importing server-handler
- Observe responses and notifications flowing back upstream
Type Aliases
T
client-context
T=========================================================================
error-code
TStandard JSON-RPC error codes
claims
TIdentity claims (JSON-encoded)
session-id
TSession identifier (cryptographic hash)
request-id
TJSON-RPC request identifier
server-response
TServer responses (to client requests)
client-request
T=========================================================================
client-response
TClient responses (to server requests)
client-notification
TClient notifications (sent to server)
output-stream
An output bytestream.