[BUG] Inconsistent Behavior Between CLI and VS Code Extension with Enterprise MCP Configuration

Resolved 💬 12 comments Opened Nov 18, 2025 by cjpeterein 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_

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗