Add formal MCP error taxonomy SEP#2841
Open
Agent-Hellboy wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This SEP proposes formalizing MCP error semantics so clients, servers, and SDKs can identify the same protocol failure consistently across implementations.
I started looking into this while testing behavior across multiple MCP SDKs in different languages. The same logical failure can surface with different JSON-RPC error codes depending on the SDK or version,
which makes cross-SDK interoperability, client behavior, and conformance testing difficult.
I opened an earlier discussion about formalizing error codes here: #2212
That discussion did not get much traction at the time, so I paused the work before writing a SEP. I now think this is worth revisiting because interoperable error handling is important for MCP clients, SDKs, and future conformance tests.
Other mature ecosystems with many client libraries, server implementations, and SDKs have had to formalize their error semantics for the same reason: broad interoperability breaks down when every implementation invents or interprets errors differently.
reason, so clients can distinguish domain errors reliably.MCP currently relies mainly on JSON-RPC numeric error codes, but those are too coarse and have already drifted across SDKs. This SEP keeps JSON-RPC compatibility while adding a structured MCP-owned condition code in
error.data, giving SDKs and clients a stable interoperability layer.The SEP includes references and evidence from existing SDK behavior, along with prior-art patterns from other protocols and APIs. Please take a look and let me know whether this direction is worth pursuing.
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context