Repository navigation
[BUG] MCP Server Timeout Configuration Ignored in Streamable SSE HTTP Connections #20335
Description
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
JackDan9 commentedon Jan 23, 2026
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.
JackDan9 commentedon Jan 23, 2026
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.
github-actions commentedon Jan 23, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
unbalanced commentedon Jan 29, 2026
Kindly Bumping - Will
MCP_TOOL_TIMEOUTget respected again soon?github-actions commentedon Feb 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 8, 2026
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.