[BUG] Inconsistent Behavior Between CLI and VS Code Extension with Enterprise MCP Configuration
Status Fixed / completed
Maintainer reply None cached
Activity 12 comments · opened Nov 18, 2025 · closed Dec 18, 2025
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?
The Claude Code VS Code extension crashes with exit code 1 when /etc/claude-code/managed-mcp.json exists, while the Claude CLI handles the same configuration without issues. This behavior is undocumented and creates an inconsistent user experience across Claude Code implementations.
What Should Happen?
Based on the MCP documentation, enterprise MCP configuration should have "highest precedence" but should not prevent Claude Code from starting. Both CLI and VS Code extension should handle enterprise MCP configuration consistently.
Error Messages/Logs
2025-11-18 22:35:04.070 [info] From claude: You cannot dynamically configure your MCP configuration when an enterprise MCP config is present
2025-11-18 22:35:04.076 [info] From claude: Claude Code process exited with code 1
2025-11-18 22:35:04.076 [error] Error from Claude (on channel kgdqeltnvdl): Error: Claude Code process exited with code 1
Steps to Reproduce
Reproducible Test Case
#!/bin/bash
# Test script to reproduce the issue
echo "Setting up enterprise MCP config..."
sudo mkdir -p /etc/claude-code
sudo tee /etc/claude-code/managed-mcp.json > /dev/null <<'EOF'
{
"mcpServers": {
"test-server": {
"type": "stdio",
"command": "echo",
"args": ["test"]
}
}
}
EOF
echo "Adding user MCP server..."
claude mcp add --transport stdio test-user-server -- echo test-user
echo "Testing CLI..."
if claude mcp list &>/dev/null; then
echo "✓ CLI works with enterprise config present"
else
echo "✗ CLI fails with enterprise config present"
fi
echo ""
echo "Testing VS Code extension..."
echo "1. Open VS Code"
echo "2. Try to use Claude Code extension"
echo "3. Check if extension starts or crashes"
echo ""
echo "Expected: Both should work"
echo "Actual: VS Code extension crashes, CLI works"
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.45 (Claude Code)
Platform
AWS Bedrock
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
12 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The documentation says "The managed-mcp.json file uses the same format as a standard .mcp.json file." I have verified that when this code is in the /\<project\>/.mcp.json file, the MCP server is configured and listed when 'claude mcp list' is run, and that the Claude Code extension for VS Code works.
When the same code is in C:\ProgramData\ClaudeCode\managed-mcp.json, the MCP server is still configured and is listed when 'claude mcp list' is run, but the VS Code extension fails with this message:
Error: Claude Code process exited with code 1
In the VS Code output, I see this, as noted in the OP:
We are running into the same issues (but on macOS) and as far as I can tell this stopped working after 2.0.37
<img width="1066" height="239" alt="Image" src="https://github.com/user-attachments/assets/70ba16f9-3b8b-493e-a95b-abd2e35196ba" />
In 2.0.37
in 2.0.42 and later (up until 2.0.47)
The useTerminal option works with all versions just to be clear
An interesting note is that it seems that the extension is actually continuing after the error when looking at the logs but the channel for the client is dead so you can't communicate with it
Can confirm that this got fixed when I switched back to version 2.0.52
Hmm @mrafayaleem when I try I still run into the same issue both with 2.0.52 and 2.0.53
I see the same issue with version 2.0.55.
Still and issue with 2.0.58
I am surprised anthropic makes no effort to fix this since the terminal is considered legacy.
Still exists with 2.0.60
This seems to work now again in 2.0.73 atleast, unsure in which version this got fixed
I ran the test I used above with v2.0.72, and the VSCode extension does not crash. Yesterday, I was testing with v2.0.65 and it was crashing. Here's a snippet from the logs using v2.0.72:
2025-12-18 15:04:55.473 [info] From claude: 2025-12-18T20:04:55.474Z [DEBUG] [LSP MANAGER] initializeLspServerManager() called
2025-12-18T20:04:55.474Z [DEBUG] [LSP MANAGER] Created manager instance, state=pending
2025-12-18 15:04:55.474 [info] From claude: 2025-12-18T20:04:55.474Z [DEBUG] [LSP MANAGER] Starting async initialization (generation 1)
2025-12-18 15:04:55.481 [info] From claude: 2025-12-18T20:04:55.480Z [DEBUG] LSP server manager initialized successfully
2025-12-18T20:04:55.480Z [DEBUG] LSP notification handlers registered successfully for all 0 server(s)
I'm still experiencing this problem on v2.0.75 and the only way I have finally been able to get the VS Code extension to work was to delete the
managed-mcp.jsonfile altogether.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.