Crate context_mcp

Crate context_mcp 

Source
Expand description

§Context MCP Server

A Model Context Protocol (MCP) server for context management, RAG processing, and temporal reasoning. Inspired by memory-gate patterns for dynamic learning layers.

§Features

  • Multi-tier Storage: In-memory (LRU), cache, and disk persistence
  • Temporal Reasoning: Timestamps and age tracking for context relevance
  • RAG Processing: CPU-optimized retrieval-augmented generation support
  • Safe Input Handling: Integrates with security-mcp for screened inputs
  • MCP Protocol: Full compatibility with VS Code, Copilot, and other MCP clients

§Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │    │  Context Gateway │    │ Storage Layer   │
│                 │    │                  │    │                 │
│ • VS Code       │◄──►│ • Store/Retrieve │◄──►│ • In-Memory LRU │
│ • Copilot       │    │ • Temporal Query │    │ • Sled Disk DB  │
│ • CLI Tools     │    │ • RAG Processing │    │ • Vector Index  │
└─────────────────┘    └──────────────────┘    └─────────────────┘

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 RAG processing for context retrieval
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