Skip to content

SEP-2678: Introduce additional error codes to protocol#2678

Open
MatthewKhouzam wants to merge 1 commit into
modelcontextprotocol:mainfrom
MatthewKhouzam:error_codes
Open

SEP-2678: Introduce additional error codes to protocol#2678
MatthewKhouzam wants to merge 1 commit into
modelcontextprotocol:mainfrom
MatthewKhouzam:error_codes

Conversation

@MatthewKhouzam
Copy link
Copy Markdown

Introduce -32000/-32001/-32002 to match the implementation in FastMCP.

This change paves the way towards "interceptors" or "middleware" standardization.

Motivation and Context

The end goal is to better secure MCP against several attacks. FastMCP's middleware proxy design looks like a great solution to add local verification. This change would bring the error codes from that design pattern into the proper MCP. This should have 0 breaking changes as the error codes are already in the range of -32000 - -32099. This would just bring transparency to the error codes.

How Has This Been Tested?

This is a "documentation" and protocol change adding error messages to match those of FastMCP's implementation.

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This code was generated with the assistance of claude opus 4.7 (the SEP was largely assisted for linguistic reasons). It was verified by a person.

@MatthewKhouzam MatthewKhouzam requested a review from a team as a code owner May 4, 2026 14:59
@MatthewKhouzam MatthewKhouzam changed the title SEP-26xx: introduce additional error codes to protocol SEP-2678: introduce additional error codes to protocol May 4, 2026
@MatthewKhouzam MatthewKhouzam force-pushed the error_codes branch 2 times, most recently from 090e3cc to cca3bf9 Compare May 4, 2026 15:06
@MatthewKhouzam MatthewKhouzam requested a review from a team as a code owner May 4, 2026 15:06
Introduce -32000/-32001/-32002 to match the implementation in FastMCP.

This change paves the way towards "interceptors" or "middleware"
standardization.

This change was assisted with claude opus 4.7

Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
@MatthewKhouzam
Copy link
Copy Markdown
Author

@reviewers. I would like to talk about if my approach is correct and inline with your roadmap before merging. This patch is trivial, but I don't know if it's useful for your goals.

@localden localden changed the title SEP-2678: introduce additional error codes to protocol SEP-2678: Introduce additional error codes to protocol May 6, 2026
@localden localden added proposal SEP proposal without a sponsor. SEP labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal SEP proposal without a sponsor. SEP

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants