
emperor-folder
io.github.yarenty由 GitHub 账号 yarenty 发布v0.1.3更新于 Nov 3, 2026
在一个文件夹内列出、读取、搜索文件,并可选择写入、编辑和移动文件,绝不超出该文件夹。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
List, read, search and (opt-in) write, edit and move files inside one folder, never outside it.
概览
emperor-folder 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 emperor-folder,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
emperor-folder
An MCP server confined to one folder. You name a directory (or a few); the model can
list, read, search, and (if you allow it) write, edit and move files inside it, and cannot reach
anything outside it: not with an absolute path, not with .., not through a symlink.
Why
Giving an agent "the filesystem" is the fastest way to give it your SSH keys. Most file tools
check paths with string prefixes and then open them with the full authority of the process; a
symlink, a .. the check missed, or a race between check and open, and the model is out.
emperor-folder does not check-then-open. It opens the root once as a
cap-std directory handle and does every file
operation through that handle with a relative path, so resolution happens under the
operating system's (or cap-std's) beneath-the-root rules. There is no code path that opens a
file by absolute path.
It is built on emperor-mcp: stateless Streamable HTTP
(no session id, load-balancer friendly), output framed so file content reaches the model as
data rather than instructions, and a doctor subcommand. It follows
Emperor Profile P1.1: no write
tool is offered unless the operator switches writing on at start-up, and tool definitions are
lean (short descriptions, compact input schemas), so every request carries less of them.
Install
Release binaries for Linux (x86_64), macOS (Apple Silicon and Intel) and Windows are attached
to each GitHub release, with a
SHA256SUMS file and build provenance
attestations:
check a download with sha256sum -c SHA256SUMS --ignore-missing and
gh attestation verify <file> --repo yarenty/emperor-folder. From source (Rust 1.88 or newer):
Or as a container (stdio, the folder mounted at /data, read-only unless you add --writable):
Run
RUST_LOG sets the log level (default info).
Connect
Claude Code
With --writable (and several roots) in the stdio form:
Claude Desktop (claude_desktop_config.json, stdio):
kowalski (config.toml):
or over stdio:
Any other MCP client that speaks Streamable HTTP or stdio works the same way.
Tools
Seven tools, each a verb. Every path is relative to the root (. or omitted means the root).
The three that change files are offered only with --writable; a read-only server lists four.
Every tool sets openWorldHint: false: it touches the named folders and nothing else.
list and search use ignore, ripgrep's walker:
.gitignore (even outside a git checkout), .ignore and hidden files are skipped unless
--no-ignore / --hidden say otherwise, and symlinks are never followed. Regexes use the
regex crate: linear-time matching, no catastrophic
backtracking, compiled size capped at 1 MiB. Globs match the path as the tools show it
(*.rs matches src/main.rs).
Output. File content from read is framed as a document of unknown authorship
(FrameKind::Document); listings, matches and metadata are JSON framed as computed
results (FrameKind::Computed). The frame's per-call nonce means a file containing a fake
end-of-data marker cannot break out of the block. Refusals come back as tool errors
(isError: true) with a message that says what to do instead.
Several roots
--root can be given more than once. With one root nothing changes: paths are relative to it.
With several, every path starts with the root's name, and . is a virtual folder whose entries
are the roots:
A root without a name is named after its folder (--root ~/notes is notes); two roots with
the same name are refused at start-up. In NAME=DIR the name may not contain / or \, so
./a=b is a folder called a=b. Each root is its own cap-std handle: a path, .. or symlink
cannot get from one root into another except through move, which names both ends.
Security model
What the model can do: see and read files under the roots that the ignore rules do not
hide; with --writable, create, edit and rename files under the roots.
What it cannot do:
- Leave the root. Absolute paths (
/etc/passwd,C:\on Windows) are refused, and so is any path with a..component, even one that would stay inside (a/../b). That check gives a clear error; the enforcement underneath is cap-std, which resolves every path beneath the root handle (openat2(RESOLVE_BENEATH)on Linux, component-by-component resolution elsewhere) and refuses any resolution that leaves it. - Escape through symlinks. A symlink inside a root that points outside it (also into
another root) is refused for
read,write,edit,move,listandsearchalike; a symlink that stays inside works. The walker never follows links, and every path it yields is re-opened through the root handle, so a directory swapped for an escaping link mid-walk is skipped, not read. - Write by default. The server starts read-only:
write,editandmoveare removed from the tool list, and the file operations refuse writes as well, until the operator passes--writable(or setsFOLDER_WRITABLE), as Emperor Profile P1.1 requires. Tool annotations (readOnlyHint,destructiveHint) tell clients which tools change files, so they can ask before running them. - Exhaust the host or the context. Whole-file reads stop at
--max-file-bytes(line-range reads stream and return at most that much) and at--max-charscharacters,searchskips larger files,listandsearchstop at--max-results, binary files other than small images are never returned. - Be reached from a web page. On a loopback bind the
Hostheader must belocalhost,127.0.0.1or::1(DNS-rebinding protection). On a non-loopback bind the check is off, as the Emperor Profile expects a validating ingress in front;--allowed-hostturns it back on for named hosts, and--allowed-originrefuses browser requests from any other origin.
Not in scope: authentication (put the HTTP endpoint behind your gateway or keep it on loopback), and hard links (a hard link inside the root to a file outside is the same file; do not point the server at a folder where untrusted users can create hard links). Other local processes can still change the folder while the server runs; confinement holds regardless, because every operation re-resolves beneath the root.
doctor
It checks each root exists and can be listed, can be written when --writable is set (a probe
file is created and removed), says whether writing is on, the roots open and have distinct names, the listen address is free (skipped
with --stdio), the tool count is within the emperor-mcp budget, and counts the files the
walker sees (a warning above 100 000: listing and search get slow). Exit code 0 when nothing
failed, 1 otherwise, so scripts and container health checks can use it.
Build
Links
- Crate: crates.io/crates/emperor-folder, API docs on docs.rs
- Framework: emperor-mcp
- How it compares with other folder-access MCP servers: docs/COMPARISON.md
- Official MCP Registry entry, mcp-name: io.github.yarenty/emperor-folder
Contributing
See CONTRIBUTING.md: run the checks, keep the docs in step, and sign off
your commits (DCO, git commit -s).
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in emperor-folder by you shall be dual licensed as above, without any additional terms or conditions.
来源:README.md,提交 a1e9772
工具
0版本历史
1- v0.1.3最新Nov 3, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分

