-
Notifications
You must be signed in to change notification settings - Fork 38.9k
MCP: Cannot authenticate to multiple Atlassian sites simultaneously - OAuth credentials shared across MCP server configurations #293533
Description
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:
- Configure two Atlassian MCP servers in
mcp.jsonwith different names (and different query params to differentiate URLs).- Example:
https://mcp.atlassian.com/?site=aandhttps://mcp.atlassian.com/?site=b
- Example:
- Authenticate the first connection — prompted with fresh OAuth flow, select
site-a.atlassian.net. - Authenticate the second connection — prompted to reuse "MCP" credential or "Sign in to another account".
- Select "Sign in to another account" and authenticate to
site-b.atlassian.net. - Call
getAccessibleAtlassianResourceson 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
dynamicAuthProviderstable entry shows e.g.:{ "providerId": "https://mcp.atlassian.com/", ... } - The
providerIdappears 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=avs?site=b) resolve to the sameproviderIdand therefore share credentials. - The key uses
https://mcp.atlassian.com/(without query params) and a sharedclientId, 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