
Mcp Gateway
io.github.authzx由 GitHub 账号 authzx 发布v1.0.1更新于 Oct 24, 2026
AuthzX MCP Gateway — policy-enforcing proxy between AI agents and MCP servers
概览
一个策略执行网关,位于 AI 智能体与其他 MCP 服务器之间,在转发前对每次工具调用进行授权检查。
- 可以做什么
- 按网关配置文件代理下游 MCP 服务器,让客户端通过网关而非直连使用其工具。拦截每次工具调用并按授权策略检查后再转发,本地模式使用本地代理与 .rego 策略文件,云端模式使用云端 API。将每次调用以结构化 JSON 记录主体、工具名、参数与决策。可通过 stdio 服务单个桌面智能体,或通过 HTTP 以按调用方的令牌与主体服务多个调用方。可在命令行列出下游工具并生成初始策略文件。
- 适用场景
- 当助手连接的 MCP 服务器工具可能读取数据库、删除文件或执行 SQL,而你需要每次调用在执行前经过策略检查并留下审计记录时使用。也适合让多个具有不同身份的智能体共用一个受管控的网关。
- 运行要求
- 以 npm 包形式在本地通过 stdio 运行,启用后也可通过 HTTP 运行。需要网关配置文件指定要启动的下游服务器和主体身份。本地模式需要安装 Vengtoo Agent 和 .rego 策略文件;云端模式需要云端 URL 和 API 密钥,可通过环境变量提供。HTTP 模式在绑定非回环地址时需要调用方令牌。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp Gateway,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Vengtoo MCP Gateway
Authorization gateway for AI agents and MCP tool calls.
Open-source. Drop-in. Works with any MCP client.
Why
AI agents connected to MCP servers can call any tool they have access to: read your database, delete files, execute arbitrary SQL. Vengtoo MCP Gateway puts a policy enforcement point between the agent and those tools, so every call is authorized before it executes.
What it does
- Sits between MCP clients (Claude Code, Cursor, VS Code, GitHub Copilot) and any MCP server
- Intercepts every tool call and checks authorization before forwarding
- Two modes: cloud (Vengtoo Cloud API) and local (Vengtoo Agent + .rego policy file)
- Full audit trail of every tool invocation: subject, tool name, arguments, and decision are logged as structured JSON:
Quick Start
- Install and start the Vengtoo Agent. The agent runs locally and evaluates your authorization policy; no cloud account needed.
Create a policy.rego to define what your agent can do:
See demo/policies/ for more examples including Kubernetes namespace protection.
- Create a
gateway.config.json:
- Add to your MCP client (e.g. Claude Code):
Configuration
Config schema
* Provide either agentUrl (local mode) or cloudUrl (cloud mode).
Each entry in servers has:
Modes
Cloud mode
Connect to Vengtoo Cloud for managed policies:
Local mode
Run the Vengtoo Agent locally with a .rego policy file for offline, self-contained authorization:
Transport
The gateway exposes its (policy-enforced) tools to callers over one of two transports.
stdio (default)
Runs as a local subprocess speaking MCP over stdin/stdout: the right choice for a single desktop agent (Claude Desktop, Cursor, Claude Code). No network surface.
HTTP (remote)
Runs a Streamable HTTP MCP server at a URL, so a
remote agent (or many concurrent agents) can share one governed gateway. Enable it
with --http (or "transport": "http" in the config):
HTTP config (http.*):
Per-caller identity. Give each agent its own token and subject, and your policies (and audit trail) see each caller's real identity through one shared gateway:
Also settable via VENGTOO_GATEWAY_HTTP_CALLERS="<token>=agent:claude,<token>=agent:cursor".
Sessions are bound to the token that opened them: a different caller presenting another
caller's session id gets a 401, so identities cannot cross sessions. Tokens listed in
authTokens (or callers omitted entirely) run as the config's global subject.
Safety: the gateway refuses to bind a non-loopback interface with no caller auth
(callers or authTokens). Either configure tokens, or set
VENGTOO_GATEWAY_ALLOW_UNAUTHENTICATED=true to knowingly expose an open endpoint. An
unauthenticated GET /healthz liveness probe is always served.
⚠️ Security: Vengtoo trusts whichever subject this gateway asserts. The
callerstoken→subject mapping above (owned by this gateway's own config) is the correct pattern; it is NOT the same as trusting a client-supplied header. Never change this to derive the subject from a header/field a calling client sends; that would let any caller claim to be any subject and inherit its permissions within your tenant. If you front this gateway with another reverse proxy, make sure that proxy cannot be made to forward an arbitrary caller-chosen bearer token or subject.
CLI Flags
Environment overrides: VENGTOO_API_KEY, VENGTOO_AGENT_URL, VENGTOO_SUBJECT,
VENGTOO_GATEWAY_TRANSPORT (http), VENGTOO_GATEWAY_PORT / PORT, VENGTOO_GATEWAY_HOST,
VENGTOO_GATEWAY_PATH, VENGTOO_GATEWAY_HTTP_TOKENS (comma-separated), VENGTOO_GATEWAY_ALLOW_UNAUTHENTICATED.
MCP Client Setup
The gateway runs as a stdio MCP server. Point your MCP client at it instead of the downstream server directly.
Claude Code
Cursor
Add to .cursor/mcp.json:
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
VS Code / GitHub Copilot
Add to .vscode/mcp.json:
See demo/ for full end-to-end examples with sample policies.
Roadmap
See ROADMAP.md for what's planned: per-caller OAuth, downstream resilience, dynamic tool lists, metrics, remote downstream servers, and more.
Feedback
- GitHub Issues: Bug reports and feature requests
- Documentation: Guides and API reference
License
Apache-2.0, see LICENSE.
来源:README.md,提交 8eff947
工具
0版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分