#LLM/MCP working directories and absolute paths

1 messages · Page 1 of 1 (latest)

patent breach
#

🧵

#

The problem:

  • MCP servers want to refer to everything with absolute paths. Lots of tools/prompts explicitly tell the LLM to do this (something like "always use absolute paths" is in Claude Code's prompts and tool descriptions).
  • Dagger runs MCP servers in containers. Naturally, you can configure MCP server A to work from /src and server B to work from /app. Currently Dagger mounts the env workspace into each service's respective workdir.
  • These two things obviously become a problem when the model sees a response from server A and passes it to server B, or to a module. Passing /src/main.go to Doug.readFile("/src/main.go") will fail because Doug has a virtual, logical working Directory and wants relative paths everywhere.

I had two ideas here:

  1. For each MCP server, generate a random workdir, /dskjflkjhgasdf, and remove it in tool responses, making all paths relative.
  2. Enforce a hard convention: the workspace is always at /workspace. Modules like Doug must handle it by just trimming it out of any referenced paths.

Currently leaning towards 2 but lemme know if anyone has a magical silver bullet idea

#

cc @cunning ocean in case this triggers any broader contextual filesystem related thoughts, since constraints like this are valuable for navigating such a nebulous problem area