Expand description
Memstead MCP server — exposes the Memstead engine via the Model Context Protocol over STDIO.
One crate, two build configs. The default build (mem-repo
feature on) is the full server: the multi-mem, git-backed
ServerHandler (server::McpServer) and its tool router, plus the
support modules (config, lifecycle, read_mems,
error_envelope). --no-default-features drops the git-branch
backend, leaving the folder + archive ServerHandler
(filesystem_server::FilesystemMcpServer) — a CI / wasm-adjacent
config, not shipped.
Shared building blocks used by both servers live here unconditionally:
error_envelopes (validation envelope) and tools (tool
parameter structs).
The binary entry point (main.rs) stays thin: argument
parsing, logging, then delegation into this crate.
Modules§
- config
- Full MCP-binary configuration helpers.
- error_
envelope - Tool-error envelope helpers used by the full
ServerHandlerto constructCallToolResultresponses with the engine’s typed wire shape: text channel prefixedERROR [<CODE>]: <message>,structured_contentcarrying the full payload (or absent on the prose-only path),is_errorset so MCP clients render the response as a failure. Both helpers live inmemstead-mcpbecause the full server is their only consumer; the lean filesystem server builds its envelopes through the parallel helpers inline inmemstead-mcp::filesystem_server. - error_
envelopes - Shared MCP error-envelope translators.
- filesystem_
server - filesystem-mem MCP server — parallel module to
crate::server. - lifecycle
- Parameter structs for the runtime mem-lifecycle tools —
memstead_mem_createandmemstead_mem_delete. - read_
mems - Batch-install helper for the
--read-memCLI flag. - server
- MCP server — McpServer struct with Engine, tool router, and ServerHandler.
- tools
- Tool parameter structs for the agent-facing MCP tools.
Macros§
- lock_
engine - Acquire an engine mutex on a tool dispatch path. A poisoned lock
(a prior tool call panicked) early-returns the typed
ENGINE_LOCK_POISONEDenvelope instead of panicking the server — usable only inside functions returningCallToolResult.