[PR #7234] fix(mcp): use correct authorization server URL for OAuth discovery #12310

Closed
opened 2026-02-16 18:17:13 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7234

State: closed
Merged: Yes


Summary

Upgrade @modelcontextprotocol/sdk from 1.15.1 to 1.25.2 to fix OAuth discovery for external authorization servers.

Fixes #7228

Problem

When an MCP server's protected resource metadata returns an external authorization_servers URL (e.g., Auth0), OpenCode incorrectly fetches /.well-known/oauth-authorization-server from the MCP server instead of the authorization server.

Solution

Upgrade the MCP SDK to 1.25.2, which fixes the URL construction in discoverOAuthMetadata().

Related

PR #5940 addresses the same SDK bug but also adds a redirectUri configuration option. This PR is a minimal fix focusing only on the SDK upgrade. The redirectUri feature could be considered separately.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7234 **State:** closed **Merged:** Yes --- ## Summary Upgrade `@modelcontextprotocol/sdk` from 1.15.1 to 1.25.2 to fix OAuth discovery for external authorization servers. Fixes #7228 ## Problem When an MCP server's protected resource metadata returns an external `authorization_servers` URL (e.g., Auth0), OpenCode incorrectly fetches `/.well-known/oauth-authorization-server` from the MCP server instead of the authorization server. ## Solution Upgrade the MCP SDK to 1.25.2, which fixes the URL construction in `discoverOAuthMetadata()`. ## Related PR #5940 addresses the same SDK bug but also adds a `redirectUri` configuration option. This PR is a minimal fix focusing only on the SDK upgrade. The `redirectUri` feature could be considered separately.
yindo added the pull-request label 2026-02-16 18:17:13 -05:00
yindo closed this issue 2026-02-16 18:17:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12310