Claude Code
Overview
Section titled “Overview”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.
1. Build with MCP support
Section titled “1. Build with MCP support”cargo build --release --features mcp2. Add to Claude Code MCP config
Section titled “2. Add to Claude Code MCP config”Create or edit .mcp.json in your project root:
{ "mcpServers": { "agentzero": { "command": "az", "args": ["mcp"] } }}Or use the automated setup:
az connect claude --dry-run # preview the configaz connect claude # write to .mcp.json3. Verify
Section titled “3. Verify”Start Claude Code in your project directory. AgentZero tools will appear alongside Claude Code’s built-in tools.
Available Tools
Section titled “Available Tools”| Tool | Description |
|---|---|
read_file | Read file contents (policy-checked) |
list_directory | List directory contents |
search_files | Search for patterns in files |
write_file | Write content to a file (requires approval) |
run_command | Execute a shell command (requires approval) |
Security
Section titled “Security”- 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
Troubleshooting
Section titled “Troubleshooting”- Tools not visible — ensure
azis in your PATH and built with--features mcp - Policy denials — check
.agentzero/policy.ymlor runaz policy status - Audit log — inspect with
az audit tail