Automatic Backend Selection
The library automatically selects the appropriate storage backend using this priority: Priority Order:- Explicit: If
MCP_TS_STORAGE_TYPEis set, use that backend - Auto-detect Redis: If
REDIS_URLis present, use Redis - Auto-detect Supabase: If
SUPABASE_URLis present, use Supabase - Auto-detect File: If
MCP_TS_STORAGE_FILEis present, use File - Auto-detect SQLite: If
MCP_TS_STORAGE_SQLITE_PATHis present, use SQLite - Default: Fall back to In-Memory storage
Backend Comparison
| Feature | Redis | Supabase | SQLite | File System | In-Memory |
|---|---|---|---|---|---|
| Persistence | Yes | Yes | Yes | Yes | No |
| Distributed | Yes | Yes | No | No | No |
| Auto-Expiry | Yes (TTL) | Yes (Manual) | Yes (Manual) | No | No |
| Performance | Fast | Fast | Very Fast | Medium | Fastest |
| Setup | External | Cloud | Native | Built-in | Built-in |
| Serverless | Yes | Recommended | Limited | No | Yes |
| Production | Recommended | Recommended | Single-instance | Not recommended | Not recommended |