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

Method constructor

apps/sim/lib/mcp/service.ts:76–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 private inflightServerDiscovery = new Map<string, Promise<McpTool[]>>()
75
76 constructor() {
77 this.cacheAdapter = createMcpCacheAdapter()
78 logger.info(`MCP Service initialized with ${getMcpCacheType()} cache`)
79
80 if (mcpConnectionManager) {
81 this.unsubscribeConnectionManager = mcpConnectionManager.subscribe((event) => {
82 this.cacheAdapter
83 .delete(serverCacheKey(event.workspaceId, event.serverId))
84 .catch((err) =>
85 logger.warn(`Failed to invalidate cache for ${event.serverName} on listChanged:`, err)
86 )
87 this.cacheAdapter
88 .delete(failureCacheKey(event.workspaceId, event.serverId))
89 .catch((err) =>
90 logger.warn(
91 `Failed to invalidate failure cache for ${event.serverName} on listChanged:`,
92 err
93 )
94 )
95 })
96 }
97 }
98
99 dispose(): void {
100 this.unsubscribeConnectionManager?.()

Callers

nothing calls this directly

Calls 8

createMcpCacheAdapterFunction · 0.90
getMcpCacheTypeFunction · 0.90
serverCacheKeyFunction · 0.85
failureCacheKeyFunction · 0.85
infoMethod · 0.80
subscribeMethod · 0.65
deleteMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected