MCPcopy Index your code
hub / github.com/codeaashu/claude-code / addScopeToServers

Function addScopeToServers

src/services/mcp/config.ts:69–81  ·  view source on GitHub ↗

* Internal utility: Add scope to server configs

(
  servers: Record<string, McpServerConfig> | undefined,
  scope: ConfigScope,
)

Source from the content-addressed store, hash-verified

67 * Internal utility: Add scope to server configs
68 */
69function 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.

Callers 2

getMcpConfigsByScopeFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected