Skip to content

fix(client): map bare HTTP 401/403 to distinguishable JSON-RPC errors - #3276

Open
sgoel2be24-cyber wants to merge 1 commit into
modelcontextprotocol:mainfrom
sgoel2be24-cyber:fix/streamable-http-401-unauthorized
Open

fix(client): map bare HTTP 401/403 to distinguishable JSON-RPC errors#3276
sgoel2be24-cyber wants to merge 1 commit into
modelcontextprotocol:mainfrom
sgoel2be24-cyber:fix/streamable-http-401-unauthorized

Conversation

@sgoel2be24-cyber

@sgoel2be24-cybersgoel2be24-cyber commented Aug 10, 2026

Copy link
Copy Markdown

Bare auth failures were collapsing into the generic "Server returned an error response" fallback, so agents could not handle operation-specific denials without tearing down the session. Surface Unauthorized/Forbidden with http_status metadata instead.

Fixes#1295

Motivation and Context

How Has This Been Tested?

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

Bare auth failures were collapsing into the generic "Server returned an
error response" fallback, so agents could not handle operation-specific
denials without tearing down the session. Surface Unauthorized/Forbidden
with http_status metadata instead.
Fixesmodelcontextprotocol#1295
Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

401 in Streamable HTTP should be handled gracefully

1 participant

@sgoel2be24-cyber