( a: ScopedMcpServerConfig, b: ScopedMcpServerConfig, )
| 1708 | * Used to detect when a server needs to be reconnected due to config changes. |
| 1709 | */ |
| 1710 | export 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. |
no test coverage detected