MCP Integration
Wrap MCP calls with the SDK for deterministic enforcement, or offer cooperative policy checks to MCP clients.
Overview
The Model Context Protocol (MCP) is an open standard for connecting AI models to external tools and data sources. Control Zero is built with MCP as a first-class integration point. An SDK wrapper using an enforcing guard() call blocks a denied MCP tool call before it executes. MCP Guard exposes the same decision as a cooperative check when application code cannot host the SDK.
This integration covers all tools that support MCP servers, including:
- Claude Code (Anthropic's CLI coding tool)
- Cline (VS Code AI coding extension)
- Cursor (AI-powered IDE)
- Windsurf (AI-powered IDE by Codeium)
- Any MCP-compatible client
How It Works
Control Zero uses the mcp.tool.call action and mcp://{server}/{tool} resource URIs. When application code calls guard(..., raise_on_deny=True), a deny raises PolicyDeniedError before tool execution. MCP Guard returns the decision to the client and remains cooperative.
Agent -> MCP Tool Call -> Control Zero Policy Check -> Tool Execution
|
v (if denied)
PolicyDeniedError
MCP Server Setup
The Control Zero MCP server is published to the Control Zero npm registry as @controlzero/mcp-server and uses stdio transport. It carries the management tools and the cooperative check tool; see MCP Server for the tool list and MCP Cooperative Guard for check.
Installation
Configure the Control Zero registry once: add @controlzero:registry=https://npm.controlzero.ai to your .npmrc (or run npm config set @controlzero:registry https://npm.controlzero.ai). It applies to npm install and npx for the whole @controlzero scope.
# Install globally
npm install -g @controlzero/mcp-server
# Or run directly without installing:
npx -p @controlzero/mcp-server controlzero-mcp