MCPcopy Create free account
hub / github.com/codeaashu/claude-code / areMcpConfigsEqual

Function areMcpConfigsEqual

src/services/mcp/client.ts:1710–1722  ·  view source on GitHub ↗
(
  a: ScopedMcpServerConfig,
  b: ScopedMcpServerConfig,
)

Source from the content-addressed store, hash-verified

1708 * Used to detect when a server needs to be reconnected due to config changes.
1709 */
1710export function areMcpConfigsEqual(
1711 a: ScopedMcpServerConfig,
1712 b: ScopedMcpServerConfig,
1713): boolean {
1714 // Quick type check first
1715 if (a.type !== b.type) return false
1716
1717 // Compare by serializing - this handles all config variations
1718 // We exclude 'scope' from comparison since it's metadata, not connection config
1719 const { scope: _scopeA, ...configA } = a
1720 const { scope: _scopeB, ...configB } = b
1721 return jsonStringify(configA) === jsonStringify(configB)
1722}
1723
1724// Max cache size for fetch* caches. Keyed by server name (stable across
1725// reconnects), bounded to prevent unbounded growth with many MCP servers.

Callers 1

reconcileMcpServersFunction · 0.85

Calls 1

jsonStringifyFunction · 0.85

Tested by

no test coverage detected