# aegis

Keeps API credentials away from AI agents by routing calls through a local proxy. Injects auth tokens during transit and restricts destination domains.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 15
- Author: getaegis
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/getaegis/aegis
- Updated: 2026-08-06
- HTML: https://affpapa.org/en/nevibecode/mcp/aegis

## What it does

Aegis creates an intermediary layer between your AI coding assistant and external web APIs. Instead of exposing raw tokens to the model context, the assistant routes calls through `aegis_proxy_request` or a local endpoint on port 3100. The proxy attaches authentication headers on the fly. The language model never touches the actual keys. This setup blocks prompt injections from stealing sensitive tokens.

The local vault secures credentials with AES-256-GCM encryption and derives keys through PBKDF2. Built-in domain checking blocks requests targeted outside configured hostnames, while body inspection flags accidental key leaks in payloads. Running the MCP component requires `AEGIS_MASTER_KEY` and `AEGIS_SALT` environment variables; without them, the server cannot open the vault.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `AEGIS_MASTER_KEY`, `AEGIS_SALT`, `AEGIS_DATA_DIR`, `AEGIS_PORT`, `AEGIS_LOG_LEVEL`, `AEGIS_LOG_FORMAT`, `AEGIS_VAULT`, `AEGIS_REQUIRE_AGENT_AUTH`, `AEGIS_POLICY_MODE`, `AEGIS_POLICIES_DIR` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env AEGIS_MASTER_KEY=<AEGIS_MASTER_KEY> --env AEGIS_SALT=<AEGIS_SALT> --env AEGIS_DATA_DIR=<AEGIS_DATA_DIR> --env AEGIS_PORT=<AEGIS_PORT> --env AEGIS_LOG_LEVEL=<AEGIS_LOG_LEVEL> --transport stdio aegis -- npx -y @getaegis/cli
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add aegis --env AEGIS_MASTER_KEY=<AEGIS_MASTER_KEY> --env AEGIS_SALT=<AEGIS_SALT> --env AEGIS_DATA_DIR=<AEGIS_DATA_DIR> --env AEGIS_PORT=<AEGIS_PORT> --env AEGIS_LOG_LEVEL=<AEGIS_LOG_LEVEL> -- npx -y @getaegis/cli
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "aegis": {
            "command": "npx",
            "args": [
                "-y",
                "@getaegis/cli"
            ],
            "env": {
                "AEGIS_MASTER_KEY": "<AEGIS_MASTER_KEY>",
                "AEGIS_SALT": "<AEGIS_SALT>",
                "AEGIS_DATA_DIR": "<AEGIS_DATA_DIR>",
                "AEGIS_PORT": "<AEGIS_PORT>",
                "AEGIS_LOG_LEVEL": "<AEGIS_LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "aegis": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@getaegis/cli"
            ],
            "env": {
                "AEGIS_MASTER_KEY": "<AEGIS_MASTER_KEY>",
                "AEGIS_SALT": "<AEGIS_SALT>",
                "AEGIS_DATA_DIR": "<AEGIS_DATA_DIR>",
                "AEGIS_PORT": "<AEGIS_PORT>",
                "AEGIS_LOG_LEVEL": "<AEGIS_LOG_LEVEL>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e AEGIS_MASTER_KEY=<AEGIS_MASTER_KEY> -e AEGIS_SALT=<AEGIS_SALT> -e AEGIS_DATA_DIR=<AEGIS_DATA_DIR> -e AEGIS_PORT=<AEGIS_PORT> -e AEGIS_LOG_LEVEL=<AEGIS_LOG_LEVEL> aegis npx -y @getaegis/cli
```
Replace <…> with your own values. 6 more environment variables are in the server README

## When to use it
- prevent API credential leaks through prompt injection
- restrict external API requests to verified domain allowlists
- log every outbound call in an audit trail
- isolate access tokens to designated agent identities

## Example prompts
- Use aegis_list_services to see which APIs are configured
- Send an authenticated request to Slack path /api/auth.test via aegis_proxy_request
- Check proxy status using aegis_health

## Similar
- [onepassword](https://affpapa.org/en/nevibecode/mcp/onepassword.md) — MCP server · ★ 81
- [authsome](https://affpapa.org/en/nevibecode/skills/authsome.md) — skill · 3000 installs
- [enigmagent-mcp](https://affpapa.org/en/nevibecode/mcp/enigmagent-mcp.md) — MCP server · ★ 6
- [1password](https://affpapa.org/en/nevibecode/mcp/1password.md) — MCP server · ★ 22
- [hashicorp-vault](https://affpapa.org/en/nevibecode/skills/hashicorp-vault.md) — skill · 413 installs
- [ghost-scan-secrets](https://affpapa.org/en/nevibecode/skills/ghost-scan-secrets.md) — skill · 4400 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
