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 / managed-tools-restored / is-org-tool / is-org-tool.ts
14 lines · 537 BRaw
1import type { Settings } from 'claude-code'
2
3import { orgServerNames } from './org-server-names'
4
5/**
6 * Whether a tool is one of a managed MCP server's: `mcp__<server>__...` for
7 * a server the policy's allowlist names.
8 *
9 * @param policy the managed settings, as `$.settings.read` answers them
10 * @param tool the tool's name as the model calls it
11 * @returns true for a managed server's tool
12 */
13export const isOrgTool = (policy: Settings, tool: string) =>
14 orgServerNames(policy).some(server => tool.startsWith(`mcp__${server}__`))