()
| 16 | * MCP caching gracefully falls back to memory since it's an optimization. |
| 17 | */ |
| 18 | export function createMcpCacheAdapter(): McpCacheStorageAdapter { |
| 19 | if (cachedAdapter) { |
| 20 | return cachedAdapter |
| 21 | } |
| 22 | |
| 23 | const redis = getRedisClient() |
| 24 | |
| 25 | if (redis) { |
| 26 | logger.info('MCP cache: Using Redis') |
| 27 | cachedAdapter = new RedisMcpCache(redis) |
| 28 | } else { |
| 29 | logger.info('MCP cache: Using in-memory (Redis not configured)') |
| 30 | cachedAdapter = new MemoryMcpCache() |
| 31 | } |
| 32 | |
| 33 | return cachedAdapter |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get the current adapter type for logging/debugging |
no test coverage detected