Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Atlassian MCP OAuth fails: unauthorized_client: redirect_uri is not registered (v2 endpoint)

未关闭
#4,901 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃

调研方向

Reproduce the flow using ~/.copilot/mcp-config.json and the Atlassian v2 endpoint, then inspect ~/.copilot/logs/process-*.log and ~/.copilot/mcp-oauth-config/. Compare the authorization request with the expected DCR or CIMD behavior. Done means authentication completes successfully against the Atlassian MCP server without the redirect_uri error.

由索引模型根据 Issue 内容生成。

描述

triage

Title

Atlassian MCP OAuth fails: unauthorized_client: redirect_uri is not registered (v2 endpoint)

Affected version

1.0.86 (also observed on prior builds per related issues #4490, #2536)

Environment

  • OS: macOS
  • MCP server config (~/.copilot/mcp-config.json):
    {
      "mcpServers": {
        "atlassian": {
          "type": "http",
          "url": "https://mcp.atlassian.com/v2/mcp",
          "tools": ["*"]
        }
      }
    }
    

Description

When authenticating to the Atlassian MCP server (https://mcp.atlassian.com/v2/mcp), the OAuth flow fails on Atlassian's side with:

https://id.atlassian.com/error?error=unauthorized_client&error_description=redirect_uri%20is%20not%20registered%20for%20client:%20http://127.0.0.1:<random-port>/

The client_id used appears to differ from — or its declared metadata does not include — the dynamic loopback redirect_uri (http://127.0.0.1:<random-port>/) that Copilot CLI generates for each auth attempt.

By contrast, VS Code's Atlassian/Rovo Dev MCP integration succeeds using a Client ID Metadata Document (CIMD) approach: its client_id is a URL (https://vscode.dev/oauth/client-metadata.json) whose fetched JSON document lists VS Code's trusted redirect URIs. Atlassian's authorization server fetches this metadata document to validate the redirect_uri instead of requiring prior Dynamic Client Registration (DCR).

Local log excerpts (~/.copilot/logs/process-*.log) confirm the flow:

[ERROR] [rust:rmcp::transport::worker] worker quit with fatal: Transport channel closed, when Client(OAuthChallenge { www_authenticate_header: "...https://mcp.atlassian.com/.well-known/oauth-protected-resource/v2/mcp...", response: McpOAuthHttpResponse { status_code: 401, ... } })
[ERROR] Connecting to atlassian...
[ERROR] Opening browser for atlassian authentication...

No client-registration record is persisted locally (~/.copilot/mcp-oauth-config/ only contains a PKCE .verifier file), suggesting Copilot CLI attempts a fresh DCR (or static client_id) each time rather than caching/reusing a CIMD-style registration — and whatever it sends doesn't match what Atlassian's server expects.

Steps to reproduce

  1. Configure Atlassian HTTP MCP server pointing to https://mcp.atlassian.com/v2/mcp.
  2. Run /mcp → select atlassian → attempt to authenticate.
  3. Browser opens https://auth.atlassian.com/authorize?...&redirect_uri=http://127.0.0.1:<random-port>/....
  4. Atlassian immediately redirects to an error page: unauthorized_client: redirect_uri is not registered for client: http://127.0.0.1:<random-port>/.

Expected behavior

OAuth flow completes successfully, matching VS Code's behavior against the same Atlassian MCP endpoint.

Suggested fix

  • Adopt the same Client ID Metadata Document (CIMD) pattern VS Code uses: host/declare a client-metadata.json for Copilot CLI listing its expected loopback redirect URI pattern, and use that document's URL as client_id.
  • Alternatively, verify whether Atlassian's /register (DCR) endpoint is being called at all before /authorize, and confirm the registered redirect_uris match the one sent in the subsequent authorize request.

Related issues

  • github/copilot-cli#4490 (RFC 8414 issuer mismatch, v1.0.80)
  • github/copilot-cli#2536 (re-auth required on every launch)
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。