# aegis-mcp [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/cleburn/aegis-mcp  
**GitHub Stars:** 3  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/aegis-mcp

## Description
Runtime governance enforcement for AI agents. Zero token overhead.

## Tools
Capabilities this server exposes over MCP:

- **aegis_policy_summary** — Role boundaries and governance summary (or available roles in universal mode)
- **aegis_select_role** — Select a role (including construction) in universal mode
- **aegis_check_permissions** — Pre-check if an operation is allowed
- **aegis_write_file** — Governed write with path + content validation
- **aegis_read_file** — Governed read with path validation
- **aegis_delete_file** — Governed delete with path validation
- **aegis_execute** — Governed command execution
- **aegis_complete_task** — Run quality gates and close construction mode if active
- **aegis_request_override** — Execute a blocked action after human confirmation

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/cleburn/aegis-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install -g aegis-mcp-server
```

## Documentation

## What aegis-mcp MCP server does

The aegis-mcp MCP server applies the Aegis governance specification at runtime. It reads policy files from a project’s `.agentpolicy/` directory and checks agent operations before allowing them to proceed. The agent receives a success result or a blocked response that identifies the policy issue.

Governance can define writable, read-only, and forbidden paths; role-specific access; sensitive content patterns; cross-domain import rules; quality gates; and policies that cannot be overridden. Enforcement decisions and approved overrides are written to an append-only `overrides.jsonl` file.

The server keeps policy data in its own process memory rather than requiring the agent to load governance files into its context. It also watches for policy changes and reloads them automatically.

## How it works

In universal mode, the session starts without a selected role. `aegis_policy_summary` reports the available roles, including `construction` and specialist roles found under `.agentpolicy/roles/`. After the user chooses a role, the agent calls `aegis_select_role`, and subsequent checks use that role’s boundaries.

A fixed role can instead be supplied when the MCP process starts. In that mode, the role is locked immediately and the policy summary reports its boundaries directly.

Construction mode is intended for initial builds and substantial restructuring. It grants repository-wide read and write access, uses the policy files as an architectural blueprint, and records session start and end timestamps. The agent calls `aegis_complete_task` to run quality gates and close the mode. Later sessions are expected to use specialist roles.

When a governed action is blocked and the policy allows confirmation, the response includes an override token and the violated rule. After the user confirms, `aegis_request_override` can perform that one action with a rationale. Immutable policies cannot use this path.

## Setup and configuration

Install the package globally with npm:

```bash
npm install -g aegis-mcp-server
```

A project initialized by `aegis-cli` may already contain the `.mcp.json` connection configuration. The server can also be configured with a command such as:

```json
{
  "mcpServers": {
    "aegis": {
      "command": "aegis-mcp",
      "args": ["--project", ".", "--role", "backend"]
    }
  }
}
```

The `--role` argument is used for fixed mode; omitting it enables universal mode. The material does not specify environment variables for configuration.

## Tools and capabilities

The aegis-mcp MCP server exposes these tools:

- `aegis_policy_summary` reports governance boundaries or available roles.
- `aegis_select_role` locks in a role in universal mode.
- `aegis_check_permissions` checks whether an operation is allowed.
- `aegis_write_file`, `aegis_read_file`, and `aegis_delete_file` perform path-validated file operations, with writes also undergoing content validation.
- `aegis_execute` runs commands under governance rules.
- `aegis_complete_task` runs configured quality gates and closes construction mode.
- `aegis_request_override` performs a blocked action after human confirmation when the policy permits it.

Native agent tools for reading, searching, and exploring are not gated by this server. Write, delete, and execute operations are the intended governed paths.

## Limitations and notes

The server does not replace the agent’s native directives; its governance depends on the agent routing applicable operations through the supplied tools and seeking user permission where required. Policy complexity is handled by the server process, but tool results still return operation output and enforcement status to the agent.

Construction mode is not an unrestricted policy bypass: it follows the governance files as its project blueprint and still records the session. Policies marked immutable cannot be overridden through the MCP tools. The package is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/aegis-mcp/readme_

