claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

JIRA Integration Fails in Claude Code with Authentication Error

Open elepedus opened this issue 6 months ago • 13 comments

Bug Description Cannot use new JIRA integration. The integration works fine in Claude Desktop, but I can't add it to Claude Code. When I use claude mcp add-from-claude-desktop, the Atlassian MCP is not included in the list of options. When I do claude mcp add atlassian https://mcp.atlassian.com/v1/sse, the command succeeds and the MCP is added, but when I load claude code with claude --debug --verbose --mcp-debug I get "MCP server "atlassian" Connection failed: spawn https://mcp.atlassian.com/v1/sse ENOENT". It appears Claude Code is unable to authenticate with the Atlessian remote MCP.

Environment Info

  • Platform: macos
  • Terminal: intellij
  • Version: 0.2.113
  • Feedback ID: fb336173-c162-471e-819b-cc1291d3f81a

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:888:11)\n    at execSync (node:child_process:960:15)\n    at tD (file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:599:3394)\n    at file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:529:14049\n    at D (file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:491:12863)\n    at z$1 (file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:529:13570)\n    at ZB (file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:529:13187)\n    at m86 (file:///Users/elepedus/.local/share/mise/installs/node/22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2013:21250)","timestamp":"2025-05-14T09:26:07.205Z"}]

elepedus avatar May 14 '25 09:05 elepedus

@elepedus does your Claude Desktop setup have the MCP server enabled as a local server? The add-from-claude-desktop command only brings in local (stdio) servers, not SSE servers.

ashwin-ant avatar May 14 '25 15:05 ashwin-ant

No, it's not a local MCP server. This is the official SSE server that was announced here.

It seems to be a hosted SSE server with OAuth-based login.

elepedus avatar May 14 '25 18:05 elepedus

Hitting the same issue, specifically this part:

When I do claude mcp add atlassian https://mcp.atlassian.com/v1/sse, the command succeeds and the MCP is added, but when I load claude code with claude --debug --verbose --mcp-debug I get "MCP server "atlassian" Connection failed: spawn https://mcp.atlassian.com/v1/sse ENOENT".

arnesund avatar May 29 '25 08:05 arnesund

Same here.

davidclayman avatar Jun 08 '25 16:06 davidclayman

same problem; added via claude mcp add atlassian https://mcp.atlassian.com/v1/sse. Here's the debug output:

version: 1.0.17

[DEBUG] MCP server "atlassian": SSE Connection error: {"url":" https://mcp.atlassian.com/v1/sse","error":"SSE error: Non-200 status code (401)","stack":"Error: SSE error: Non-200 status code (401)\n    at _eventSource.onerror (file:///nix/store/8fv783lkhh23wzmp32p11q2s8wq6ajaq-claude-code-1.0.17/lib/node_modules/@anthropic-ai/claude-code/cli.js:1364:13931)\n    at wm.ro (file:///nix/store/8fv783lkhh23wzmp32p11q2s8wq6ajaq-claude-code-1.0.17/lib/node_modules/@anthropic-ai/claude-code/cli.js:1364:4946)\n    at file:///nix/store/8fv783lkhh23wzmp32p11q2s8wq6ajaq-claude-code-1.0.17/lib/node_modules/@anthropic-ai/claude-code/cli.js:1364:1799\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
[ERROR] MCP server "atlassian" Error: SSE error: Non-200 status code (401)
[DEBUG] MCP server "atlassian": Authentication required for SSE server
➜  claude mcp get atlassian
atlassian:
  Scope: User (available in all your projects)
  Type: sse
  URL:  https://mcp.atlassian.com/v1/sse

To remove this server, run: claude mcp remove "atlassian" -s user

mshapheris avatar Jun 11 '25 11:06 mshapheris

Check https://github.com/anthropics/claude-code/issues/1093#issuecomment-2990306354; Claude Code now has support for remote MCP with SSE and OAuth2.0.

~~For anyone else arriving here; this can work with an oauth2 flow using a remote proxy until we have proper support for sse~~

  • this is a serious YOLO and YMMV check the package first! https://www.npmjs.com/package/mcp-remote

. Ignore the docs and add it manually to your ~/.claude.json file:

  "mcpServers": {
    "atlassian": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.atlassian.com/v1/sse"
      ]
    }
  },

mshapheris avatar Jun 11 '25 11:06 mshapheris

For anyone else arriving here; this can work with an oauth2 flow. Ignore the docs and add it manually to your ~/.claude.json file:

"mcpServers": { "atlassian": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.atlassian.com/v1/sse" ] } }, Image

Image

That's really cool -- thanks for sharing!

However, support for OAuth really needs to be built into Claude Code. While I appreciate having any sort of working solution, npx-ing a random proxy so I can pass my auth through it is too YOLO even for me!

For now, if anyone is desperate enough to use the third-party proxy, I strongly recommend you at least inspect the source code, and install the version you checked locally. At least that will provide some protection if a rug-pull attack ever happens.

elepedus avatar Jun 13 '25 10:06 elepedus

That's really cool -- thanks for sharing!

However, support for OAuth really needs to be built into Claude Code. While I appreciate having any sort of working solution, npx-ing a random proxy so I can pass my auth through it is too YOLO even for me!

For now, if anyone is desperate enough to use the third-party proxy, I strongly recommend you at least inspect the source code, and install the version you checked locally. At least that will provide some protection if a rug-pull attack ever happens.

I've updated my comment in case anyone misses it's a proxy; cheers

mshapheris avatar Jun 17 '25 20:06 mshapheris

In the latest version of Claude Code remote MCP with SSE and OAuth2.0 is now supported. I had to run /mcp to trigger the authflow.

➜  claude -v
1.0.30 (Claude Code)
➜  claude mcp add --transport sse atlassian https://mcp.atlassian.com/v1/sse
Added SSE MCP server atlassian with URL: https://mcp.atlassian.com/v1/sse to local config

Image

mshapheris avatar Jun 20 '25 08:06 mshapheris

Yep, it's fixed and I love it. I may never touch JIRA again! 🚀

Thank you! 🙏

elepedus avatar Jun 20 '25 10:06 elepedus

This is still broken for me. Is anyone else able to get past this 403? I'm using version 1.0.35 of claude code

Image

CodyPatnaude-Klaviyo avatar Jun 27 '25 16:06 CodyPatnaude-Klaviyo

@CodyPatnaude-Klaviyo are you using mcp-remote in your config or are you using the native SSE capability in Claude Code? I would recommend the latter, since the former is a third-party library that we don't control.

ashwin-ant avatar Jun 27 '25 16:06 ashwin-ant

I'm using the native SSE support, added the server with the following:

claude mcp add --transport sse atlassian https://mcp.atlassian.com/v1/sse

It brings me through the Oauth flow, I see the "Authentication Successful" message, but then I try to use it and it fails with the 403 error above. Even if I reauthorize and try a Jira command again immediately.

Update I'm not sure why, but rebooting my machine fixed this. Claude was working before I added the MCP server, then stopped working after I added it. No clue if it was related or a coincidence.

CodyPatnaude-Klaviyo avatar Jun 27 '25 18:06 CodyPatnaude-Klaviyo

In my case it performed like this:

 I'll read the Jira issue ABC-123 for you.

● atlassian - getJiraIssue (MCP)(cloudId: "https://mfdigital.atlassian.net", issueIdOrKey: "ABC-123")
  ⎿  Error: Failed to fetch tenant info for cloud ID: https://mfdigital.atlassian.net. Status: 404

● Let me try to get the correct cloud ID first.
  ⎿  [                                                
       {
         "id": "db585e1a-481d-4cb8-899e-16d92217d237",
     … +24 lines (ctrl+r to expand)

● I see that I have access to the MyCompany Atlassian instance. Let me search for the issue ABC-123 there.

● atlassian - getJiraIssue (MCP)(cloudId: "db585e1a-481d-4cb8-899e-16d92217d237", issueIdOrKey: "ABC-123")
  ⎿ {                                                                                                                                   
      "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_11679.properties,customf
    ield_11400.requestTypePractice",
    … +1189 lines (ctrl+r to expand)

It needs a "correct cloud ID", not sure why it has to fail on "fetching tenant info" first

steven-pribilinskiy avatar Jul 23 '25 00:07 steven-pribilinskiy

Adding empty headers fixes it for me:

"atlassian": {
  "type": "stdio",
  "url": "https://mcp.atlassian.com/v1/sse",
  "headers": {}
},

sam3k avatar Sep 22 '25 21:09 sam3k

to authenticate, go inside claude and run /mcp authenticate and choose atlassian mcp