MCP Gateway 2974a34e

MCP安全风控

提供方 PetrefiedThunder · 包名 mcp-gateway

安全风控 stdio · 本地进程 API Key 社区 / 第三方 Claude DesktopClaude
查看接入方式

MCP网关是企业级基础设施层,为AI代理提供认证、授权、审计日志、速率限制、使用计量和密钥管理等功能,适用于医疗、金融和企业等合规场景。

一句话选型结论

按资料字段整理

MCP Gateway 2974a34e 属于安全风控类 MCP 服务器,stdio · 本地进程,API Key,可直接接入 Claude Desktop、Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

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

工具与能力

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

能力标签

支持客户端

适用场景

企业级网关TypeScript本地部署AI代理管理合规性RBAC审计日志

安装与配置

stdio · 本地进程 API Key
客户端在本机拉起子进程,数据不出本机
npx mcp-gateway init

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

  1. 1
    准备运行环境

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

  2. 2
    安装服务

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

  3. 3
    写入客户端配置

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

  4. 4
    验证是否可用

    连接成功后客户端会列出约 8 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

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

值得选的地方

  • 资料标注 8 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

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

不太适合

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

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Gateway 2974a34e当前 8 stdio · 本地进程 本地部署 有 2026-05-17
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

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

详细介绍

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

mcp-gateway

The enterprise infrastructure layer for MCP. Authentication, authorization, audit logging, rate limiting, usage metering, and secret management — for AI agents calling MCP tools in production.

Think: Cloudflare + Okta + Datadog, but for Model Context Protocol.

Why

MCP today: agent → server. Direct connection. No auth, no audit trail, no rate limits, no billing, no secret management.

That's fine for demos. It's not fine for:
- Healthcare (HIPAA audit requirements)
- Finance (SOC 2, regulatory compliance)
- Enterprise (RBAC, cost allocation, security)

MCP Gateway sits between agents and servers, enforcing policy on every tool call.```
Agent (Claude, GPT, etc.)
↓ MCP protocol
┌──────────────────────────┐
│ MCP Gateway │
│ Auth → Policy → Audit │
│ Rate Limit → Meter │
│ Secrets → Sandbox │
└──────────────────────────┘
↓ MCP protocol
MCP Server (any server)


## Five Pillars

### 1. Registry + Discovery
Register MCP servers. Agents discover available tools through the gateway. Multi-tenant: each consumer sees only what they're allowed to see.

### 2. Policy + Permissions (RBAC)
- API key authentication per agent/consumer
- Role-based tool permissions (`reader` can `get_*` and `search_*`, not `delete_*`)
- Server-level restrictions (block access to `mcp-stripe` for read-only agents)
- Parameter-level conditions (only allow queries for own customer ID)

### 3. Audit + Provenance
- Every tool call logged: who, what, when, args, response, latency
- **Tamper-evident hash chain** — each entry hashes the previous, detectable if modified
- Exportable to S3, webhook, SIEM
- Query by consumer, server, tool, status, time range

### 4. Metering + Billing
- Usage tracking per consumer, per server, per tool
- Calls, latency, error rates
- Cost allocation for chargeback
- Stripe integration ready

### 5. Runtime Sandbox + Secrets
- MCP servers run as managed child processes
- Secrets injected via environment variables — never exposed to agents
- Timeout enforcement, automatic restart on crash
- Server health monitoring

## Quick Start```bash
# Install
git clone https://github.com/PetrefiedThunder/mcp-gateway.git
cd mcp-gateway
npm install && npm run build

# Generate config
npx mcp-gateway init

# Edit gateway.yaml with your servers and API keys

# Start the gateway (as an MCP server)
npx mcp-gateway serve

Configuration

The gateway is configured via gateway.yaml:```yaml
auth:
type: api-key
keys:
- id: key-1
key: gw_your_key_here
name: "Production Agent"
consumerId: agent-prod
roles: [reader, writer]
enabled: true

servers:
- id: mcp-fred
name: "Federal Reserve Economic Data"
command: node
args: ["./mcp-fred/dist/index.js"]
enabled: true

  • id: mcp-stripe
    name: "Stripe Payments"
    command: node
    args: ["./mcp-stripe/dist/index.js"]
    env:
    STRIPE_SECRET_KEY: "${STRIPE_SECRET_KEY}"
    enabled: true

policies:
- id: reader-policy
name: "Read-only access"
roles: [reader]
rules:
- tool: "get_"
action: allow
- tool: "search_
"
action: allow
- tool: "*"
action: deny

  • id: admin-policy
    name: "Full access"
    roles: [admin]
    rules:
    • action: allow

audit:
enabled: true
storage: sqlite
path: ./gateway-audit.db
hashChain: true

metering:
enabled: true
dimensions: [calls, latency, errors]

rateLimit:
enabled: true
defaultPerMinute: 60


## CLI```bash
# API Key Management
mcp-gateway keys list
mcp-gateway keys create "My Agent" agent-1 reader,writer
mcp-gateway keys revoke key-123

# Server Management
mcp-gateway servers list

# Audit
mcp-gateway audit log --limit=50
mcp-gateway audit stats
mcp-gateway audit verify    # verify hash chain integrity

# Usage
mcp-gateway usage
mcp-gateway usage agent-1

Gateway Tools (MCP Interface)

The gateway itself is an MCP server. Connect to it and use these tools:

Tool Description
call Call any registered tool through the auth/policy/audit pipeline
list_tools List available tools (filtered by caller permissions)
list_servers List registered MCP servers and status
server_status Detailed server health status
audit_log Query the audit log
audit_verify Verify tamper-evident hash chain
audit_stats Audit statistics
usage Usage metrics by consumer

Usage with Claude Desktop```json

{
"mcpServers": {
"gateway": {
"command": "node",
"args": ["/path/to/mcp-gateway/dist/index.js"],
"env": {
"MCP_GATEWAY_CONFIG": "/path/to/gateway.yaml"
}
}
}
}


## Architecture```
src/
├── index.ts          # MCP server entry point (stdio transport)
├── serve.ts          # HTTP server entry point (network transport)
├── cli.ts            # CLI management tool
├── gateway.ts        # Core orchestrator — auth → policy → audit → meter → proxy
├── auth.ts           # API key + JWT + OIDC authentication
├── policy.ts         # RBAC policy engine (glob matching, conditions)
├── audit.ts          # SQLite/Postgres audit log with hash chain
├── storage.ts        # Storage abstraction (SQLite embedded, PostgreSQL)
├── ratelimit.ts      # Token bucket rate limiter with burst
├── meter.ts          # Usage metering and aggregation
├── metrics.ts        # Prometheus /metrics endpoint
├── registry.ts       # Server lifecycle management + auto-restart
├── proxy.ts          # MCP JSON-RPC proxy (stdio)
├── redact.ts         # PII redaction (SSN, credit card, field-level)
├── ipfilter.ts       # IP allowlist/denylist (CIDR, wildcard)
├── tenant.ts         # Multi-tenant workspace isolation
├── export.ts         # Audit export (JSONL, CSV, webhook, S3)
├── config.ts         # YAML config loader + validation + hot-reload
├── middleware.ts      # Request tracking, timeouts, structured logging
├── openapi.ts        # OpenAPI 3.1 spec generation
└── types.ts          # TypeScript domain types

Production Deployment```bash

Docker Compose (Gateway + Postgres + Prometheus + Grafana)

docker-compose up -d

Access:

Gateway: http://localhost:3100

Prometheus: http://localhost:9090

Grafana: http://localhost:3000 (admin/admin)

Metrics: http://localhost:3100/metrics

OpenAPI: http://localhost:3100/openapi.json


## Compliance

- **HIPAA**: PII redaction, tamper-evident audit log, field-level access control
- **SOC 2**: Complete audit trail, RBAC, rate limiting, IP filtering
- **PCI-DSS**: Credit card redaction, API key rotation, network controls
- **GDPR**: Per-tenant data isolation, audit export for data requests

## 58 Tests```
 ✓ auth.test.ts       (6 tests)   — API key auth, disabled/expired keys
 ✓ auth-jwt.test.ts   (5 tests)   — JWT verification, claims, issuer
 ✓ policy.test.ts     (6 tests)   — RBAC, glob matching, deny precedence
 ✓ ratelimit.test.ts  (6 tests)   — token bucket, burst, isolation
 ✓ audit.test.ts      (3 tests)   — log, query, hash chain verify
 ✓ meter.test.ts      (4 tests)   — usage tracking, isolation
 ✓ storage.test.ts    (4 tests)   — SQLite insert, query, upsert, stats
 ✓ config.test.ts     (5 tests)   — validation, duplicates, missing fields
 ✓ redact.test.ts     (7 tests)   — SSN, CC, email, field-level, per-server
 ✓ ipfilter.test.ts   (5 tests)   — allowlist, denylist, CIDR, wildcard
 ✓ metrics.test.ts    (3 tests)   — Prometheus format, counters, histograms
 ✓ middleware.test.ts  (4 tests)   — request tracking, timeout, drain

License

MIT

常见问题

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

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

MCP Gateway 2974a34e 怎么在 Claude Desktop、Claude 里配置?

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

MCP Gateway 2974a34e 收费吗?

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

MCP Gateway 2974a34e 需要 API Key 吗?

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

MCP Gateway 2974a34e 支持哪些客户端?

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

MCP Gateway 2974a34e 能提供哪些能力?

资料显示约 8 个工具;能力标签包括 TypeScript、Claude、审计日志。具体工具清单以官方文档为准。

MCP Gateway 2974a34e 需要什么运行环境?

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

MCP Gateway 2974a34e 是本地还是远程?

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

热门专题

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

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