-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Environment
- OS: Windows 11
- Claude CLI: 2.0.55 (installed via npm)
- Claude CLI Path:
C:\Users\<user>\AppData\Roaming\npm\claude.cmd
Problem
The MCP server fails to find the Claude CLI on Windows with:
[Warning] Claude CLI not found at ~/.claude/local/claude.
Falling back to "claude" in PATH.
Root Cause
- The server searches for
~/.claude/local/claude- a Unix path that doesn't exist on Windows npm installations - The
CLAUDE_CLI_PATHenvironment variable is ignored - The PATH fallback doesn't properly handle Windows
.cmdextensions
Expected Behavior
The server should:
- Respect
CLAUDE_CLI_PATHenvironment variable if set - On Windows, check for
claude.cmd/claude.exein PATH - Not rely on Unix-specific paths like
~/.claude/local/claude
Workaround Attempted
Creating a symlink at ~/.claude/local/claude -> claude.cmd is problematic because:
- Windows symlinks to
.cmdfiles without extension cause execution issues - May conflict with other tools expecting that path
Suggested Fix
// Pseudocode
function findClaudeCli() {
// 1. Check env variable first
if (process.env.CLAUDE_CLI_PATH) {
return process.env.CLAUDE_CLI_PATH;
}
// 2. Platform-specific paths
if (process.platform === 'win32') {
// Try 'where claude' or check common npm paths
// Handle .cmd/.exe extensions
} else {
// Unix: ~/.claude/local/claude
}
// 3. Fallback to PATH
}Metadata
Metadata
Assignees
Labels
No labels