claude-code - 💡(How to fix) Fix [BUG] VSCode extension doesn't load MCP servers on Windows due to drive letter case mismatch in .claude.json project key lookup [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45195Fetched 2026-04-09 08:11:03
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×6subscribed ×1

Error Message

Error Messages/Logs

Root Cause

Root cause: The VSCode extension passes a lowercase drive letter (c:...) as the working directory to the CLI subprocess, but the CLI writes project keys to ~/.claude.json with an uppercase drive letter (C:/...). The project key lookup appears to do a case-sensitive string comparison, so the VSCode subprocess finds no matching entry in .claude.json and loads no MCP servers.

Fix Action

Fix / Workaround

Workaround

Most of this was analysed and found using Claude Opus, including finding the workaround, and the suggestion to post this bug report. The initial suspect was a faulty feature gate config, but after retrying with Claude Code CLI it was clear there is something else at play, given that CLI was working with the configured MCP servers normally/as expected.

Code Example

echo $PWD in terminal: C:\Users\...\my-project (uppercase C:)
VSCode session file cwd field: c:\\Users\\...\\my-project (lowercase c:)
.claude.json project key (written by CLI): "C:/Users/.../my-project" (uppercase C:)
VSCode subprocess lookup key after slash normalization: "c:/Users/.../my-project" — does not match
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On Windows, MCP servers configured for a project are not available in the VSCode extension (the /mcp command shows "No MCP servers configured"), while the same project and same proxy/config work correctly in the CLI.

Root cause: The VSCode extension passes a lowercase drive letter (c:...) as the working directory to the CLI subprocess, but the CLI writes project keys to ~/.claude.json with an uppercase drive letter (C:/...). The project key lookup appears to do a case-sensitive string comparison, so the VSCode subprocess finds no matching entry in .claude.json and loads no MCP servers.

What Should Happen?

Claude Code should normalize drive letter case (e.g. toLowerCase()) when writing and/or looking up project keys in .claude.json on Windows, since Windows paths are case-insensitive.

Error Messages/Logs

echo $PWD in terminal: C:\Users\...\my-project (uppercase C:)
VSCode session file cwd field: c:\\Users\\...\\my-project (lowercase c:)
.claude.json project key (written by CLI): "C:/Users/.../my-project" (uppercase C:)
VSCode subprocess lookup key after slash normalization: "c:/Users/.../my-project" — does not match

Steps to Reproduce

  1. On Windows, add MCP servers to a project via CLI: claude mcp add ... from a project directory
  2. The CLI writes a project key like "C:/Users/.../my-project" to ~/.claude.json; can be verified using /mcp with the Claude Code CLI
  3. Open the same project in VSCode and start a Claude Code session
  4. Run /mcp — shows "No MCP servers configured"

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Workaround

Manually duplicate the project entry in ~/.claude.json with both C:/... and c:/... as keys. Note: these entries will drift out of sync when MCP servers are updated via CLI vs extension.

Additional context

Most of this was analysed and found using Claude Opus, including finding the workaround, and the suggestion to post this bug report. The initial suspect was a faulty feature gate config, but after retrying with Claude Code CLI it was clear there is something else at play, given that CLI was working with the configured MCP servers normally/as expected.

Most of this was encountered in an internal project, so I can't give the exact project files and configuration files this occured with.

extent analysis

TL;DR

Normalize drive letter case when writing and looking up project keys in .claude.json on Windows to fix the MCP server configuration issue in the VSCode extension.

Guidance

  • Verify the issue by checking the .claude.json file for project keys with different case drive letters and comparing them to the working directory passed by the VSCode extension.
  • To mitigate the issue, manually duplicate the project entry in .claude.json with both uppercase and lowercase drive letters as keys, but note that these entries will drift out of sync when MCP servers are updated.
  • Consider modifying the Claude Code CLI to write project keys with normalized drive letter case (e.g., using toLowerCase()) to prevent the issue.
  • Test the fix by running the /mcp command in the VSCode extension after normalizing the drive letter case in .claude.json and verifying that the MCP servers are correctly configured.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a modification to the existing logic for handling project keys in .claude.json.

Notes

The provided workaround may not be sustainable in the long term, as it requires manual duplication of project entries and may lead to inconsistencies when updating MCP servers via the CLI or extension.

Recommendation

Apply a workaround by normalizing drive letter case when writing and looking up project keys in .claude.json, as this is a more straightforward solution given the current version of Claude Code (2.1.96) and the lack of information about a fixed version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING