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

Function toggleMembership

src/services/mcp/config.ts:1538–1546  ·  view source on GitHub ↗
(
  list: string[],
  name: string,
  shouldContain: boolean,
)

Source from the content-addressed store, hash-verified

1536}
1537
1538function toggleMembership(
1539 list: string[],
1540 name: string,
1541 shouldContain: boolean,
1542): string[] {
1543 const contains = list.includes(name)
1544 if (contains === shouldContain) return list
1545 return shouldContain ? [...list, name] : list.filter(s => s !== name)
1546}
1547
1548/**
1549 * Enable or disable an MCP server

Callers 1

setMcpServerEnabledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected