Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust
1.4 KB
Raw Blame
//! MCP server for ai-memory.
//!
//! Hosts an [`AiMemoryServer`] that wraps the storage layer and exposes a
//! deliberately narrow tool surface to coding agents. Read-only tools live
//! here; write tools (M3+) and consolidation tools (M7+) follow.
//!
//! Pin the MCP protocol version explicitly so we never fall into the
//! agentmemory #510 / #553 "negotiated-down to a version the client
//! discards tools for" failure mode.

pub mod actor;
pub mod admin;
pub mod admin_profile;
pub mod auth;
pub mod human_auth;
pub mod identity;
pub mod metrics;
mod page_patch;
pub mod self_service_keys;
mod server;
pub mod session_management;

pub use actor::actor_from_headers;
pub use admin::{
    AdminState, ScopeInvalidation, ScopeInvalidator, admin_router, admin_router_with_decay_breadth,
    admin_router_with_sweep_tuning,
};
pub use human_auth::{
    HumanAuthRuntime, expire_legacy_cookie_mw, internal_auth_router, public_auth_router,
    require_dual_auth, session_auth_router,
};
pub use metrics::McpMetrics;
pub use server::{AiMemoryServer, MEMORY_INSTRUCTIONS};

// Integration tests compile into this crate's test harness instead of a
// separate binary: every test binary is another link and, on macOS and
// Windows, another first-run malware scan. They still exercise only the
// public API; `extern crate self` lets them keep addressing it by crate name.
#[cfg(test)]
extern crate self as ai_memory_mcp;
#[cfg(test)]
#[path = "../tests/suite/mod.rs"]
mod integration;