Visitar URL original
fix(mcp): port upstream auth status scoping to configured server URL (anomalyco/opencode#33924) by devin-ai-integration[bot] · Pull Request #1612 · AltimateAI/altimate-code · GitHub
Skip to content

fix(mcp): port upstream auth status scoping to configured server URL (anomalyco/opencode#33924) - #1612

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1792601000-mcp-auth-url
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1792601000-mcp-auth-url

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #1572

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

MCP.getAuthStatus looked up stored OAuth tokens by server name only (auth.get(mcpName)). If a remote MCP server's url changed, or a legacy entry had no URL, credentials issued for a different server were reported as authenticated. The status UI then shows the server as signed in while the real connection fails, and the user is never prompted to re-authenticate.

Ported from upstream anomalyco/opencode#33924: read the server config and look the tokens up with auth.getForUrl(mcpName, config.url), the same lookup the connect path already uses. Non-remote or unconfigured servers report not_authenticated. Wrapped in altimate_change markers tagged upstream_fix:.

How did you verify your code works?

New test in test/mcp/oauth-auto-connect.test.ts covers legacy (URL-less) tokens, tokens for an old URL, tokens for the current URL, expired tokens and an unconfigured server. It fails on main and passes on this branch. bun typecheck and bun run script/upstream/analyze.ts --markers --base origin/main --strict are clean.

Cost side effects

None. One extra in-memory config lookup per status call.

Screenshots / recordings

N/A, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

Written by Devin


Summary by cubic

Fixes MCP auth status so it only reports credentials stored for the configured server URL, ported from upstream anomalyco/opencode#33924.

Previously getAuthStatus looked up OAuth tokens by server name only, so credentials issued for a different URL were reported as authenticated after a server URL change. The status now reads the server config and uses auth.getForUrl, the same lookup the connect path already uses. Unconfigured or non-remote servers report not_authenticated instead.

Written for commit e089ed1. Summary will update on new commits.

View guided diff Turn on auto-fix

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 33681b99-b37a-4299-ac7c-12ca6e7b80f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

MCP auth status reports credentials stored for a different server URL as authenticated

0 participants