MCPcopy Index your code
hub / github.com/simstudioai/sim / createMcpCacheAdapter

Function createMcpCacheAdapter

apps/sim/lib/mcp/storage/factory.ts:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * MCP caching gracefully falls back to memory since it's an optimization.
17 */
18export 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

Callers 1

constructorMethod · 0.90

Calls 2

getRedisClientFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected