[BUG] Reference the connection state management bug after SSE reconnection

Resolved 💬 3 comments Opened Oct 28, 2025 by OgmaJ Closed Nov 1, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Atlassian MCP Connection Diagnostic Report

Date: 2025-10-28
Claude Code Version: 2.0.28
Issue: Atlassian MCP tools consistently fail with "Not connected" error

Summary

The Atlassian MCP server has a critical connection state management issue:

  • Authentication: ✅ Working (OAuth tokens valid for ~55 minutes)
  • Initial SSE Connection: ✅ Establishes successfully
  • SSE Stability: ❌ Connection repeatedly drops and reconnects
  • Tool Execution: ❌ All tool calls fail instantly (0s) with "Not connected"
  • Success Rate: 0/7 tool calls succeeded

Key Findings

1. Connection Pattern

[DEBUG] SSE transport closed/disconnected, attempting automatic reconnection
[DEBUG] SSE reconnection successful after 961ms
[DEBUG] Calling MCP tool: search
[DEBUG] Tool 'search' failed after 0s: Not connected

2. Statistics from Session

  • Failed tool calls: 7
  • Successful tool calls: 0
  • SSE disconnections: 2+ (within minutes of connection)
  • Reconnection time: ~1 second (fast reconnection)

3. Network Environment

  • VPN/Tunnel interfaces active: utun0, utun1, utun2, utun3
  • Multiple default routes present (potential routing conflicts)
  • DNS: Using local gateway (192.168.1.254)
  • No HTTP proxy configured
  • Connection to mcp.atlassian.com (185.166.141.16-18) via HTTPS works

4. Root Cause Analysis

The error occurs in the connection state check within the MCP client. When tools attempt to execute:

  1. SSE connection successfully reconnects
  2. Tool invocation begins
  3. Connection state check fails immediately (0s timing indicates no network call)
  4. Returns "Not connected" error

This suggests an internal state management bug where the connection status flag is not properly updated after SSE reconnection, or there's a race condition between reconnection completion and tool execution.

Reproduction Steps

  1. Start Claude Code session with Atlassian MCP configured
  2. Run /mcp to connect
  3. Wait for "Authentication successful. Reconnected to atlassian."
  4. Immediately try any Atlassian tool (e.g., search, getJiraIssue)
  5. Tool fails with "Not connected" despite successful authentication

Potential Contributing Factors

  1. VPN/Network Tunneling: Multiple utun interfaces may cause routing instability
  2. SSE Keep-Alive Issues: Long-lived SSE connections may be timing out
  3. State Management Bug: Connection flag not updated after reconnection
  4. Server-Side Issues: Atlassian MCP SSE server stability

Recommended Actions

Immediate Workarounds

  1. Use Jira/Confluence web interface directly
  2. Use Atlassian REST APIs via curl/http clients
  3. Try disabling VPN if not required

For Anthropic/Atlassian

  1. Add more detailed SSE disconnect logging (reason codes)
  2. Fix connection state management after SSE reconnection
  3. Add connection health checks with retry logic
  4. Implement exponential backoff for reconnections
  5. Add debug mode flag to log connection state transitions

Files Referenced

  • Debug log: ~/.claude/debug/d21fff70-d5ae-47e1-82e1-a92e8a0ae3a6.txt
  • Error location: /Users/OgmaJ/.nvm/versions/node/v20.19.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1303:15666

What Should Happen?

Expected Behavior

After successful OAuth authentication and SSE connection establishment:

  • Tool calls should execute successfully
  • Or, if connection is genuinely lost, automatic reconnection should restore functionality

Error Messages/Logs

Steps to Reproduce

Bug Report: Atlassian MCP "Not connected" Error Despite Successful Authentication

Summary

Atlassian MCP tools consistently fail with "Not connected" error even after successful OAuth authentication and SSE connection establishment. The connection state flag is not properly synchronized after SSE reconnection events.

Environment

  • Claude Code Version: 2.0.28
  • Platform: macOS (Darwin 25.0.0)
  • Node Version: v20.19.0
  • Installation Method: npm-global
  • MCP Server: atlassian-mcp-server v1.0.0

Steps to Reproduce

  1. Install and Configure Atlassian MCP
  • Ensure Atlassian MCP server is configured in Claude Code
  • No special configuration required - use default settings
  1. Start Claude Code Session

``bash
cd /path/to/any/project
claude
``

  1. Connect to Atlassian MCP
  • Run the /mcp command
  • Complete OAuth authorization flow in browser
  • Wait for confirmation message: "Authentication successful. Reconnected to atlassian."
  1. Attempt to Use Any Atlassian Tool
  • Try any Atlassian MCP tool, for example:
  • mcp__atlassian__search with query parameter
  • mcp__atlassian__getJiraIssue with issue key
  • mcp__atlassian__getAccessibleAtlassianResources
  1. Observe the Error
  • All tool calls fail instantly (0s execution time)
  • Error returned: "Not connected"
  • This occurs despite successful authentication and connection

Expected Behavior

After successful OAuth authentication and SSE connection establishment:

  • Tool calls should execute successfully
  • Or, if connection is genuinely lost, automatic reconnection should restore functionality

Actual Behavior

  • OAuth authentication completes successfully ✅
  • SSE connection establishes successfully ✅
  • Connection status shows as "reconnected" ✅
  • All tool invocations fail immediately with "Not connected" ❌
  • Success rate: 0% (0 out of 7+ attempts in test session)

Debug Log Evidence

From ~/.claude/debug/latest:

[DEBUG] MCP server "atlassian": Successfully connected to sse server in 653ms
[DEBUG] MCP server "atlassian": Connection established with capabilities: {"hasTools":true,"hasPrompts":false,"hasResources":false,"serverVersion":{"name":"atlassian-mcp-server","version":"1.0.0"}}
[DEBUG] MCP server "atlassian": SSE reconnection successful after 1267ms
[DEBUG] MCP server "atlassian": Returning tokens
[DEBUG] MCP server "atlassian": Token length: 74
[DEBUG] MCP server "atlassian": Has refresh token: true
[DEBUG] MCP server "atlassian": Expires in: 3257s
[DEBUG] MCP server "atlassian": Calling MCP tool: search
[DEBUG] MCP server "atlassian": Tool 'search' failed after 0s: Not connected

Key Observations

  1. SSE Connection Instability
  • SSE transport repeatedly closes/disconnects
  • Automatic reconnection succeeds within ~1 second
  • Pattern: SSE transport closed/disconnected, attempting automatic reconnectionSSE reconnection successful
  1. Instant Failure
  • Tool calls fail in 0 seconds (no network request attempted)
  • Suggests connection state check failing before tool execution
  1. State Synchronization Issue
  • Logs show: "Connection established", "SSE reconnection successful", valid tokens present
  • Yet connection state check returns false immediately

Root Cause Hypothesis

There appears to be a race condition or state management bug where:

  • SSE reconnection completes successfully
  • Connection capabilities are received from server
  • Internal connection state flag is not updated atomically
  • Tool invocations check the stale connection state and fail immediately

The 0-second failure time indicates no network call is attempted, pointing to an internal state check failing before the actual tool execution.

Reproducibility

  • Frequency: 100% (every tool call attempt fails)
  • Timing: Occurs immediately after authentication
  • Persistence: Issue persists throughout the session

Potential Contributing Factors

  • Multiple VPN/tunnel interfaces (utun0-3) active on system
  • May contribute to SSE connection instability
  • However, the state management bug is the primary issue

Error Stack Trace

Error: Not connected
    at file:///Users/ogmaj/.nvm/versions/node/v20.19.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1303:15666
    at new Promise (<anonymous>)
    at KuA.request (file:///Users/ogmaj/.nvm/versions/node/v20.19.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1303:15607)
    at KuA.callTool (file:///Users/ogmaj/.nvm/versions/node/v20.19.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1303:149084)

Suggested Fix

  1. Ensure atomic state updates after SSE reconnection
  2. Add connection state validation logging before failing tool calls
  3. Implement retry logic for tool calls if connection was recently re-established
  4. Add connection health check before tool execution with auto-reconnect
  5. Log detailed SSE disconnect reasons to help diagnose underlying instability

Workaround

Currently, no workaround exists within Claude Code. Users must:

  • Use Atlassian web interfaces directly
  • Use Atlassian REST APIs with personal API tokens
  • Wait for fix

Impact

High - Atlassian MCP integration is completely non-functional. Users cannot:

  • Search Jira/Confluence
  • Read or update issues
  • Access any Atlassian resources through Claude Code

Additional Context

This issue blocks all Atlassian MCP functionality and affects the user experience significantly, as the authentication flow completes successfully but the integration remains unusable.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.28 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗