Skip to content

agent: Don't connect to MCP servers when AI is globally disabled#47857

Merged
bennetbo merged 8 commits intozed-industries:mainfrom
oliverbarnes:dont-ping-mcp-when-ai-disabled
Mar 6, 2026
Merged

agent: Don't connect to MCP servers when AI is globally disabled#47857
bennetbo merged 8 commits intozed-industries:mainfrom
oliverbarnes:dont-ping-mcp-when-ai-disabled

Conversation

@oliverbarnes
Copy link
Copy Markdown
Contributor

Closes #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.
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.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 28, 2026
@oliverbarnes
Copy link
Copy Markdown
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)

@SomeoneToIgnore SomeoneToIgnore added the area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features label Jan 28, 2026
@oliverbarnes
Copy link
Copy Markdown
Contributor Author

This is still working with latest main. Manually tested again just now to double check

Copy link
Copy Markdown
Member

@bennetbo bennetbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bennetbo bennetbo merged commit ba3aea0 into zed-industries:main Mar 6, 2026
28 checks passed
@oliverbarnes oliverbarnes deleted the dont-ping-mcp-when-ai-disabled branch March 7, 2026 11:10
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.

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

3 participants