Skip to content

fix: detect OAuth requirement from unexpected content-type responses - #128

Merged
its-mash merged 6 commits into
mainfrom
fix/oauth-detect-unexpected-content-type
Feb 20, 2026
Merged

fix: detect OAuth requirement from unexpected content-type responses#128
its-mash merged 6 commits into
mainfrom
fix/oauth-detect-unexpected-content-type

Conversation

@its-mash

Copy link
Copy Markdown
Member

Summary

  • Some MCP servers (e.g., Atlassian) respond with text/plain error bodies instead of HTTP 401 when an unauthenticated request is made
  • The requires_oauth() heuristic didn't recognize "Unexpected content type" errors from rmcp, so these were surfaced as generic connection failures instead of triggering the OAuth flow
  • Adds "unexpected content type" to the OAuth indicator list so McpMux correctly returns OAuthRequired and initiates authentication

Test plan

  • Unit test added: test_requires_oauth_unexpected_content_type
  • Manually test connecting to Atlassian MCP server without stored credentials — should trigger OAuth flow instead of erroring

…uninstall confirm

- Headers from server definitions are now always applied as default_headers
  on the reqwest::Client regardless of auth strategy (OAuth, PAT, or no-auth)
- If headers contain an Authorization header, OAuth is skipped entirely
- If headers have no Authorization, they ride alongside OAuth tokens
- Add build_default_headers() and build_http_client() helpers
- Remove standalone connect_with_headers() in favor of orthogonal design
- Add 19 unit tests for HttpTransport (requires_oauth, header building,
  connect routing logic, transport_type, description)
- Remove broken confirm() dialog from server uninstall action

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
Some MCP servers (e.g., Atlassian) return text/plain error responses
instead of HTTP 401 when unauthenticated. Add "unexpected content type"
to OAuth detection heuristics so these are correctly routed to the
OAuth flow rather than surfaced as generic connection errors.

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
The windows-latest runner image can have a msedgedriver version that
doesn't match the installed Edge browser. Dynamically download the
EdgeDriver matching the installed Edge version to prevent
"session not created" failures.

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
Tauri apps use the WebView2 runtime, which can be a different version
than the Edge browser on the same machine. Read the WebView2 runtime
version from the registry and download the matching EdgeDriver.

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
@its-mash
its-mash merged commit d894d17 into main Feb 20, 2026
13 checks passed
@its-mash
its-mash deleted the fix/oauth-detect-unexpected-content-type branch February 20, 2026 10:43
Sign up for free to 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.

1 participant