github / github/copilot-cli

Atlassian MCP OAuth fails: callback URL mismatch (random port vs registered 33418)

Open
#4,795 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Version: Copilot CLI 1.0.84-3 (tested on 1.0.83 and 1.0.84-3)
Environment: WSL Ubuntu 24.04
MCP Server: Atlassian (https://mcp.atlassian.com/v1/mcp/authv2)

Issue:
When connecting to the Atlassian MCP server via Copilot CLI, OAuth always fails with:
"The app's callback URL is invalid. Contact the app developer to fix the redirect URL in the app's settings."

Root Cause:
Copilot CLI generates a random localhost port for OAuth redirect on each auth attempt, but the GitHub Copilot CLI client metadata at https://github.com/copilot/cli/client-metadata.json only registers:

  • http://127.0.0.1:33418/ (only valid callback)

Observed redirect attempts: 55096, 64611, 50069, etc.
Atlassian OAuth validation rejects these mismatched ports.

Workaround Needed:

  • Either hardcode Copilot CLI to always use port 33418
  • Or expose a configurable --redirect-port flag
  • Or update client metadata to accept random ports within a range

Error ID: c66b2f8a-87f3-404d-9e60-41b4d023c67c

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

First reproduce the OAuth failure in WSL Ubuntu with the Atlassian MCP server and compare the observed random callback ports with client-metadata.json. Then inspect where Copilot CLI selects its OAuth redirect port. Done means authentication succeeds using the registered 33418 callback or a clearly supported configurable alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, shell
Domain
api, authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.