Skip to content

MCP: Cannot authenticate to multiple Atlassian sites simultaneously - OAuth credentials shared across MCP server configurations #293533

@alahijani

Description

@alahijani

Summary:
When configuring multiple Atlassian MCP servers pointing to different Atlassian Cloud sites (e.g., site-a.atlassian.net and site-b.atlassian.net), VS Code only retains authentication for one site. The OAuth credential appears to be keyed by the OAuth client ID and/or MCP auth provider identity derived only from the server URL origin, causing all Atlassian MCP connections to share a single token.

Steps to Reproduce:

  1. Configure two Atlassian MCP servers in mcp.json with different names (and different query params to differentiate URLs).
    • Example: https://mcp.atlassian.com/?site=a and https://mcp.atlassian.com/?site=b
  2. Authenticate the first connection — prompted with fresh OAuth flow, select site-a.atlassian.net.
  3. Authenticate the second connection — prompted to reuse "MCP" credential or "Sign in to another account".
  4. Select "Sign in to another account" and authenticate to site-b.atlassian.net.
  5. Call getAccessibleAtlassianResources on both MCP servers.

Expected Result:

  • Site A connection returns site-a.atlassian.net.
  • Site B connection returns site-b.atlassian.net.

Actual Result:

  • Both connections return the same site (whichever was authenticated last).
  • The second authentication overwrites the first.

Investigation Notes:

  • Credentials are stored in ~/Library/Application Support/Code/User/globalStorage/state.vscdb.
  • The dynamicAuthProviders table entry shows e.g.:
    {
      "providerId": "https://mcp.atlassian.com/",
      ...
    }
  • The providerId appears to be derived from the URL origin only, stripping query parameters.
    This means multiple MCP servers with the same origin but different query params (e.g. ?site=a vs ?site=b) resolve to the same providerId and therefore share credentials.
  • The key uses https://mcp.atlassian.com/ (without query params) and a shared clientId, so all Atlassian MCP servers resolve to the same credential regardless of the configured URL or server name.

Suggested Fix:
Include the full configured URL (including query params) or at minimum the MCP server name from mcp.json when generating the providerId / credential key, allowing per-server credential isolation (multiple OAuth tokens per MCP server configuration).

Workaround:
Use separate VS Code profiles for each Atlassian site.

Environment:

  • VS Code: 1.108.2
  • GitHub Copilot extension: 1.388.0
  • GitHub Copilot Chat extension: 0.36.2
  • OS: macOS

Metadata

Metadata

Labels

authenticationIssues with the Authentication platformchat-mcpfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions