Skip to content
VerificationWould you notice if your agent drifted in production?Explore the 5-stage harness›
Build with AI

Agent Context & MCP Server

This guide shows how to streamline AI assistant workflows using Aegil’s specialized agent tooling: extracting token-dense domain context with aegil context and configuring native Model Context Protocol (MCP) integration with aegil mcp.

  • Aegil CLI installed and on your system PATH.
  • An MCP-compatible client (such as Cursor, Claude Code, Windsurf, or Antigravity) if configuring MCP tools.

Standard coding agents often waste thousands of tokens scanning large directory trees and reading boilerplate files.

aegil context extracts only what an AI agent needs to understand the project:

Terminal window
aegil context

To restrict the context to a single feature domain:

Terminal window
aegil context --feature notes
  • Project configuration: Project name, namespace, and pinned toolchain versions from aegil.yaml.
  • Domain specifications: Parsed entities, fields, validation bounds, CEL policies, and operations for the requested feature.
  • Active and pending hooks: Paths to hook files, expected class names, and interface contracts.
  • Strict zone boundaries: Explicit lists of what the agent may edit (Zone 1 and Zone 2) versus what is hash-locked (Zone 3).

This enables agents to start working immediately with zero prompt hallucination and minimal token consumption.


Aegil includes an integrated, standard stdio Model Context Protocol (MCP) server. AI assistants that support MCP (such as Claude Code, Cursor, Windsurf, or Antigravity) can call Aegil compiler and verification tools directly.

Terminal window
aegil mcp

Add Aegil to your MCP configuration (e.g. claude_desktop_config.json or .cursor/mcp.json):

{
"mcpServers": {
"aegil": {
"command": "aegil",
"args": ["mcp"]
}
}
}
Tool Name Arguments Description
aegil_build project?: string, strict?: bool Compiles specs, generates code, and emits the Action Manifest with pending tasks.
aegil_verify project?: string, only?: string, skipIntegration?: bool Executes the 5-stage automated verification harness and reports structured results.
aegil_check project?: string Performs fast, read-only syntax, toolchain, and ownership boundary checks without writing files.
aegil_context project?: string, feature?: string Returns a token-dense JSON payload of domain models and pending hook tasks.
aegil_migrate name: string, allowDestructive?: bool Calculates schema diffs and commits versioned database migrations.

What you see Why What to do
ERR_FEATURE_NOT_FOUND aegil context --feature <name> referenced a feature folder that does not exist. Check the directory name under specs/<feature>/.
MCP connection refused The aegil executable is not on your system PATH. Ensure aegil is installed and reachable via which aegil.