Skip to content

fix(auth): preserve OAuth discovery transport errors#1028

Open
tjni wants to merge 1 commit into
modelcontextprotocol:mainfrom
tjni:agent/preserve-oauth-discovery-errors
Open

fix(auth): preserve OAuth discovery transport errors#1028
tjni wants to merge 1 commit into
modelcontextprotocol:mainfrom
tjni:agent/preserve-oauth-discovery-errors

Conversation

@tjni

@tjni tjni commented Jul 22, 2026

Copy link
Copy Markdown

Motivation and Context

OAuth discovery currently treats network and server failures as missing metadata, which can incorrectly make a server appear not to support OAuth even when the root cause could be a client-side issue or a server-side server error.

This change propagates such errors to clients so that they can be displayed. I think it aligns more with how this SDK in other languages (I checked Go) behave.

How Has This Been Tested?

Currently, in Codex, adding Linear MCP server in a node:22-bookworm-slim container without ca-certificates installed shows the Linear MCP server as being unavailable even though the root cause is missing CA certificates on the system. With this change, the error is now clearer (even though Codex needs some change too in order to surface it properly).

Breaking Changes

N/A

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

@tjni
tjni requested a review from a team as a code owner July 22, 2026 21:05
@github-actions github-actions Bot added T-core Core library changes T-transport Transport layer changes labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant