Skip to content

[MCP] Option for absolute paths in tool result links #42497

Closed

Description

Tool results name generated files with paths relative to the server's working directory, for example - [Snapshot](./page-2026-08-25T09-14-22-104Z.yml).

A client that is not a process with a working directory cannot resolve these. This is the normal case when the consumer is a model rather than a shell.

Request: a config option such as pointerPaths: "absolute" | "relative", default relative, that makes the path returned by Response._computeRelativeTo absolute.

It would cover the screenshot, PDF and storage-state links, the snapshot link, the console log link, the download line, binary response body lines, and the trace links. They all resolve through the same two call sites.

Activity

  1. changed the title [-]Option for absolute paths in tool result links[/-] [+][MCP] Option for absolute paths in tool result links[/+] on Sep 1, 2026
  2. dgozman commented on Sep 2, 2026

    @dgozman
    Collaborator

    Jori Huisman (@SixFive7) Could you please share your exact repro? How do you start the mcp server? Which client do you connect through? Are you using stdio or http? How come the cwd is not known to the client?

  3. timrogers commented on Sep 3, 2026

    @timrogers

    I'm running into this as well, and it makes agents very confused!

    I would support adding an absolute path option, or perhaps just changing the default...

    In my implementation, the MCP client is the GitHub Copilot SDK but we have an MCP proxy, separate from the client, that connects to a bunch of MCP servers (HTTP and stdio) and bundles them into one HTTP server.

  4. dgozman commented on Sep 3, 2026

    @dgozman
    Collaborator

    Tim Rogers (@timrogers) Unfortunately, your description doesn't tell us much. Why is your client not sending workspace roots? How come you don't control the cwd of the MCP server you start?

  5. SixFive7 commented on Sep 17, 2026

    @SixFive7
    Author

    Sorry for the slow reply. I was away.

    How it starts: my own Windows MCP server spawns @playwright/mcp as a child over stdio, never HTTP. It runs a bundled node.exe against the package's cli.js with a generated --config, and sets both the child's working directory and outputDir to one per-session output folder. Any snapshot or screenshot call through that shows it.

    Which client: Claude Code starts my server over stdio. My server forwards tools/list and tools/call down to the child and returns the child's result bytes unchanged, so nothing of mine rewrites a path.

    Why the cwd isn't known: Claude Code's cwd is the user's project directory, which isn't what those links are relative to. The child's cwd is a session directory my server picks, a layer below the client, and it changes per session. What reads the result is a model with no cwd at all, so ./page-2026-08-25T09-14-22-104Z.yml points nowhere for it and isn't clickable for me either.

    Pavel, thank you for just building it. --file-paths=absolute is exactly right. I'm not waiting for the next @playwright/mcp roll, I'm pulling the alpha that carries it into my build now. Thanks to the whole team.

  6. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions