Skip to content

Commit 40e7d66

Browse files
committed
fix: remove default disabled Authorization header to fix direct OAuth connections (modelcontextprotocol#982)
The default disabled Authorization header introduced in v0.18.0 prevented direct connections to OAuth-protected MCP servers from working properly. When connecting directly without prior OAuth flow: 1. The disabled header existed in customHeaders 2. needsOAuthToken correctly identified no enabled auth header 3. serverAuthProvider.tokens() returned null (no prior OAuth flow) 4. No Authorization header was added to the request 5. Request failed with 401 before OAuth flow could be triggered This fix removes the default disabled header, allowing the OAuth flow to be triggered naturally on 401 responses for direct connections. The auth flows (step-by-step and quick) continue to work as they complete OAuth before connecting, so tokens are already available.
1 parent fc8066e commit 40e7d66

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎client/src/App.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,9 @@ const App = () => {
197197
return migrateFromLegacyAuth(legacyToken, legacyHeaderName);
198198
}
199199

200-
// Default to empty array
201-
return [
202-
{
203-
name: "Authorization",
204-
value: "Bearer ",
205-
enabled: false,
206-
},
207-
];
200+
// Default to empty array - no default header
201+
// This allows OAuth flow to be triggered naturally on 401 for direct connections
202+
return [];
208203
});
209204

210205
const [pendingSampleRequests, setPendingSampleRequests] = useState<

0 commit comments

Comments
 (0)