Skip to content

fix(mcp): improve 401 detection for OAuth flow trigger#362

Merged
cgoinglove merged 1 commit intocgoinglove:mainfrom
hakonharnes:fix/mcp-oauth-401-detection
Jan 20, 2026
Merged

fix(mcp): improve 401 detection for OAuth flow trigger#362
cgoinglove merged 1 commit intocgoinglove:mainfrom
hakonharnes:fix/mcp-oauth-401-detection

Conversation

@hakonharnes
Copy link
Contributor

The StreamableHTTPError from @modelcontextprotocol/sdk stores the HTTP status in error.code (not error.status), and some servers return 'Authentication required' instead of 'Unauthorized' in their error messages.

This caused the better-chatbot to incorrectly fall back to SSE transport instead of retrying with OAuth provider when connecting to MCP servers that require authentication. For example, I found that MCP servers that were built using the FastMCP Typescript framework did not work with better-chatbot. This PR addresses that.

@vercel
Copy link

vercel bot commented Jan 14, 2026

Someone is attempting to deploy a commit to the cgoinglove's projects Team on Vercel.

A member of the Team first needs to authorize it.

@cgoinglove cgoinglove merged commit a99dca9 into cgoinglove:main Jan 20, 2026
3 of 4 checks passed
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.

2 participants