Skip to content

[BUG] MCP Server Timeout Configuration Ignored in Streamable SSE HTTP Connections #20335

Closed as not planned

Description

@JackDan9

Preflight Checklist

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

What's Wrong?

Summary
Claude Code is not respecting MCP timeout settings configured in settings.json, causing HTTP MCP servers to
appear "offline" due to premature SSE stream disconnections using default timeout values instead of
configured ones.

What Should Happen?

Expected Behavior
MCP timeout settings in ~/.claude/settings.json should be applied to MCP server connections
SSE streams should timeout according to configured values (e.g., 60 seconds for MCP_TIMEOUT)
MCP servers should remain "online" when timeout settings are properly configured
Actual Behavior
MCP timeout settings in settings.json are ignored
SSE streams disconnect after ~5 minutes regardless of configured timeout values
HTTP MCP servers show as "offline" due to connection timeouts
No timeout configuration values appear in MCP debug logs

Claude Code receives empty responses from MCP tools that take >60 seconds

Error Messages/Logs

{
    "content": [
      {
        "cache_control": {
          "type": "ephemeral"
        },
        "type": "tool_result"
      }
    ],
    "role": "user"
  }

Steps to Reproduce

Steps to Reproduce
Configure MCP timeout settings in ~/.claude/settings.json:
{
"env": {
"MCP_TIMEOUT": "60000",
"MCP_TOOL_TIMEOUT": "120000",
"MAX_MCP_OUTPUT_TOKENS": "25000"
}
}
Add HTTP MCP server to ~/.claude.json:
{
"mcpServers": {
"example": {
"type": "http",
"url": "http://example.local:8080/mcp"
}
}
}
Start Claude Code with --mcp-debug flag
Use MCP server tools successfully
Wait ~5 minutes and observe SSE disconnection errors in logs
Environment
Claude Code Version: 2.0.
Platform: Linux 6.8.12-9-pve
MCP Server: HTTP-based Gitea MCP Server v0.3.0
Transport: SSE (Server-Sent Events)
Evidence
MCP Server Verification
MCP server responds correctly to protocol requests:
curl -X POST http://example.local:8080/mcp -H "Content-Type: application/json" -d '{"jsonrpc": "2.0",
"method": "initialize", "id": 1}'
Returns: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26",...}}
Log Evidence
Successful connection: MCP server connected to transport
SSE disconnection after ~5 minutes:
Error: SSE stream disconnected: TypeError: terminated
at file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:23205
No timeout configuration in logs: No references to MCP_TIMEOUT, MCP_TOOL_TIMEOUT, or configured values
Process Environment Check
Environment variables not visible in Claude Code process: cat /proc/$(pgrep claude)/environ | grep MCP
returns empty
Settings file format confirmed correct per documentation
Additional Context
MCP server works correctly with other LLM/AI agents
Same timeout pattern occurs consistently (~5 minutes)
Server has no authentication requirements
Network connectivity is stable (server accessible via curl)
Workaround
None identified - timeout settings cannot be applied to prevent SSE disconnections.
Impact
HTTP MCP servers appear unreliable/offline
Users cannot configure appropriate timeout values for their network environment
Reduced usability of HTTP MCP servers in production environments

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.16

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Activity

  1. JackDan9 commented on Jan 23, 2026

    @JackDan9
    Author

    This is truly a very difficult-to-understand mistake. Could the official team please provide some proper guidance and solutions? Otherwise, it really is just shit.

  2. JackDan9 commented on Jan 23, 2026

    @JackDan9
    Author

    I’ve also seen some similar error issues, but they were all closed without an official solution. I hope this can be addressed by the official team. Thank you.

  3. github-actions commented on Jan 23, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. MCP Server Timeout Configuration Ignored in SSE Connections #3033
    2. [BUG] Claude code does not obey values of MCP_TIMEOUT longer than 60 seconds #16837
    3. [BUG] MCP tool responses lost for long-running HTTP tools (works in Cursor, fails in Claude Code) #18684

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  4. unbalanced commented on Jan 29, 2026

    @unbalanced

    Kindly Bumping - Will MCP_TOOL_TIMEOUT get respected again soon?

  5. github-actions commented on Feb 28, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  6. github-actions commented on Mar 8, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  7. locked as resolved and limited conversation to collaborators on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions