Skip to content

Fix Claude Desktop config overwrite when using save panel#150

Open
sciencemanx wants to merge 1 commit intomattt:mainfrom
sciencemanx:fix/claude-desktop-config-overwrite
Open

Fix Claude Desktop config overwrite when using save panel#150
sciencemanx wants to merge 1 commit intomattt:mainfrom
sciencemanx:fix/claude-desktop-config-overwrite

Conversation

@sciencemanx
Copy link

Summary

  • When the save panel fallback is used (first run, no security-scoped bookmark), the existing config file contents were lost because loadConfig() couldn't read the file due to sandbox restrictions
  • The save panel grants file access, so now re-reads and merges the existing config before writing instead of overwriting with the empty default
  • Preserves all existing preferences, other mcpServers entries, and any other top-level keys

Test plan

  • Delete any stored security-scoped bookmark (fresh install scenario)
  • Add custom entries to claude_desktop_config.json (e.g. preferences, other MCP servers)
  • Click "Configure Claude Desktop" — verify the save panel appears
  • Select the existing config file — verify existing entries are preserved and iMCP is added/updated

🤖 Generated with Claude Code

When the save panel fallback is used (first run, no security-scoped
bookmark), the existing config file contents were lost because
loadConfig() couldn't read the file due to sandbox restrictions.
The save panel grants file access, so re-read and merge the existing
config before writing instead of overwriting with the empty default.

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.

1 participant