Crate context_mcp

Crate context_mcp 

Source
Expand description

§Context MCP Server

A Model Context Protocol (MCP) server for context storage, text-based retrieval, and temporal tracking.

§Features

  • Multi-tier Storage: In-memory LRU cache with optional sled disk persistence
  • Temporal Tracking: Timestamps, age tracking, and time-based filtering
  • Text-Based Retrieval: CPU-optimized parallel text matching and scoring
  • Screening Status: Fields for tracking security screening state (no active integration)
  • MCP Protocol: JSON-RPC server with HTTP/WebSocket and stdio transports

§Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │    │  JSON-RPC Server │    │ Storage Layer   │
│                 │    │                  │    │                 │
│ • HTTP/WS       │◄──►│ • Store/Retrieve │◄──►│ • In-Memory LRU │
│ • stdio         │    │ • Query/Filter   │    │ • Sled (opt)    │
│ • curl/tools    │    │ • Text Matching  │    │ • Indexes       │
└─────────────────┘    └──────────────────┘    └─────────────────┘

Re-exports§

pub use context::Context;
pub use context::ContextId;
pub use context::ContextMetadata;
pub use error::ContextError;
pub use error::Result;
pub use server::McpServer;
pub use server::ServerConfig;
pub use storage::ContextStore;
pub use storage::StorageConfig;
pub use temporal::TemporalQuery;

Modules§

context
Context data structures and core types
embeddings
Mock embedding generation traits and implementations
error
Error types for the context MCP server
protocol
MCP protocol types and message handling
rag
CPU-optimized text-based context retrieval with scoring
server
MCP server implementation using Axum
storage
Multi-tier storage for context entries
temporal
Temporal reasoning support for context retrieval
tools
MCP tool implementations for context management