warp icon indicating copy to clipboard operation
warp copied to clipboard

Warp global file-based MCP servers do not auto-spawn from ~/.warp/.mcp.json

Open vkodithala opened this issue 7 months ago • 4 comments

Summary

Warp-configured global file-based MCP servers under ~/.warp/.mcp.json are not being auto-spawned, even though they should always spawn by default. The Auto-spawn servers from third-party agents setting should only control third-party global configs such as ~/.claude/settings.json.

Problem

A user reported that file-based MCP auto-spawn behavior does not match the intended scope split between Warp-managed global MCP config and third-party global MCP config. Warp global MCP servers are expected to be treated as trusted Warp-configured servers and spawned regardless of the third-party auto-spawn toggle. Instead, servers configured under the Warp global MCP config appear not to spawn whether the third-party setting is off or on.

This smells like a path/scope classification bug: Warp may not be correctly recognizing the relevant config path as the global Warp MCP config when deciding whether a detected file-based server is globally scoped.

Expected behavior

  • Servers configured in Warp's global MCP config, e.g. ~/.warp/.mcp.json, auto-spawn by default regardless of the Auto-spawn servers from third-party agents setting.
  • Third-party global MCP servers, e.g. from ~/.claude/settings.json, auto-spawn only when Auto-spawn servers from third-party agents is enabled.
  • Project-scoped file-based MCP servers do not auto-spawn automatically and continue to require explicit opt-in.

Actual behavior

Warp-configured global file-based MCP servers under ~/.warp/.mcp.json are not being spawned in either setting state:

  • Toggle off: Warp global servers do not spawn.
  • Toggle on: Warp global servers still do not spawn.

Third-party global auto-spawn behavior may still depend on the toggle, but the Warp-global path appears not to be classified/spawned correctly.

Reproduction steps or desired workflow

  1. Configure one or more file-based MCP servers in Warp's global MCP config at ~/.warp/.mcp.json.
  2. Ensure Auto-spawn servers from third-party agents is disabled.
  3. Open Warp/Agent Mode and observe whether the Warp global MCP servers are spawned.
  4. Enable Auto-spawn servers from third-party agents.
  5. Observe whether the same Warp global MCP servers are spawned.

Expected: the Warp global MCP servers spawn in both steps 3 and 5. Actual: the Warp global MCP servers do not spawn in either case.

Artifacts

None attached.

Warp version

v0.2026.04.30.08.57.dev_00

Operating system

macOS 26.4.1 (build 25E253)

Possible source references

  • app/src/ai/mcp/file_based_manager.rs: is_global_server, is_global_warp_server, spawn_file_based_servers, and handle_file_based_mcp_enabled_change encode the intended split: global Warp servers always auto-spawn, global third-party servers respect the toggle, and project-scoped servers do not auto-spawn.
  • app/src/settings/ai.rs: file_based_mcp_enabled describes the user-visible setting as controlling third-party file-based MCP servers, while Warp-native .warp/.mcp.json configs are always detected and spawned.
  • app/src/ai/mcp/file_based_manager_tests.rs: tests cover global Warp auto-spawn, global non-Warp toggle behavior, and project-scoped non-auto-spawn behavior; this area likely needs coverage for the exact discovered root/path shape that fails in practice.

vkodithala avatar May 02 '26 02:05 vkodithala

@vkodithala

Here's what I found while triaging this issue:

This matches a code path where Warp-managed MCP configs can be detected but not classified as Warp-global, which would cause them to be skipped by auto-spawn in both setting states. No additional reporter details are needed for initial routing.

Maintainer details

I concluded that warp-global file-based MCP servers from ~/.warp/.mcp.json appear to be discovered with the wrong root scope, causing them to be skipped by auto-spawn in both third-party toggle states..

Triage

This looks like a bug in file-based MCP scope classification for Warp-managed global config. The intended behavior is that Warp-managed global MCP servers always auto-spawn, while third-party global servers are gated by the setting and project-scoped servers require explicit opt-in.

Evidence

  • The report includes a clear reproduction path using ~/.warp/.mcp.json, both states of the third-party auto-spawn setting, the affected Warp version, and macOS version.
  • app/src/warp_managed_paths_watcher.rs returns root_path: home_dir()? for warp_managed_mcp_config_path().
  • app/src/ai/mcp/file_mcp_watcher.rs passes that root into parsing for MCPProvider::Warp on initial scans and updates.
  • app/src/ai/mcp/file_based_manager.rs currently treats Warp-provider installs as global only when their root equals warp_data_dir(), so a watcher-produced home-directory root would not match either is_global_warp_server or the Warp branch of is_global_server.
  • app/src/ai/mcp/file_based_manager_tests.rs covers the intended auto-spawn split, but the global Warp test injects warp_data_dir() directly and therefore does not cover the root shape produced by the real watcher path.

Likely fix direction

Align the root used for Warp-managed global MCP config with the manager's classification logic, or update the manager to classify the actual warp_managed_mcp_config_path() root/config path as Warp-global. Add a regression test that exercises the watcher-produced root for ~/.warp/.mcp.json rather than only manually passing warp_data_dir().

Duplicate check

I found related MCP issues, including one about .warp/.mcp.json servers being connected but unavailable to Oz, and one about slash command naming. Those do not match this issue's specific failure mode of Warp-global file-based servers not auto-spawning, and there are not two likely duplicates, so this should remain a standalone issue.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz

warp-for-oss[bot] avatar May 02 '26 02:05 warp-for-oss[bot]

This issue has been labeled ready-to-implement and is open for contributions involving code changes. If you'd like to tackle it, feel free to open a pull request against this issue. You can also comment @oz-agent on this issue to have the bot draft an implementation PR automatically.

warp-for-oss[bot] avatar May 02 '26 03:05 warp-for-oss[bot]

@oz-agent The solution recommended in the triage comment under "Maintainer details" is the correct one. A quick summary of the issue and fix:

Warp-managed global file-based MCP servers from ~/.warp/.mcp.json are detected, but they are stored under the home directory as their logical root while FileBasedMCPManager classifies Warp-global servers by comparing that root against warp_data_dir(), so they fail both the “always spawn Warp global servers” path and the third-party-toggle-gated global path. The fix is to align classification with the actual Warp home MCP config location: either store Warp MCP detections under the Warp home config directory root, or update the manager to recognize warp_managed_mcp_config_path() / warp_home_mcp_config_file_path() as the source of Warp-global MCP servers instead of relying on warp_data_dir(), then add a regression test that uses the watcher-produced root/config path rather than manually passing warp_data_dir().

Let's build out a minimal solution here.

vkodithala avatar May 02 '26 03:05 vkodithala

@vkodithala

I'm implementing this issue with no spec context.

You can view the conversation on Warp.

I created a new draft implementation PR for this issue.

Next steps:

  • Review the implementation changes in the PR.
  • Complete any manual verification needed for this issue before merging.

Powered by Oz

warp-for-oss[bot] avatar May 02 '26 03:05 warp-for-oss[bot]