fix: Windows CLI detection and CLAUDE_CLI_PATH env var#44
Open
bluzername wants to merge 1 commit intosteipete:mainfrom
Open
fix: Windows CLI detection and CLAUDE_CLI_PATH env var#44bluzername wants to merge 1 commit intosteipete:mainfrom
bluzername wants to merge 1 commit intosteipete:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows the MCP server cannot find Claude CLI because:
~/.claude/local/claudewhich is Unix-specific path, Windows npm install putsclaude.cmdin AppDataCLAUDE_CLI_PATHenv var mentioned in CLAUDE.md is not actually implemented (onlyCLAUDE_CLI_NAMEexists).cmdand.exeextensions are not considered when looking for the binaryThis makes the server completely unusable on Windows npm installations.
What I changed
Updated
findClaudeCli()insrc/server.tsto handle Windows properly:CLAUDE_CLI_PATHenv var - checks this first, validates file exists, warns if not found but continues to other methods. This is what users expect based on the CLAUDE.md documentationwin32platform, also checks for.cmdand.exevariants when looking at~/.claude/local/claudeAppData/Roaming/npm/claude.cmdand.exewhich is where npm global installs go on WindowsCLAUDE_CLI_NAMEstill works same as before,CLAUDE_CLI_PATHjust has higher priorityAlso added tests for the new
CLAUDE_CLI_PATHbehavior (existing unit test file already had broken mocks before this change, so only added tests that follow same pattern).How to use on Windows
Either:
{ "env": { "CLAUDE_CLI_PATH": "C:\\Users\\me\\AppData\\Roaming\\npm\\claude.cmd" } }Or just let the auto-detection find it in the npm global path.
Testing
npm run buildpasses cleanCloses #39