
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 分