Module cache

Module cache 

Source
Expand description

Cache Module - Multi-backend caching system

Provides caching infrastructure for MCPLint with support for:

  • Filesystem storage (default, persistent)
  • In-memory storage (ephemeral, fast)
  • Redis storage (distributed, scalable) [optional feature]

§Example

use mcplint::cache::{CacheConfig, CacheManager};

// Create with default filesystem backend
let config = CacheConfig::default();
let cache = CacheManager::new(config).await?;

// Cache a schema
cache.set_schema("server-hash", &tools).await?;

// Retrieve cached schema
if let Some(tools) = cache.get_schema("server-hash").await? {
    println!("Cache hit!");
}

Re-exports§

pub use backend::Cache;
pub use backend::CacheBackend;
pub use backend::CacheConfig;
pub use entry::CacheEntry;
pub use filesystem::FilesystemCache;
pub use key::CacheCategory;
pub use key::CacheKey;
pub use memory::MemoryCache;
pub use rug_pull::detect_rug_pull;
pub use rug_pull::RugPullDetection;
pub use rug_pull::RugPullSeverity;
pub use rug_pull::ToolHashRecord;
pub use stats::CacheStats;
pub use stats::CategoryStats;

Modules§

backend
Cache Backend - Backend trait and configuration
entry
Cache Entry - Cached data with metadata
filesystem
Filesystem Cache - File-based cache storage
key
Cache Key - Type-safe cache key definitions
memory
Memory Cache - In-memory cache storage
rug_pull
Rug-Pull Detection - Detect changes in tool definitions
stats
Cache Statistics - Usage metrics and reporting

Structs§

CacheManager
Unified cache manager that delegates to the configured backend

Functions§

hash_ruleset
Hash a ruleset for cache key generation
hash_server
Hash a server command for cache key generation