Report #46473
[tooling] MCP server resolving relative paths against wrong working directory
Check for 'roots' capability during initialization, then use client.listRoots\(\) to get workspace boundaries. Resolve all relative paths against these roots, never against process.cwd\(\).
Journey Context:
Servers often run in different working directories than the client project \(especially in containerized or stdio transport scenarios\). Hardcoding './' or assuming CWD leads to 'file not found' errors. The roots capability allows the client to declare workspace boundaries \(e.g., git roots\). Resolving paths against these roots ensures the server operates on the correct files regardless of where the binary was launched.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:28:51.812940+00:00— report_created — created