claude-code - 💡(How to fix) Fix [FEATURE] Trigger OAuth authentication immediately after plugin install for HTTP MCP servers [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45288Fetched 2026-04-09 08:08:51
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1
  • Affects all remote HTTP MCP plugins with OAuth (not just ours)
  • The .mcp.json oauth.clientId + callbackPort pattern (used by Slack) makes auth deterministic but still requires a separate trigger
  • RFC 9728 auto-discovery works well once triggered — the gap is when it triggers
  • Related: #45219 (install button greyed out for OAuth servers), #42922 (OAuth prompt flooding)

Root Cause

  • Affects all remote HTTP MCP plugins with OAuth (not just ours)
  • The .mcp.json oauth.clientId + callbackPort pattern (used by Slack) makes auth deterministic but still requires a separate trigger
  • RFC 9728 auto-discovery works well once triggered — the gap is when it triggers
  • Related: #45219 (install button greyed out for OAuth servers), #42922 (OAuth prompt flooding)

Fix Action

Fix / Workaround

Current Workaround

RAW_BUFFERClick to expand / collapse

Problem

When installing a plugin that uses a remote HTTP MCP server with OAuth (e.g., type: "http" + RFC 9728 auto-discovery), the install and auth are separate steps:

  1. User clicks "Install for you (user scope)"
  2. Plugin installs successfully
  3. User must navigate to /mcp → select the server → click "Authenticate"
  4. OAuth flow triggers (browser opens, user signs in)
  5. Tools become available

Steps 2–3 are unnecessary friction. The user has to leave the install UI, find /mcp, locate the server, and manually trigger auth. Compare this to the Slack plugin experience where auth flows more naturally.

Proposed Solution

For plugins whose .mcp.json declares type: "http" with an oauth block (or whose server returns RFC 9728 metadata on 401), Claude Code should offer to authenticate immediately after install — either:

  • Option A: Add an authUrl or onInstall field to plugin.json that Claude Code opens in the browser right after install
  • Option B: Automatically attempt MCP connection post-install, detect the 401 + WWW-Authenticate header, and trigger the OAuth flow inline — before exiting the plugin marketplace UI
  • Option C: Show an "Authenticate now" button in the install confirmation screen (similar to how /mcp shows it)

Current Workaround

Users must:

  1. Install the plugin
  2. Either use a tool (which triggers 401 → OAuth) or go to /mcp → Authenticate

This works but is confusing for first-time users who see "failed" / "not authenticated" status after a successful install.

Context

  • Affects all remote HTTP MCP plugins with OAuth (not just ours)
  • The .mcp.json oauth.clientId + callbackPort pattern (used by Slack) makes auth deterministic but still requires a separate trigger
  • RFC 9728 auto-discovery works well once triggered — the gap is when it triggers
  • Related: #45219 (install button greyed out for OAuth servers), #42922 (OAuth prompt flooding)

Environment

  • Claude Code CLI
  • Remote HTTP MCP servers with OAuth 2.1 (RFC 9728 + RFC 8414)
  • Tested with custom MCP server deployed on Cloud Run

extent analysis

TL;DR

Implementing an immediate authentication step after plugin installation, such as adding an authUrl field to plugin.json or automatically attempting an MCP connection post-install, can streamline the user experience.

Guidance

  • Consider adding an authUrl or onInstall field to plugin.json to trigger authentication immediately after installation, as proposed in Option A.
  • Alternatively, explore automatically attempting an MCP connection post-install and detecting the 401 + WWW-Authenticate header to trigger the OAuth flow inline, as outlined in Option B.
  • Showing an "Authenticate now" button in the install confirmation screen, similar to Option C, could also simplify the authentication process for users.
  • Review related issues, such as #45219 and #42922, to ensure the chosen solution does not introduce new problems.

Example

No specific code snippet is provided due to the lack of explicit implementation details in the issue.

Notes

The proposed solutions aim to reduce friction in the installation and authentication process for plugins using remote HTTP MCP servers with OAuth. However, the best approach may depend on the specific requirements and constraints of the Claude Code platform and its plugins.

Recommendation

Apply workaround Option A by adding an authUrl field to plugin.json, as it seems to be a straightforward and user-friendly solution that can be implemented without significant changes to the existing infrastructure.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING