feat: support configurable filesystem roots - #2605
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| alias: 'workspace', | ||
| describe: | ||
| 'A directory that filesystem tools are allowed to access. May be specified more than once. ' + | ||
| 'The OS temp directory is always allowed.', |
There was a problem hiding this comment.
let's set the defaults to os temp dir here, by using yargs default value option
There was a problem hiding this comment.
Updated. filesystemRoot now uses os.tmpdir() as its yargs default. I also added a stable default description so generated docs show OS temp directory instead of a machine-specific path.
| 'no roots are configured. Use this only when connecting a trusted local client that does not implement ' + | ||
| 'MCP roots and requires access to paths outside the temp directory.', | ||
| }, | ||
| filesystemRoot: { |
There was a problem hiding this comment.
we should probably make it conflict with allowUnrestrictedPaths. I think allowUnrestrictedPaths could be deprecated in favor of specifying --workspace=/.
There was a problem hiding this comment.
Added the conflict and deprecated --allow-unrestricted-paths in favor of --workspace=/. The old flag still works by itself for compatibility, but it is rejected when an explicit filesystem root is also supplied.
Fixes #2598
This lets people set filesystem roots through the MCP server or the Chrome DevTools CLI. Multiple roots work together with any roots sent by the MCP client, and temp directory access stays the same.
I added tests for the flags and root handling.