spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / hooks / policy / has-mcp-allowlist.ts
11 lines · 426 BRaw
1import type { Settings } from 'claude-code'
2
3/**
4 * Whether managed policy holds an MCP allowlist (allowedMcpServers set at
5 * all, empty included): the organization decides which servers add tools.
6 *
7 * @param policy the managed settings, as `$.settings.read` answers them
8 * @returns true when allowedMcpServers is in force
9 */
10export const hasMcpAllowlist = (policy: Settings) =>
11 Array.isArray(policy.allowedMcpServers)