claude-code - 💡(How to fix) Fix [Bug] MCP configuration not persisted between sessions [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46439Fetched 2026-04-11 06:20:15
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n at KTq (/$bunfs/root/src/entrypoints/cli.js:249:281283)\n at async nbq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n at async ey6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n at async h8_ (/$bunfs/root/src/entrypoints/cli.js:2812:2084)\n at async CfH (/$bunfs/root/src/entrypoints/cli.js:2837:5698)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2906:3288)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-10T22:16:38.092Z"}]

Code Example

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at KTq (/$bunfs/root/src/entrypoints/cli.js:249:281283)\n    at async nbq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async ey6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async h8_ (/$bunfs/root/src/entrypoints/cli.js:2812:2084)\n    at async CfH (/$bunfs/root/src/entrypoints/cli.js:2837:5698)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2906:3288)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-10T22:16:38.092Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description /mcp config does not get persisted between sessions.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.101
  • Feedback ID: f1376a1a-81f7-4e51-bc33-e200e6b440c7

Errors

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at KTq (/$bunfs/root/src/entrypoints/cli.js:249:281283)\n    at async nbq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async ey6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async h8_ (/$bunfs/root/src/entrypoints/cli.js:2812:2084)\n    at async CfH (/$bunfs/root/src/entrypoints/cli.js:2837:5698)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2906:3288)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-10T22:16:38.092Z"}]

extent analysis

TL;DR

The issue with /mcp config not persisting between sessions may be related to a keychain entry deletion error, and checking the keychain configuration or handling the error differently could provide a workaround.

Guidance

  • Investigate the keychain configuration on the darwin platform to ensure it is set up correctly to store and retrieve sensitive information.
  • Review the error handling in the cli.js file, specifically around lines 249 and 402, to see if there's a way to gracefully handle the "The specified item could not be found in the keychain" error without failing to persist the config.
  • Consider adding logging or debugging statements to understand the flow of the program and how it interacts with the keychain, which might help in identifying why the keychain entry is not found.
  • Look into the security command on darwin to see if there are any specific settings or configurations that could be affecting the ability to delete or access keychain entries.

Example

No specific code example can be provided without more context or information about the cli.js file or the keychain interactions.

Notes

The provided error message suggests an issue with interacting with the keychain, but without more details about the code or the environment, it's challenging to provide a precise fix. The issue might be specific to the darwin platform or the ghostty terminal.

Recommendation

Apply workaround: Given the information, it seems more feasible to apply a workaround, such as handling the keychain error differently or configuring the keychain settings, rather than waiting for an upgrade to a potentially fixed version, as no such version is mentioned in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING