[BUG] /mcp command doesn't display stderr output from failed MCP server connections
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?
When an MCP server fails to start or connect, the /mcp command only shows a generic failure message like "Failed to reconnect to github" but doesn't display the stderr output from the MCP server script. This makes it very difficult to debug MCP connection issues because the actual error messages and troubleshooting instructions from the server are hidden from the user.
For example, my GitHub MCP script outputs detailed error messages to stderr explaining that authentication is needed and providing exact commands to fix it, but none of this appears in the /mcp command output.
What Should Happen?
When an MCP server fails to connect, the /mcp command should display the stderr output from the server process so users can see what went wrong and how to fix it. This is especially important since MCP servers are expected to log diagnostic information to stderr according to the MCP specification.
Error Messages/Logs
When running /mcp to reconnect, I only see:
Failed to reconnect to github.
Steps to Reproduce
Steps to Reproduce
- Create an MCP server script that outputs error messages to stderr when it fails:
```bash
#!/bin/bash
echo "[My MCP] ERROR: Authentication failed!" >&2
echo "[My MCP] Please run: some-auth-command" >&2
exit 1
- Configure this as an MCP server in Claude Code's MCP configuration
- Run /mcp in Claude Code to connect to the server
- Observe that only "Failed to reconnect to " appears, but the detailed error messages from step 1 are not shown
Expected: The error messages from stderr should be displayed to help debug the connection issue
Actual: Only a generic "Failed to reconnect" message appears
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.6
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗