Runtime governance enforcement for AI agents. Zero token overhead.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP enforcement layer for the Aegis agent governance specification.
Policy at the root. Enforcement at runtime. Accountability on every action.
aegis-mcp-server is an MCP server that validates every agent action against your .agentpolicy/ files before it happens. Path permissions, content scanning, role boundaries, quality gates โ all enforced at runtime with zero token overhead to the agent.
The agent never loads your governance files. The MCP server reads them into its own process memory and validates silently. The agent calls governed tools and gets back either a success or a blocked response with the specific reason.
If you generated your policy with aegis-cli, the .mcp.json connection config is already in your project root. Just install the MCP and open your agent โ it connects automatically.
When starting a new agent session in a governed project, use this as your first prompt:
For initial builds, the Aegis CLI generates a custom handoff prompt tailored to your project โ use that instead.
The MCP starts without a pre-assigned role. When the agent calls aegis_policy_summary, it receives the list of available roles โ including the built-in construction role and all specialist roles from .agentpolicy/roles/. The agent presents them to the user, the user picks, and the agent calls aegis_select_role to lock in. All enforcement uses the selected role for the rest of the session.
This is the default behavior โ no configuration needed beyond the .mcp.json that aegis init creates automatically.
The construction role is always available for initial builds and major restructuring. When selected:
.agentpolicy/ files serve as the blueprint โ the agent reads constitution, governance, and role files to understand the project's architecture, conventions, and quality standardsstate/overrides.jsonl with a timestamp and human_confirmed: trueaegis_complete_task to run quality gates and close construction mode โ the closing timestamp is logged alongside the opening entryConstruction mode is not a bypass โ the agent still follows the governance files as its blueprint. It's a speed optimization for greenfield builds where enforcing write restrictions on every file would be counterproductive.
If you know which role to assign at startup:
The MCP locks to that role immediately. aegis_policy_summary returns the role's boundaries directly, skipping role selection.
| Tool | What it does | Token cost |
|---|---|---|
aegis_policy_summary | Role boundaries and governance summary (or available roles in universal mode) | ~200 tokens |
aegis_select_role | Select a role (including construction) in universal mode | Tiny |
aegis_check_permissions | Pre-check if an operation is allowed | Tiny |
aegis_write_file | Governed write with path + content validation | Same as a normal write |
aegis_read_file | Governed read with path validation | Same as a normal read |
aegis_delete_file | Governed delete with path validation | Tiny |
aegis_execute | Governed command execution | Command output only |
aegis_complete_task | Run quality gates and close construction mode if active | Gate results only |
aegis_request_override | Execute a blocked action after human confirmation | Tiny |
Traditional approach: load governance files into the agent's context window. Token cost scales with policy complexity.
Aegis MCP approach: the server loads policy into its own process memory. The agent calls tools and gets structured results. A project with 200 lines of governance has the same token cost as one with 20 lines. The complexity is absorbed by the server, not the agent.
writable, read_only, forbidden path listspre_commit flags mapped to build_commands and executedoverrides.jsonl
When an action is blocked and the governance override behavior is warn_confirm_and_log:
override_token and the specific policy violatedaegis_request_override with the token and the user's rationalehuman_confirmed: trueImmutable policies (e.g., HIPAA compliance, ITAR data sovereignty, audit completeness) return override_available: false and cannot be overridden. The user must modify the governance through aegis init.
The Aegis MCP does not override the agent's native directives. It introduces itself through tool descriptions, explains why governance is active, and asks the agent to seek user permission to route write operations through Aegis tools. The user's authority is the enforcement mechanism.
Native tools for reading, searching, and exploring the codebase work fine without governance gating. Only write, delete, and execute operations benefit from routing through Aegis.
Three artifacts, one governance framework:
MIT
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/aegis-mcp)<a href="https://allmcps.com/mcp/aegis-mcp"><img src="https://allmcps.com/api/badge/aegis-mcp?style=directory" alt="Aegis MCP on AllMCPs" /></a>