Aegis MCP Proxy

MCPAI代理

提供方 bigmoon-dev · 包名 aegis-mcp-proxy

AI代理 stdio · 本地进程 Token 社区 / 第三方 Claude
查看接入方式

Aegis MCP是一款MCP协议级治理代理,可在AI代理和MCP工具服务器之间强制执行访问控制、速率限制、人工审批工作流等硬性约束,无需修改代理代码。

一句话选型结论

按资料字段整理

Aegis MCP Proxy 属于AI代理类 MCP 服务器,stdio · 本地进程,Token,可直接接入 Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权Token 部署方式本地部署
GitHub 星标 3 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

AI代理治理Go本地部署协议级代理速率限制访问控制审计日志

安装与配置

stdio · 本地进程 Token
客户端在本机拉起子进程,数据不出本机
npx aegis-mcp-proxy config/aegis.yaml

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Aegis MCP Proxy当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方bigmoon-dev上游标注的维护方 bigmoon-dev
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时aegis-mcp-proxy · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

13.8 KB
来自项目仓库与上游目录的原文,未做删改

Aegis MCP

The MCP governance proxy that turns soft rules into hard constraints.

English | 中文

Aegis MCP sits between your AI agents and MCP tool servers as a protocol-level proxy, enforcing constraints that agents cannot bypass — rate limiting, access control, human approval workflows, serialized execution queues, and full audit logging. Zero code changes required for any MCP-compatible agent.```
AI Agents
┌────────┬────────┐
Agent Agent Agent
A B C
│ │ │
└────┬───┴───┬────┘
▼ ▼
┌────────────────────────────────┐
│ Aegis MCP (:18070) │
│ │
│ Pipeline: │
│ ① ACL → ② Rate Limit │
│ → ③ Human Approval │
│ → ④ FIFO Queue → ⑤ Forward │
│ → ⑥ Audit Log │
└───────────────┬────────────────┘
▼
┌────────────────────────────────┐
│ MCP Tool Server │
│ (e.g. social media, │
│ database, APIs...) │
└────────────────────────────────┘


## Why an MCP Proxy?

AI agents are powerful but unreliable rule followers. Prompt-based "soft rules" like "don't post more than once per day" are routinely violated. When agents operate on real accounts — social media, e-commerce, customer service — a single burst of unchecked actions can trigger platform bans, compliance violations, or worse.

Aegis MCP converts soft rules into **programmatic hard constraints** at the MCP protocol level. The agent literally cannot exceed its rate limit or skip the approval step, regardless of what the LLM decides to do.

Unlike SDK-based approaches that require code changes in each agent, Aegis MCP works as a **transparent proxy** — point your agent to Aegis MCP instead of the backend, and governance is enforced automatically. Works with any MCP-compatible agent: Claude Code, OpenClaw, custom agents, and more.

## Features

- **Access Control (ACL)** — Per-agent, per-backend, per-tool allow/deny rules. Denied tools are invisible to the agent (removed from `tools/list` responses).

- **Two-Level Rate Limiting** — Per-agent sliding window limits *and* global cross-agent limits. All agents sharing one account? Global limits prevent cumulative overuse.

- **Human Approval Workflows** — Destructive operations (publishing, deleting) require human approval via webhook notifications with HMAC-signed callback URLs. Supports Feishu/Lark, generic webhooks (Slack, Discord, custom systems), or both simultaneously. Configurable timeout with auto-reject.

- **FIFO Execution Queue** — Per-backend serialized execution with randomized delays (1-10 min configurable) between operations. Mimics human interaction patterns. Bypass list for read-only tools.

- **Audit Logging** — Every tool call is recorded in SQLite: agent, tool, arguments, ACL/rate-limit/approval verdicts, queue position, execution duration, result. Auto-purge with configurable retention.

- **Tool Description Enhancement** — Constraints are injected into tool descriptions so the agent sees `[Rate:1/1d|ApprovalRequired] Publish post` instead of just `Publish post`. The agent is aware of its limits before deciding what to do.

- **Hot Reload** — Update config without restart via `POST /api/v1/config/reload`.

- **Single Binary** — Written in Go with only 5 direct dependencies. Runs on a Raspberry Pi.

## Installation

### npm (recommended for MCP users)```bash
npx aegis-mcp-proxy config/aegis.yaml
# Or install globally:
npm install -g aegis-mcp-proxy
aegis-mcp-proxy config/aegis.yaml

Pre-built binaries

Download from GitHub Releases:```bash
tar xzf aegis_v*.tar.gz
./aegis config/aegis.yaml


### Docker```bash
docker run --rm -v $(pwd)/config:/config ghcr.io/bigmoon-dev/aegis /config/aegis.yaml

go install

Requires Go 1.24+ and CGO (gcc):```bash
CGO_ENABLED=1 go install github.com/bigmoon-dev/aegis/cmd/aegis@latest
aegis config/aegis.yaml


### Build from source```bash
git clone https://github.com/bigmoon-dev/Aegis.git
cd Aegis
make build
./aegis config/aegis.yaml

Quickstart

Experience Aegis in 2 minutes:```bash
npx aegis-mcp-proxy demo


Follow the on-screen curl examples to see ACL filtering, rate limiting, human approval, and audit logging in action.

Ready to connect your own MCP server? Pick your agent:

| Guide | Agent | Time |
|-------|-------|------|
| Claude Code Guide | Claude Code (Anthropic) | 5 min |
| OpenClaw Guide | OpenClaw | 10 min |
| Generic Agent Guide | Any MCP-compatible agent | 5 min |

> **中文版**: Claude Code · OpenClaw · 通用 Agent

### Interactive Setup (Recommended for New Users)

The quickest way to get a working configuration:```bash
./aegis setup
# or: npx aegis-mcp-proxy setup

The wizard walks you through:

  1. Backend URL — enter your MCP server address, Aegis connects and discovers available tools
  2. Per-tool policies — smart defaults based on tool names (read-only tools get unlimited access, write/publish tools get rate limits + approval, dangerous tools get denied)
  3. Agent config — auto-detects installed agents and injects the Aegis proxy URL into their config
  4. Approval notifications — configure Feishu/Lark or generic webhook URLs for approval request delivery (only when tools require approval). Auto-detects your local IP for callback URLs

Supported agents:

Agent Config File Detection
OpenClaw ~/.openclaw/workspace/config/mcporter.json Auto-detected
Claude Code ~/.claude/mcp_servers.json Auto-detected
Custom — Manual setup

The wizard creates a .bak backup before modifying any agent config and validates JSON after writing. If an entry already exists for the same backend, it prompts for conflict resolution.

Try the Interactive Demo

Experience all Aegis features in 5 minutes — no backend setup required. Just needs Node.js:```bash
./aegis demo

or: npx aegis-mcp-proxy demo


This starts a mock MCP server + Aegis proxy with a pre-configured policy. The terminal prints curl commands to try each feature:

| Step | What happens |
|------|-------------|
| `tools/list` | `admin_reset` is hidden by ACL — only 4 tools visible |
| `echo` | Passes through with no restrictions |
| `get_weather` ×4 | First 3 succeed, 4th is rate-limited (`-32002`) |
| `publish_post` | Blocks until you approve via management API |
| `list_posts` | Bypasses FIFO queue, returns immediately |
| `audit/logs` | Shows full audit trail of all operations |

### Cross-compile for Raspberry Pi```bash
# Requires a cross-compiler (e.g. aarch64-linux-gnu-gcc) for CGO/SQLite
CC=aarch64-linux-gnu-gcc make cross-rpi
scp aegis user@your-server:~/aegis/

# Or build directly on the server:
ssh user@your-server 'cd ~/aegis && make build'

Configuration

See the Policy Configuration Guide for detailed documentation on writing policy rules, including field explanations, time formats, policy interactions, and common scenarios.

Basic example:```yaml
server:
listen: ":18070"
read_timeout: 300s
write_timeout: 300s
# api_token: "your-secret-token" # Protect /api/v1/ endpoints

backends:
my-tools:
url: "http://localhost:8080/mcp" # Your MCP tool server
health_url: "http://localhost:8080/health"
timeout: 120s

queue:
my-tools:
enabled: true
delay_min: 60s # Min delay between operations
delay_max: 600s # Max delay between operations
max_pending: 50
bypass_tools: # Skip queue (still rate-limited)
- "health_check"
global_rate_limits: # Across ALL agents
risky_operation: { window: 1h, max_count: 10 }

agents:
production-agent:
display_name: "Production Agent"
auth_token: "your-secret-token-here" # Optional: require Bearer token auth
backends:
my-tools:
allowed: true
tool_denylist: ["dangerous_tool"]
rate_limits:
publish: { window: 24h, max_count: 1 }
approval_required:
- "publish"
- "delete"

dev-agent:
display_name: "Dev Agent"
backends:
my-tools:
allowed: true
tool_denylist: ["publish", "delete", "dangerous_tool"]

approval:
feishu:
webhook_url: "" # Your Feishu/Lark webhook URL
generic:
webhook_url: "" # Any webhook URL (Slack, Discord, custom, etc.)
timeout: 600s
callback_base_url: "http://your-server:18070"

audit:
db_path: "./data/audit.db"
retention_days: 90


## Pipeline

Every `tools/call` request passes through:

| Stage | Purpose | On Reject |
|-------|---------|-----------|
| **ACL** | Agent allowed to call this tool? | JSON-RPC `-32001` |
| **Rate Limiter** | Global + per-agent sliding window check | JSON-RPC `-32002` |
| **Approval Gate** | Human approval via webhook notification | JSON-RPC `-32004` (timeout) |
| **FIFO Queue** | Serialized execution with random delays | JSON-RPC `-32003` (full) |
| **Forwarder** | Proxy to backend MCP server | Backend error |
| **Audit Logger** | Record everything to SQLite | — |

Only successful calls count against rate limits (failed calls don't consume quota).

## Management API

When `server.api_token` is set, all `/api/v1/` endpoints require `Authorization: Bearer `. When not set, the API is open (suitable for localhost-only deployments).```
GET  /health                           # Service + backend health
GET  /api/v1/queue/status              # Pending items per backend
GET  /api/v1/agents                    # Agent list with permissions
GET  /api/v1/agents/{id}/rate-limits   # Current usage vs limits (agent + global scope)
GET  /api/v1/approvals/pending         # Awaiting human decision
POST /api/v1/approvals/{id}/approve    # Approve via API
POST /api/v1/approvals/{id}/reject     # Reject via API
GET  /api/v1/audit/logs                # Query audit log (?limit=50&offset=0)
POST /api/v1/config/reload             # Hot reload configuration

How It Works

  1. Agent sends MCP requests to http://aegis:18070/agents/{agent-id}/mcp
  2. Aegis MCP identifies the agent from the URL path
  3. tools/list → fetches from backend, filters denied tools, injects constraint annotations
  4. tools/call → runs through the full pipeline (ACL → Rate Limit → Approval → Queue → Forward → Audit)
  5. initialize, ping, etc. → passed through transparently
  6. Agent sees only what it's allowed to see, can only do what it's allowed to do

Design Decisions

Decision Rationale
MCP Proxy (not SDK/framework integration) Dynamic tool forwarding; zero code changes; works with any MCP-compatible agent
SQLite (not Redis) Minimal dependencies; persistent audit trail; low resource usage
Per-backend queue All agents sharing one account must serialize globally
HMAC-signed approval callbacks Prevent unauthorized approval via URL guessing
UTC everywhere Avoid DST issues in rate limit window calculations
Global + per-agent rate limits Multi-agent cumulative frequency control for shared accounts

Generic Webhook Payload

When approval.generic.webhook_url is configured, Aegis sends a POST request with Content-Type: application/json:```json
{
"event": "approval_request",
"id": "request-uuid",
"agent_id": "production-agent",
"tool_name": "publish",
"arguments": "{...}",
"created_at": "2026-03-12T10:00:00Z",
"approve_url": "http://aegis:18070/callback/approval?id=xxx&action=approve&token=xxx",
"reject_url": "http://aegis:18070/callback/approval?id=xxx&action=reject&token=xxx"
}


To approve or reject, make a GET request to the corresponding URL. Both Feishu and generic webhook can be configured simultaneously — both will be notified.

## Development

### Running Tests```bash
# All tests
CGO_ENABLED=1 go test ./... -count=1

# With race detector (recommended)
CGO_ENABLED=1 go test -race ./... -count=1

# With coverage
CGO_ENABLED=1 go test -cover ./internal/...

Tests use temporary SQLite databases and in-memory configs — no external dependencies required. CI runs go test -race on every push and pull request.

Security

  • Agent endpoint authentication: Set auth_token per agent in your config to require Authorization: Bearer on /agents/{agentID}/mcp. Tokens must be at least 16 characters. Agents without auth_token remain open (suitable for local/demo use). Always set this in production.
  • Management API authentication: Set server.api_token in your config to require Authorization: Bearer on all /api/v1/ endpoints. Without this, anyone who can reach the port can approve operations, view audit logs, and reload config. Always set this in production.
  • Approval callbacks: Protected by per-request HMAC-SHA256 tokens (generated from a random 32-byte key at startup). Tokens are validated with constant-time comparison.
  • Request size limits: Incoming requests are capped at 1 MB, backend responses at 10 MB.
  • TLS: Aegis listens on plain HTTP. For production, place it behind a reverse proxy (nginx, Caddy) or bind to localhost only.
  • HMAC key lifecycle: The HMAC signing key is generated in-memory at startup. Restarting Aegis invalidates all pending approval tokens.

Requirements

  • Go 1.24+ (CGO enabled for SQLite)
  • An MCP-compatible tool server as backend

License

Apache 2.0

Acknowledgements

Built for governing AI agents operating on real platforms, born from hard-won lessons in social media automation risk control.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Aegis MCP Proxy 怎么安装?

在客户端按下面的安装命令接入:npx aegis-mcp-proxy config/aegis.yaml。对应的包名是 aegis-mcp-proxy。装完在客户端配置里引用同一个包或端点。

Aegis MCP Proxy 怎么在 Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Aegis MCP Proxy 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Aegis MCP Proxy 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Aegis MCP Proxy 支持哪些客户端?

资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Aegis MCP Proxy 能提供哪些能力?

资料显示能力标签包括 访问控制、Go、Claude、审计日志。具体工具清单以官方文档为准。

Aegis MCP Proxy 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

Aegis MCP Proxy 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。