Expand description
Optional confinement of file access to one directory, for the MCP server.
An agent may be steered by the documents it reads. With a root set, no tool can be talked into reading or writing outside of it.
Constants§
- PATH_
KEYS - Argument names that hold file or directory paths, in any tool.
Functions§
- active
- check
- Fails if a root is set and
pathlies outside it. - check_
args - Checks every path argument of a tool call.
- set_
root - Confines all later tool calls to
dir, and resolves relative paths against it. - within
- Fails unless
pathlies insideroot, which must be canonical.