MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / enforceInstallPolicy

Function enforceInstallPolicy

src/cli/commands/init.ts:653–685  ·  view source on GitHub ↗
(
  targets: ClientInfo[],
  skillType: SkillType,
  clientFlag: string | undefined,
  destFlag: string | undefined,
  selectionMode: InitSelection['selectionMode'],
)

Source from the content-addressed store, hash-verified

651}
652
653function enforceInstallPolicy(
654 targets: ClientInfo[],
655 skillType: SkillType,
656 clientFlag: string | undefined,
657 destFlag: string | undefined,
658 selectionMode: InitSelection['selectionMode'],
659): InstallPolicyResult {
660 const skipPolicy =
661 skillType !== 'mcp' ||
662 destFlag != null ||
663 clientFlag === 'claude' ||
664 selectionMode === 'interactive';
665
666 if (skipPolicy) {
667 return { allowedTargets: targets, skippedClients: [] };
668 }
669
670 const allowedTargets: ClientInfo[] = [];
671 const skippedClients: Array<{ client: string; reason: string }> = [];
672
673 for (const target of targets) {
674 if (target.id === 'claude') {
675 skippedClients.push({
676 client: target.name,
677 reason: 'MCP skill is unnecessary because Claude Code already uses server instructions.',
678 });
679 continue;
680 }
681 allowedTargets.push(target);
682 }
683
684 return { allowedTargets, skippedClients };
685}

Callers 1

registerInitCommandFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected