@@ -204,13 +204,10 @@ Write-Host ""
204204Write-Host " Step 6: Configuring Context7 MCP server..." - ForegroundColor Cyan
205205
206206try {
207- # Find the claude command location (npm global install path)
208- $npmPath = (npm config get prefix 2> $null )
209- if (! $npmPath ) {
210- # Fallback to default npm path
211- $npmPath = Join-Path $env: APPDATA " npm"
212- }
207+ # npm global packages are always installed in %APPDATA%\npm on Windows
208+ $npmPath = Join-Path $env: APPDATA " npm"
213209
210+ # Look for claude executable in the standard location
214211 $claudePath = Join-Path $npmPath " claude.ps1"
215212 $claudeCmd = Join-Path $npmPath " claude.cmd"
216213
@@ -223,8 +220,8 @@ try {
223220 }
224221
225222 if ($claudeExe ) {
226- # Run the MCP command with full path
227- $mcpCommand = " & `" $claudeExe `" mcp add --transport http context7 https://mcp.context7.com/mcp"
223+ # Run the MCP command with full path, also updating PATH for the subprocess
224+ $mcpCommand = " `$ env:Path = `" $npmPath ; `$ env:Path `" ; & `" $claudeExe `" mcp add --transport http context7 https://mcp.context7.com/mcp 2> `$ null "
228225
229226 $mcpProcess = Start-Process - FilePath " powershell.exe" - ArgumentList @ (
230227 " -NoProfile" ,
@@ -239,7 +236,7 @@ try {
239236 Write-Info " To verify or add manually, run: claude mcp add --transport http context7 https://mcp.context7.com/mcp"
240237 }
241238 } else {
242- Write-Warn " Could not locate claude command"
239+ Write-Warn " Could not locate claude command at expected location: $npmPath "
243240 Write-Info " To add manually after opening a new terminal, run: claude mcp add --transport http context7 https://mcp.context7.com/mcp"
244241 }
245242} catch {
0 commit comments