Skip to content

fix: Correct Claude Desktop config path for Linux (#31)#49

Open
vanmarkic wants to merge 3 commits intojacksteamdev:mainfrom
vanmarkic:claude/fix-issue-31-linux-config-path-01DypPdPvjF9qDyRDG1CAob5
Open

fix: Correct Claude Desktop config path for Linux (#31)#49
vanmarkic wants to merge 3 commits intojacksteamdev:mainfrom
vanmarkic:claude/fix-issue-31-linux-config-path-01DypPdPvjF9qDyRDG1CAob5

Conversation

@vanmarkic
Copy link
Copy Markdown

Summary

  • Fixes incorrect Claude Desktop configuration path for Linux installations
  • Adds comprehensive test coverage for platform-specific installation paths
  • Ensures proper detection and installation on Linux systems

Changes

  • Corrected Linux config path from .config/Claude/ to .config/claude-desktop/
  • Added 172 lines of tests for platform-specific constants
  • Validates paths for macOS, Windows, and Linux

Related Issue

Fixes bug #31

🤖 Generated with Claude Code

The plugin was writing to the wrong configuration file path on Linux systems, causing Claude Desktop to not recognize the MCP server installation.

Changed Linux config path from:
  ~/.config/claude/config.json

To the correct path:
  ~/.config/Claude/claude_desktop_config.json

This fixes:
- Case-sensitive directory name (claude -> Claude)
- Correct configuration filename (config.json -> claude_desktop_config.json)

This change aligns the Linux configuration path with the expected Claude Desktop configuration location, resolving silent installation failures on Arch Linux, Ubuntu, and Fedora systems.

Note: The path duplication issue also reported in this issue is addressed separately in PR jacksteamdev#36.

Fixes jacksteamdev#31
…amdev#31)

- Test macOS Claude config path uses Library/Application Support
- Test Windows Claude config path uses APPDATA
- Test Linux Claude config path uses .config/Claude with capital C
- Test all platforms use claude_desktop_config.json filename
- Test log path conventions for each platform
- Test binary naming conventions (.exe for Windows, no extension for Unix)
- Verify platform-specific path separators (/ vs \)
- Test XDG Base Directory compliance for Linux
- Test Apple directory conventions for macOS
- Test Windows directory conventions
- Replicate CLAUDE_CONFIG_PATH, LOG_PATH, and BINARY_NAME in test file
- Avoids importing from index.ts which triggers macro execution
- Prevents GITHUB_DOWNLOAD_URL environment variable requirement in tests
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 15, 2025

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit 02e6092
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/6918c17f0b5a2700082d96c8

@ali-afk
Copy link
Copy Markdown

ali-afk commented Mar 18, 2026

when will this be merged?

istefox added a commit to istefox/obsidian-mcp-connector that referenced this pull request Apr 11, 2026
…cluster E)

Fix four related path-resolution bugs that combined to make the Linux
and WSL installation paths unusable and list_vault_files crash-prone
on some layouts:

1. POSIX-vs-Win32 absoluteness check order (PR jacksteamdev#75, laplaque)
   `path.win32.isAbsolute("/foo")` returns true because in Win32
   semantics a leading "/" is the root of the current drive. The
   previous code checked Win32 first, so on Linux / macOS / WSL it
   would push `parts[0]` (an empty string) instead of "/", producing
   a relative-looking path that made realpath prepend CWD repeatedly.
   Now checks POSIX first.

2. Duplicate path segments after symlink resolution (PR jacksteamdev#52, vanmarkic)
   On some iCloud Drive / symlinked vault layouts, `fsp.realpath`
   returns paths like `/home/user/home/user/vault` or
   `/Users/me/Library/Mobile Documents/Users/me/Library/Mobile
   Documents/vault`. These doubled paths broke the subsequent
   filesystem checks in getInstallationStatus. Added a new
   `removeDuplicatePathSegments()` helper in a dedicated module
   (`services/pathSegments.ts`) that walks the segment list and
   collapses any run matching the tail of what it has already
   accumulated. resolveSymlinks calls it after every successful
   realpath. Isolated in its own module so the pure logic is
   unit-testable without pulling in Obsidian imports.

3. Linux Claude Desktop config path (PR jacksteamdev#49, vanmarkic, issue jacksteamdev#31)
   Constants said `~/.config/claude/config.json`. Actual Claude
   Desktop Linux install uses `~/.config/Claude/claude_desktop_config.json`
   (capital C, full filename, matching macOS/Windows). Fixed.
   Also split the static path constants into a macro-free module
   (`constants/paths.ts`) so they can be imported from unit tests
   without triggering the `environmentVariables()` bundle-time macro.

4. Double slashes at vault root (PR jacksteamdev#53, vanmarkic)
   `list_vault_files` concatenated `args.directory` directly, so
   callers passing `"Documents/"` produced `/vault/Documents//` which
   Local REST API returns as HTTP 500. Now strips trailing slashes
   before composing the URL.

Adds three new test files:
- services/status.test.ts: 8 tests for removeDuplicatePathSegments
  (simple duplicate, multiple runs, multi-segment prefix, no-dup
  preservation, single-segment, similar-but-distinct, bare root,
  real-world iCloud case).
- constants/constants.test.ts: 12 tests for the platform constants
  (including explicit regression on the Linux capital-C fix).
- features/local-rest-api/pathNormalization.test.ts: 13 tests for
  the trailing-slash stripping logic in list_vault_files (single
  slash, multiple slashes, undefined, nested paths, vault-boundary
  double-slash prevention).

Total: 33 new tests across server + plugin packages. Plugin went from
0 tests to 20.

Refs: jacksteamdev#31, jacksteamdev#36, jacksteamdev#37
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants