Expand description
The root folders and the seven operations on them.
Folder holds each root opened as a cap_std::fs::Dir. Every file operation goes
through one of those handles with a root-relative path, so the operating system (via cap-std)
refuses anything that would resolve outside that root: absolute paths, .., and symlinks
pointing out, including symlinks from one root into another. Listing and search walk with the
ignore crate (ripgrep’s walker, .gitignore and hidden-file aware, symlinks not
followed); each path the walker yields is made relative to its root and re-opened through the
Dir, never by its absolute path, so an entry swapped for an escaping symlink mid-walk is
skipped rather than read.
With one root, tool paths are plain root-relative paths. With several, a tool path starts
with the root’s name (docs/guide.md), and . is a virtual folder holding the roots.
The operations are synchronous; the MCP layer runs them on the blocking pool.
Structs§
- Config
- What the operator configured at start-up.
- Folder
- The root folders, opened once, and the operator’s limits.
- Root
Spec - One root folder as the operator named it:
DIRorNAME=DIR.
Enums§
- Read
Output - Result of
read. - Write
Mode - How
writetreats an existing file.
Constants§
- DEFAULT_
MAX_ CHARS - Default for
Config::max_chars: emperor-mcp’s default output cap. - DEFAULT_
MAX_ FILE_ BYTES - Default for
Config::max_file_bytes: 1 MiB. - DEFAULT_
MAX_ RESULTS - Default for
Config::max_results. - MAX_
IMAGE_ BYTES - Largest image
readreturns as image content: 5 MiB.