MCPcopy
hub / github.com/codeaashu/claude-code / filterMcpServersByPolicy

Function filterMcpServersByPolicy

src/services/mcp/config.ts:536–551  ·  view source on GitHub ↗
(configs: Record<string, T>)

Source from the content-addressed store, hash-verified

534 * `getServerCommandArray` defaults `args` to `[]` via `?? []`.
535 */
536export function filterMcpServersByPolicy<T>(configs: Record<string, T>): {
537 allowed: Record<string, T>
538 blocked: string[]
539} {
540 const allowed: Record<string, T> = {}
541 const blocked: string[] = []
542 for (const [name, config] of Object.entries(configs)) {
543 const c = config as McpServerConfig
544 if (c.type === 'sdk' || isMcpServerAllowedByPolicy(name, c)) {
545 allowed[name] = config
546 } else {
547 blocked.push(name)
548 }
549 }
550 return { allowed, blocked }
551}
552
553/**
554 * Internal utility: Expands environment variables in an MCP server config

Callers 4

runFunction · 0.85
handleMcpSetServersFunction · 0.85
getAllMcpConfigsFunction · 0.85
loadAndConnectMcpConfigsFunction · 0.85

Calls 3

entriesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected