Skip to main content

Module server

Module server 

Source
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§

EditArgs
Arguments of edit.
FolderServer
The MCP server: one Folder shared by every request.
ListArgs
Arguments of list.
MoveArgs
Arguments of move.
ReadArgs
Arguments of read.
SearchArgs
Arguments of search.
StatArgs
Arguments of stat.
WriteArgs
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 Host header 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.