Skip to main content

turul_mcp_server_state_storage/
lib.rs

1//! Server-Global State Storage for MCP Entity Registries
2//!
3//! Provides pluggable persistence for server-global entity activation state
4//! (tools, resources, prompts) across different backends.
5//!
6//! This crate follows the same pattern as `turul-mcp-session-storage` and
7//! `turul-mcp-task-storage`. Session state is client-scoped; server state
8//! is instance-global and shared across a cluster.
9//!
10//! # Backends
11//!
12//! - `InMemory` — test double (single-process only)
13//! - `SQLite` — local durable mode (feature: `sqlite`)
14//! - `PostgreSQL` — shared relational deployments (feature: `postgres`)
15//! - `DynamoDB` — serverless/AWS deployments (feature: `dynamodb`)
16
17pub mod error;
18pub mod traits;
19
20#[cfg(feature = "in-memory")]
21pub mod in_memory;
22
23#[cfg(feature = "sqlite")]
24pub mod sqlite;
25
26#[cfg(feature = "postgres")]
27pub mod postgres;
28
29#[cfg(feature = "dynamodb")]
30pub mod dynamodb;
31
32// Re-exports
33pub use error::ServerStateError;
34pub use traits::{BoxedServerStateStorage, EntityState, RegistrySnapshot, ServerStateStorage};
35
36#[cfg(feature = "in-memory")]
37pub use in_memory::InMemoryServerStateStorage;
38
39#[cfg(feature = "sqlite")]
40pub use sqlite::{SqliteServerStateConfig, SqliteServerStateStorage};
41
42#[cfg(feature = "postgres")]
43pub use postgres::{PostgresServerStateConfig, PostgresServerStateStorage};
44
45#[cfg(feature = "dynamodb")]
46pub use dynamodb::{DynamoDbServerStateConfig, DynamoDbServerStateStorage};