Responses are further sub-categorized as either successful results or errors.
Results can follow any JSON object structure, while errors must include an error code and
message at minimum.
Protocol Layers
The Model Context Protocol consists of several key components that work together:- Base Protocol: Core JSON-RPC message types
- Lifecycle Management: Connection initialization, capability negotiation, and session control
- Server Features: Resources, prompts, and tools exposed by servers
- Client Features: Sampling and root directory lists provided by clients
- Utilities: Cross-cutting concerns like logging and argument completion