memstead-mcp 0.8.0

MCP server for Memstead — exposes the typed entity-graph engine over JSON-RPC stdio. Default build produces the full `memstead-mcp` binary (multi-mem, git-backed); `--no-default-features` builds the lean folder + archive surface.
Documentation
//! 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`](main.rs)) stays thin: argument
//! parsing, logging, then delegation into this crate.

pub mod error_envelope;
pub mod error_envelopes;
pub mod filesystem_server;
pub mod tools;

// Multi-mem / git-backed server, compiled into the full `memstead-mcp`
// binary (default features); absent from the lean `--no-default-features`
// build, which has no git-branch backend.
#[cfg(feature = "mem-repo")]
pub mod config;
#[cfg(feature = "mem-repo")]
pub mod lifecycle;
#[cfg(feature = "mem-repo")]
pub mod read_mems;
#[cfg(feature = "mem-repo")]
pub mod server;

/// Acquire an engine mutex on a tool dispatch path. A poisoned lock
/// (a prior tool call panicked) early-returns the typed
/// `ENGINE_LOCK_POISONED` envelope instead of panicking the server —
/// usable only inside functions returning `CallToolResult`.
#[macro_export]
macro_rules! lock_engine {
    ($mutex:expr) => {
        match $mutex.lock() {
            Ok(guard) => guard,
            Err(_) => return $crate::error_envelopes::engine_lock_poisoned(),
        }
    };
}