You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed) #1386
Found while running the full suite for the v0.12.4 release.
test/mcp/headers.test.ts (5 tests) and test/server/httpapi-mcp.test.ts ("serves status endpoint") fail on any machine whose real ~/.claude.json has an entry under mcpServers. MCP discovery reads that file from the real $HOME, so the discovered server is created alongside the test's own servers: it has no requestInit, which breaks the headers assertions, and it changes the status endpoint's result.
test/preload.ts sandboxes the XDG directories but not HOME, so other home-directory config sources may leak the same way.
Reproduced on main (93fe816). With HOME pointed at an empty temporary directory, the same three files pass (15/15).
Suggested fix: point HOME (or the discovery's home-directory lookup) at a temporary directory in test/preload.ts, or have MCP discovery honour a test override, so the suite never reads the developer's own editor and assistant configs.
Activity
anandgupta42 commentedon Nov 5, 2026
Consolidated into #1682, which tracks this together with related issues. The original report here stays linked from that tracker.