Expand description
The MCP surface: seven tools over one Folder, served over Streamable HTTP (emperor-mcp)
or stdio (rmcp).
File content is framed FrameKind::Document (a file’s author is not known); structured
results (listings, matches, metadata) are JSON framed FrameKind::Computed; small images
come back as MCP image content. Refusals come back as tool errors (isError: true) with a
message the model can act on.
On a read-only server the mutating tools (write, edit, move) are removed from the tool
router at construction, so tools/list does not offer them at all.
Structs§
- Edit
Args - Arguments of
edit. - Folder
Server - The MCP server: one
Foldershared by every request. - List
Args - Arguments of
list. - Move
Args - Arguments of
move. - Read
Args - Arguments of
read. - Search
Args - Arguments of
search. - Stat
Args - Arguments of
stat. - Write
Args - Arguments of
write.
Constants§
- SERVER_
NAME - Server name reported to clients and by
doctor. - WRITE_
TOOLS - Tools that change files; offered only when the server is writable.
Functions§
- default_
allowed_ hosts - Hosts accepted in the
Hostheader when none are configured: loopback names when the server listens on a loopback address (DNS-rebinding protection for a local file server), none (validation off, a validating ingress in front) otherwise. - serve_
http - Serve over stateless Streamable HTTP at
/mcp(plus/health) until Ctrl-C. - serve_
stdio - Serve over stdio (desktop clients). Logs must go to stderr.