agent: Don't connect to MCP servers when AI is globally disabled#47857
Merged
bennetbo merged 8 commits intozed-industries:mainfrom Mar 6, 2026
Merged
Conversation
When `disable_ai: true` is set in user settings, Zed was still connecting to configured MCP (context) servers and sending initialization requests. This change adds checks for `DisableAiSettings` in `ContextServerStore` to: - Skip server connections when AI is disabled - Disconnect from running servers when AI becomes disabled - Connect to servers when AI is re-enabled - Prevent registry changes from triggering connections while AI is disabled The fix tracks `ai_disabled` state to detect transitions and properly manage server connections when AI is toggled.
Contributor
Author
|
check docs build is failing at linux install step, looks unrelated to the PR (and I can't re-run it to check if it's a temporary thing) |
Contributor
Author
|
This is still working with latest main. Manually tested again just now to double check |
dapovoa
pushed a commit
to dapovoa/zed
that referenced
this pull request
Mar 7, 2026
…-industries#47857) Closes zed-industries#46846 When `disable_ai: true` is set in user settings, Zed was still connecting to configured MCP (context) servers and sending initialization requests. This change adds checks for `DisableAiSettings` in `ContextServerStore` to: - Skip server connections when AI is disabled - Disconnect from running servers when AI becomes disabled - Connect to servers when AI is re-enabled - Prevent registry changes from triggering connections while AI is disabled The fix tracks `ai_disabled` state to detect transitions and properly manage server connections when AI is toggled. Release Notes: - Fixed Zed connecting to MCP servers when AI is disabled. ---------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46846
When
disable_ai: trueis set in user settings, Zed was still connecting to configured MCP (context) servers and sending initialization requests. This change adds checks forDisableAiSettingsinContextServerStoreto:The fix tracks
ai_disabledstate to detect transitions and properly manage server connections when AI is toggled.Release Notes: