Secure Agent MCP Gateway
Secure Agent MCP Gateway
通过 MCP 到 MCP 的安全网关进行 SOC 告警分流:Agent 从不直接调用真实工具。每个 tools/list / tools/call 都会根据角色(viewer | operator | admin)进行范围限定和授权。
main.py (agent) → gateway → mcp_server (tools)更多详情:gateway/README.md。
快速开始(本地)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# edit .env — set LLM_API_KEY (never commit .env)三种角色服务(本地)
# 1) Viewer — reputation lookups only
python main.py --mcp --role viewer --alert sample_alert.json
# 2) Operator — triage / summarize / notify (no block or escalate)
python main.py --mcp --role operator --alert sample_alert.json
# 3) Admin — full tool set through the gateway
python main.py --mcp --role admin --alert sample_alert.json确定性路径(无 MCP / 无网关):
python main.py --alert sample_alert.json仅策略检查:
python -m gateway.policyRelated MCP server: production-mcp-server
Docker 部署
需要 Docker 与 Compose。密钥保留在镜像之外:
cp .env.example .env
# set LLM_API_KEY in .env构建
docker compose build
# or:
docker build -t secure-agent-mcp-gateway:latest .三个服务(每服务一个角色)
同一镜像,但 GATEWAY_ROLE 不同。每个容器为对应角色运行完整链路(main → gateway → mcp_server)。
# 1) Viewer
docker compose run --rm triage-viewer
# 2) Operator
docker compose run --rm triage-operator
# 3) Admin
docker compose run --rm triage-admin或按服务名启动:
docker compose up triage-viewer
docker compose up triage-operator
docker compose up triage-admin无需文件即可传入密钥:
LLM_API_KEY=sk-... docker compose run --rm triage-admin纯 Docker(无 Compose)
docker build -t secure-agent-mcp-gateway:latest .
docker run --rm \
-e LLM_API_KEY \
-e LLM_MODEL=gpt-4o-mini \
-e GATEWAY_ROLE=viewer \
secure-agent-mcp-gateway:latest \
python main.py --mcp --role viewer --alert sample_alert.json
docker run --rm -e LLM_API_KEY -e GATEWAY_ROLE=operator \
secure-agent-mcp-gateway:latest \
python main.py --mcp --role operator --alert sample_alert.json
docker run --rm -e LLM_API_KEY -e GATEWAY_ROLE=admin \
secure-agent-mcp-gateway:latest \
python main.py --mcp --role admin --alert sample_alert.json环境变量
变量 | 用途 |
| Agent 与发现摘要所需 |
| 默认 |
| 默认 |
|
|
.env 已被 git 忽略。只有 .env.example 会被提交。
角色(策略)
角色 | 可使用的工具 |
|
|
| 信誉、分流、摘要、通知 |
| 所有工具,包括 |
定义于 gateway/policy.yaml。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA secure MCP gateway for enterprise AI tool execution, enabling governed invocation of business tools with authentication, RBAC, audit logging, PII redaction, and async processing.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to safely call enterprise tools through a governed MCP gateway with permission enforcement, blast-radius controls, input validation, and a full audit trail for every invocation.MIT
- AlicenseAqualityCmaintenanceProvides a security governance layer for AI agents to safely access upstream MCP servers, enforcing tool-level RBAC, parameter constraints, authentication via static tokens or OIDC, and tamper-evident audit logging.21Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables governed MCP agent tool invocation with policy-based authorization, short-lived credentials, and audited access control.-