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 Neon: If
NEON_DATABASE_URLis present, use Neon - 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 | Neon | SQLite | File System | In-Memory |
|---|---|---|---|---|---|---|
| Persistence | Yes | Yes | Yes | Yes | Yes | No |
| Distributed | Yes | Yes | Yes | No | No | No |
| Auto-Expiry | Yes | Yes (Manual) | Yes (Manual) | Yes (Manual) | Yes (Manual) | Yes (Manual) |
| Performance | Fast | Fast | Fast | Very Fast | Medium | Fastest |
| Setup | External | Cloud | Cloud | Native | Built-in | Built-in |
| Serverless | Yes | Recommended | Recommended | Limited | No | Yes |
| Production | Recommended | Recommended | Recommended | Single-instance | Not recommended | Not recommended |

