Expand description
MCP server (stdio + HTTP/SSE) for trusty-memory.
Why: Claude Code and other MCP-aware clients integrate with trusty-memory
through the standardized Model Context Protocol; we expose memory + KG
tools so they can be called by name.
What: Provides run_stdio (JSON-RPC 2.0 over stdin/stdout) and run_http
(axum HTTP/SSE stub), plus an AppState that carries the shared
PalaceRegistry, on-disk data root, and a lazily-initialized embedder.
Test: cargo test -p trusty-memory-mcp validates handshake + dispatch.
Re-exports§
pub use service::MemoryMcpService;pub use tools::MemoryMcpServer;
Modules§
- bootstrap
- Knowledge-graph bootstrap helpers.
- commands
- Per-subcommand handlers for the
trusty-memorybinary. - discovery
- Automatic project alias discovery.
- openrpc
- OpenRPC 1.3.2 service description for
trusty-memory-mcp. - prompt_
facts - Prompt-facts surface: hot KG predicates exposed via a per-message tool.
- service
ServiceDescriptorimpl for the trusty-memory MCP service.- tools
- MCP tool surface for trusty-memory.
- web
- HTTP API + embedded SPA shell for the trusty-memory admin UI.
Structs§
- AppState
- Shared application state passed to every request handler.
Enums§
- Daemon
Event - Live daemon events broadcast to connected SSE subscribers.
Constants§
- DEFAULT_
HTTP_ PORT - Preferred starting port for the trusty-memory HTTP daemon.
Functions§
- bind_
dynamic_ port - Bind a
TcpListenerto127.0.0.1, dynamically selecting a port. - handle_
message - Handle a single MCP JSON-RPC message and produce its response.
- http_
addr_ path - Path to
~/.trusty-memory/http_addr— the canonical address-discovery file. - resolve_
palace_ registry_ dir - Resolve the directory that actually holds the per-palace subdirectories.
- run_
http - Convenience: bind
addrand serve viarun_http_on. - run_
http_ dynamic - Convenience: bind dynamically (7070..=7079, OS fallback) and serve.
- run_
http_ on - Run the optional HTTP/SSE + web admin server.
- run_
stdio - Run the MCP stdio JSON-RPC 2.0 server loop.