[BUG] MCPs Failing every time, but found a quirky workaround
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?
I have been fighting with multiple MCP failures in claude cli for weeks. only 3 were succeeding and the rest failing.
5MCPs are sequential-thinking, perplexity, github, next-devtools and context7
After a day of troubleshooting with opus ui and cli, things that didn't work, using sleeps in same or sequential, global only, project only, etc. It appears CLI ignored the sleeps, failures were immediate regardless of sleep time.
What I found to finally work. I put 3 dummy mcps _pad1 _pad2 and _pad3 and they would immediately fail
`_pad1": {
"command": "/usr/bin/true",
"args": []
},
but my real ones would succeed
_pad1 · ✘ failed
_pad2 · ✘ failed
_pad3 · ✘ failed
context7 · ✔ connected
perplexity · ✔ connected
sequential-thinking · ✔ connected
next-devtools · ✔ connected
I stopped using github
This works for some reason, though all other attempts failed. For troubleshooting purposes btw, all would connect just fine if I clicked "reconnect" so it is some kind of timing/buffering issue, but logs don't really say anything and sleeps didn't help at all.
Hope this helps someone!
PS: On a hostinger VPS 5 CPU, 6GB ram. running Linux 4.18.0-553.84.1.lve.el8.x86_64
What Should Happen?
MCPs should startup instantl (maybe retry once if fail)
Error Messages/Logs
Session WITHOUT pad hack (75da4e7f, same day earlier):
00:32:38.429 perplexity: Starting connection...
00:32:38.431 context7: Starting connection...
00:32:38.433 sequential-thinking: Starting connection...
00:32:39.192 perplexity: Connection failed (766ms) - Connection closed
00:32:39.198 sequential-thinking: Connection failed (766ms) - Connection closed
00:32:39.651 context7: Connection failed (1220ms) - Connection closed
00:32:39.653 next-devtools: Starting connection...
00:32:40.286 next-devtools: Successfully connected (634ms) ← alone, works fine
All 3 in the first batch die. The 4th, started alone, succeeds.
Session WITH pad hack (162d7e4d, current):
01:37:24.579 _pad1: Starting connection...
01:37:24.581 _pad2: Starting connection...
01:37:24.582 _pad3: Starting connection...
01:37:24.791 _pad1: Connection failed (215ms) - Connection closed
01:37:24.792 _pad2: Connection failed (212ms) - Connection closed
01:37:24.792 _pad3: Connection failed (211ms) - Connection closed
01:37:24.793 perplexity: Starting connection...
01:37:24.794 context7: Starting connection...
01:37:24.796 sequential-thinking: Starting connection...
01:37:25.015 perplexity: Successfully connected (223ms) ✓
01:37:25.074 sequential-thinking: Successfully connected (279ms) ✓
01:37:25.359 context7: Successfully connected (565ms) ✓
01:37:25.365 next-devtools: Starting connection...
01:37:25.784 next-devtools: Successfully connected (420ms) ✓
Dummy entries absorb the failing batch; real MCPs start in batch 2 and all succeed.
Steps to Reproduce
add multiple MCPs and 3 will almost always fail, repeatable on 7 of my projects, with both project level and global level.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.63
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗