Skip to content

Claude Code

Claude Code is Anthropic’s CLI coding agent. It supports MCP servers, allowing AgentZero to provide policy-enforced tools (read, write, search, edit, shell) to Claude Code sessions.

In this mode, Claude Code drives the LLM (Claude); AgentZero provides tools with security policies, path validation, and audit logging.

Terminal window
cargo build --release --features mcp

Create or edit .mcp.json in your project root:

{
"mcpServers": {
"agentzero": {
"command": "az",
"args": ["mcp"]
}
}
}

Or use the automated setup:

Terminal window
az connect claude --dry-run # preview the config
az connect claude # write to .mcp.json

Start Claude Code in your project directory. AgentZero tools will appear alongside Claude Code’s built-in tools.

ToolDescription
read_fileRead file contents (policy-checked)
list_directoryList directory contents
search_filesSearch for patterns in files
write_fileWrite content to a file (requires approval)
run_commandExecute a shell command (requires approval)
  • All tool calls go through AgentZero’s policy engine
  • Path validation blocks access outside project root
  • Sensitive paths (.ssh, .env, .aws/credentials) are denied
  • Audit events emitted for every call to .agentzero/audit/
  • Project policy loaded from .agentzero/policy.yml
  • Tools not visible — ensure az is in your PATH and built with --features mcp
  • Policy denials — check .agentzero/policy.yml or run az policy status
  • Audit log — inspect with az audit tail