Paste an error to match it against the wiki. / 粘贴报错后自动匹配。
Error text / 报错原文
MCP servers failed to connectInvalid MCP configurationSSE stream disconnectedTypeError: terminated
What it means
Claude Code started, but one or more MCP server processes or remote transports failed during discovery, authentication, schema validation, or streaming.
Most common causes
- The MCP command works in an interactive shell but not in Claude Code environment
- Invalid JSON or wrong schema in .mcp.json
- Remote MCP OAuth token expired
- SSE server timeout or reverse proxy buffering
Fastest fix
- Run claude mcp list and identify the failing server
- Temporarily disable the failing server and retry the task
- Test the MCP command directly from the same terminal
- Validate .mcp.json as strict JSON
Safe fix
- Use absolute command paths for local MCP servers
- Keep secrets in environment variables, not checked-in JSON
- Set explicit timeouts for remote servers
- Reduce tool count for large coding sessions
What not to do
- Do not hardcode personal access tokens in shared configs
- Do not enable every MCP server globally
- Do not ignore stderr from local MCP processes
How to confirm the fix
Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.
claude mcp list node --version npx --version
Related errors
- You've hit your session limit / weekly limit - Claude Code →
- Prompt is too long - Claude Code context window →
- Not logged in - Please run /login - Claude Code →
- API Error: Repeated 529 Overloaded errors - Claude Code →
- Error calling initialize: EOF - Antigravity MCP →
- DISCONNECTED - Gemini CLI MCP server is not connected or has errors →