FinalStandards Track
Abstract
This SEP proposes a structural refactoring of the Model Context Protocol (MCP) specification. The core change is to define payload of requests (e.g., CallToolRequest) as independent definitions and have the RPC method definitions refer to these models. This decouples the definition of the data payload from the definition of the remote procedure that transports it, leading to a clearer, more modular, and more maintainable specification.Motivation
The current MCP specification tightly couples the data payload of a request with the JSON-RPC method that transports it. This design presents several challenges:- Reduced Clarity: It forces developers to mentally parse the JSON-RPC transport structure just to understand the core data being exchanged. This increases cognitive load and makes the specification difficult to read and implement correctly.
- Hindered Maintainability: Defining data structures inline prevents their reuse across different methods, leading to redundancy and making future updates to the protocol more complex and error-prone.
- Tightly Coupled to JSON-RPC: Most critically, this tight coupling to JSON-RPC is the primary blocker for defining bindings for other transport protocols. To support transports like gRPC (which is currently a popular ask from the community), a transport-agnostic definition of its request and response messages. The current structure makes this practically impossible.
Specification
The proposal introduces the following principle: All data structures used as parameters (params) or results (result) for RPC methods should be defined as standalone, named schemas. The RPC method definitions will then use references to these schemas.Current Approach (Inline Definition):
The RPC method definition contains the full structure of its parameters and results.Proposed Approach (Decoupled Definition):
First, the data models for the request and response are defined as top-level schemas.Rationale
The proposed solution—separating payload definitions from the RPC method—was chosen as the most direct and non-disruptive path to achieving the goals outlined in the motivation. This approach establishes a clear architectural boundary between two distinct concerns:- The Data Layer: The transport-agnostic payload definition (e.g.,
CallToolRequestParams), which represents the core information being exchanged. - The Transport Layer: The protocol-specific wrapper (e.g., the JSON-RPC
CallToolRequestobject), which describes how the data is sent.