.mcp.json silently ignores unsupported fields (e.g. cwd) — should warn

Resolved 💬 3 comments Opened Apr 3, 2026 by OneHotBabe4U123 Closed Apr 6, 2026

When a .mcp.json stdio server entry contains fields that Claude Code doesn't support (like cwd), they are silently ignored with no error, warning, or log output. This caused 13 days of broken MCP servers in our project before we diagnosed it.

The cwd field is part of the MCP specification for stdio transports and is supported by other MCP clients (VS Code extensions, Cursor, Windsurf). A user or AI agent writing .mcp.json has no way to know Claude Code doesn't support it until they debug the resulting spawn failures.

Expected behavior

Claude Code should emit a warning when it encounters unrecognized fields in .mcp.json server entries, e.g.:

Warning: Unknown field 'cwd' in MCP server 'dread-intel' — this field will be ignored

Current behavior

Unknown fields are silently dropped. The server launches without cwd, fails to import modules, and the user sees a generic connection failure with no hint that the config was partially ignored.

Alternatively: support cwd

Even better than warning would be to support cwd natively, since it's part of the MCP spec and supported by other clients. But at minimum, a warning on unknown fields would prevent hours of debugging.

Workaround

Use wrapper shell scripts that cd before exec-ing the server binary:

#!/bin/bash
cd "/path/to/project"
exec /path/to/.venv/bin/python3 -m my_server.module

Environment

  • Claude Code 2.1.91
  • macOS (Darwin 23.6.0)
  • .mcp.json with stdio Python MCP servers

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗