* Internal utility: Add scope to server configs
( servers: Record<string, McpServerConfig> | undefined, scope: ConfigScope, )
| 67 | * Internal utility: Add scope to server configs |
| 68 | */ |
| 69 | function addScopeToServers( |
| 70 | servers: Record<string, McpServerConfig> | undefined, |
| 71 | scope: ConfigScope, |
| 72 | ): Record<string, ScopedMcpServerConfig> { |
| 73 | if (!servers) { |
| 74 | return {} |
| 75 | } |
| 76 | const scopedServers: Record<string, ScopedMcpServerConfig> = {} |
| 77 | for (const [name, config] of Object.entries(servers)) { |
| 78 | scopedServers[name] = { ...config, scope } |
| 79 | } |
| 80 | return scopedServers |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Internal utility: Write MCP config to .mcp.json file. |
no test coverage detected