pub struct MimirServer { /* private fields */ }Expand description
Mimir MCP server. Holds workspace context (computed at server
startup, not per-call), an optional opened Store (required
for read tools), and the rmcp ToolRouter that dispatches
incoming tool calls to the #[tool]-annotated methods below.
Construct with MimirServer::new and serve over any
tokio::io::AsyncRead + AsyncWrite transport via
rmcp::ServiceExt::serve. The bin/mimir-mcp target wires
this to stdio; integration tests in tests/ use
tokio::io::duplex for in-memory framing.
Implementations§
Source§impl MimirServer
impl MimirServer
Sourcepub fn new(
workspace_id: Option<WorkspaceId>,
log_path: Option<PathBuf>,
store: Option<Store>,
) -> Self
pub fn new( workspace_id: Option<WorkspaceId>, log_path: Option<PathBuf>, store: Option<Store>, ) -> Self
Build a server with explicit workspace context and (optionally)
an already-opened Store. When store is None, the read
tools error with no_workspace_open; only mimir_status
(and mimir_open_workspace) remain useful.
The default lease TTL is taken from the
MIMIR_MCP_LEASE_TTL_SECONDS env var when present and
parseable as a non-zero u64, otherwise
DEFAULT_LEASE_TTL_SECONDS. The chosen value is stamped
into the server at construction; clients can override per-
call via OpenWorkspaceArgs::ttl_seconds.
Sourcepub fn with_clock(
workspace_id: Option<WorkspaceId>,
log_path: Option<PathBuf>,
store: Option<Store>,
clock: Arc<dyn Clock>,
) -> Self
pub fn with_clock( workspace_id: Option<WorkspaceId>, log_path: Option<PathBuf>, store: Option<Store>, clock: Arc<dyn Clock>, ) -> Self
Like MimirServer::new but with an injected Clock
implementation. Tests use this with a virtual clock so the
lease-expiry state machine can be driven deterministically
without tokio::time::sleep against wall-clock SystemTime.
Production callers should use MimirServer::new (which wires
up SystemClock by default).
Sourcepub fn mimir_status_tool_attr() -> Tool
pub fn mimir_status_tool_attr() -> Tool
Generated tool metadata function for mimir_status
Sourcepub fn mimir_read_tool_attr() -> Tool
pub fn mimir_read_tool_attr() -> Tool
Generated tool metadata function for mimir_read
Sourcepub fn mimir_verify_tool_attr() -> Tool
pub fn mimir_verify_tool_attr() -> Tool
Generated tool metadata function for mimir_verify
Sourcepub fn mimir_list_episodes_tool_attr() -> Tool
pub fn mimir_list_episodes_tool_attr() -> Tool
Generated tool metadata function for mimir_list_episodes
Sourcepub fn mimir_render_memory_tool_attr() -> Tool
pub fn mimir_render_memory_tool_attr() -> Tool
Generated tool metadata function for mimir_render_memory
Sourcepub fn mimir_open_workspace_tool_attr() -> Tool
pub fn mimir_open_workspace_tool_attr() -> Tool
Generated tool metadata function for mimir_open_workspace
Sourcepub fn mimir_write_tool_attr() -> Tool
pub fn mimir_write_tool_attr() -> Tool
Generated tool metadata function for mimir_write
Sourcepub fn mimir_close_episode_tool_attr() -> Tool
pub fn mimir_close_episode_tool_attr() -> Tool
Generated tool metadata function for mimir_close_episode
Sourcepub fn mimir_release_workspace_tool_attr() -> Tool
pub fn mimir_release_workspace_tool_attr() -> Tool
Generated tool metadata function for mimir_release_workspace
Trait Implementations§
Source§impl Clone for MimirServer
impl Clone for MimirServer
Source§fn clone(&self) -> MimirServer
fn clone(&self) -> MimirServer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more