# Aegis MCP (v0.1)

Aegis encodes a project's threat model in `security-context.yaml` and exposes deterministic security guidance through MCP tools for coding agents.

## What Was Executed From the Build Plan

The repository now includes the v0.1 deliverables defined in `aegis-build-plan.md`:

- **Schema design**
  - JSON Schema: `schemas/security-context.schema.json`
  - Example: `examples/security-context.example.yaml`
  - Template: `templates/security-context.template.yaml`
- **MCP server**
  - Tooling surface in `src/aegis/server.py`
  - Tools: `aegis_assess`, `aegis_validate`, `aegis_init`
  - Resource: `aegis://summary`
- **Deterministic assess semantics**
  - Matching/merge/conflict logic in `src/aegis/engine.py`
- **Validation**
  - Schema + normative contract checks in `src/aegis/validation.py`
- **Security context generation**
  - `aegis_init` in `src/aegis/init_tool.py` with Claude-assisted mode and deterministic fallback mode
- **Agent integration templates**
  - `agent-templates/`
- **Reliability feasibility fixtures**
  - `scenarios/trigger-scenarios.jsonl`
  - `scenarios/mock-aegis-assess.json`

## Install

Install from PyPI (recommended):

```bash
python -m pip install aegis-mcp
```

Optional for Claude-assisted `aegis_init`:

```bash
python -m pip install "aegis-mcp[init-llm]"
```

For local development from this repository:

```bash
python -m pip install -e .
```

Optional local development install with Claude-assisted mode:

```bash
python -m pip install -e ".[init-llm]"
```

## Validate a Security Context

```bash
aegis-validate examples/security-context.example.yaml
```

## Start the MCP Server

```bash
aegis-server --config examples/security-context.example.yaml
```

Equivalent command from the build plan:

```json
{
  "mcpServers": {
    "aegis": {
      "command": "python",
      "args": ["-m", "aegis.server", "--config", "./security-context.yaml"]
    }
  }
}
```

## Tool Contract

`aegis_assess` response always includes:

- `requirements`
- `approved_patterns`
- `anti_patterns`
- `matched`
- `warnings`
- `conflicts`
- `no_match`

See `aegis-build-plan.md` and `docs/schema-reference.md` for details.
