Skip to content

[BUG] Windows: ~/.claude/local/claude path not found, CLAUDE_CLI_PATH ignored #39

@arminender

Description

@arminender

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

  1. The server searches for ~/.claude/local/claude - a Unix path that doesn't exist on Windows npm installations
  2. The CLAUDE_CLI_PATH environment variable is ignored
  3. The PATH fallback doesn't properly handle Windows .cmd extensions

Expected Behavior

The server should:

  1. Respect CLAUDE_CLI_PATH environment variable if set
  2. On Windows, check for claude.cmd / claude.exe in PATH
  3. 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 .cmd files 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions