diff --git a/install.ps1 b/install.ps1 index 5da5916..f4d11ef 100644 --- a/install.ps1 +++ b/install.ps1 @@ -310,8 +310,21 @@ function Set-McpConfig { } } -# Claude Code -Set-McpConfig "$env:USERPROFILE\.claude.json" "Claude Code" +# Claude Code (CLI). Gate on .claude existing so we don't create a stray +# config file for users who don't actually have Claude Code installed. +if ((Test-Path "$env:USERPROFILE\.claude") -or (Test-Path "$env:USERPROFILE\.claude.json")) { + Set-McpConfig "$env:USERPROFILE\.claude.json" "Claude Code" +} + +# Claude Desktop (separate product from Claude Code). Same "mcpServers" shape +# as Claude Code / Copilot / VS Code, different config path. We gate on the +# %APPDATA%\Claude directory existing — that's where the desktop app stores +# its state — so we don't drop a phantom config for users who haven't +# installed Claude Desktop. +$claudeDesktopDir = "$env:APPDATA\Claude" +if (Test-Path $claudeDesktopDir) { + Set-McpConfig "$claudeDesktopDir\claude_desktop_config.json" "Claude Desktop" +} # GitHub Copilot (if .copilot dir exists) if (Test-Path "$env:USERPROFILE\.copilot") { diff --git a/install.sh b/install.sh index c4ea2ac..53bc7e7 100755 --- a/install.sh +++ b/install.sh @@ -366,8 +366,24 @@ if [ -d "${HOME}/.cursor" ]; then configure_mcp_client "${HOME}/.cursor/mcp.json" "Cursor" fi -# Claude Code -configure_mcp_client "${HOME}/.claude.json" "Claude Code" +# Claude Code (CLI). Gate on ~/.claude existing so we don't create a stray +# config file for users who don't actually have Claude Code installed. +if [ -d "${HOME}/.claude" ] || [ -f "${HOME}/.claude.json" ]; then + configure_mcp_client "${HOME}/.claude.json" "Claude Code" +fi + +# Claude Desktop (separate product from Claude Code). Uses the same +# "mcpServers" shape but lives at a different path, and only on macOS/Windows +# — Anthropic does not ship a Linux build, so this branch is macOS-only here. +# We gate on the Claude Desktop app-support directory existing rather than +# auto-creating it: users who haven't installed Claude Desktop shouldn't get +# a phantom config file under ~/Library/Application Support/Claude. +if [[ "$(uname -s)" == "Darwin" ]]; then + CLAUDE_DESKTOP_DIR="${HOME}/Library/Application Support/Claude" + if [ -d "$CLAUDE_DESKTOP_DIR" ]; then + configure_mcp_client "${CLAUDE_DESKTOP_DIR}/claude_desktop_config.json" "Claude Desktop" + fi +fi # OpenCode (https://opencode.ai). The studio reads opencode.json first, then # opencode.jsonc. If neither exists but the binary is on PATH or the config