/ 目錄 / 演練場 / Microsoft MCP Gateway
● 官方 microsoft ⚡ 即開即用

Microsoft MCP Gateway

作者 microsoft · microsoft/mcp-gateway

Reverse proxy and lifecycle manager for fleets of MCP servers on Kubernetes.

MCP Gateway is Microsoft's session-aware reverse proxy for MCP servers. It manages the lifecycle of stateful MCP instances on Kubernetes, routes by session/tenant, and centralizes auth — turning ad-hoc MCP servers into a real platform tier.

為什麼要用

核心特性

即時演示

實際使用效果

microsoft-mcp-gateway.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "microsoft-mcp-gateway": {
      "command": "mcp-gateway",
      "args": [
        "serve"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "microsoft-mcp-gateway": {
      "command": "mcp-gateway",
      "args": [
        "serve"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "microsoft-mcp-gateway": {
      "command": "mcp-gateway",
      "args": [
        "serve"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "microsoft-mcp-gateway": {
      "command": "mcp-gateway",
      "args": [
        "serve"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "microsoft-mcp-gateway",
      "command": "mcp-gateway",
      "args": [
        "serve"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "microsoft-mcp-gateway": {
      "command": {
        "path": "mcp-gateway",
        "args": [
          "serve"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add microsoft-mcp-gateway -- mcp-gateway serve

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Microsoft MCP Gateway

Stand up an internal MCP catalog with one auth boundary

👤 Platform engineering teams ⏱ ~15 min intermediate

何時使用: You have 10+ MCP servers and need centralized auth, quotas, and observability.

前置條件
  • Server/skill installed and authenticated — See repo README
步驟
  1. Deploy the gateway
    Generate Helm values for mcp-gateway with our Entra OIDC issuer and three backend MCPs: github, jira, snowflake.✓ 已複製
    → values.yaml + helm command
  2. Register
    Register each backend and assign it to the 'engineering' tenant with a 1000 req/hr quota.✓ 已複製
    → Three backend ids + quota set

結果: One URL, one OIDC, many MCPs — properly governed.

注意事項
  • Session affinity is critical for stateful servers. If you switch to a stateless backend, also disable affinity to avoid hotspots. — Session affinity is critical for stateful servers. If you switch to a stateless backend, also disable affinity to avoid hotspots.

組合

與其他 MCP 搭配,撬動十倍槓桿

microsoft-mcp-gateway + containers/kubernetes-mcp-server

Pair with containers/kubernetes-mcp-server for complementary capabilities

Use this server together with containers/kubernetes-mcp-server to complete a multi-step task.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
list_backends (none) See registered MCP servers 1 API call
register_backend name, image, env Add a new MCP server behind the gateway K8s scheduling
tenant_quota tenant_id Inspect or adjust per-tenant limits 1 API call

成本與限制

運行它的成本

API 配額
See provider docs for rate limits
每次呼叫 Token 數
Varies by tool
費用
See repo README for pricing details
提示
Cache tool results and avoid repeated identical calls.

安全

權限、密鑰、影響範圍

憑證儲存: Use environment variables; never commit secrets
資料出站: Tool calls go to the provider's API as documented

故障排查

常見錯誤與修復

backend unhealthy

Gateway probes GET /healthz. Make sure your MCP server implements it or update healthCheck.path.

驗證: kubectl get pods -n mcp
OIDC validation fails

Issuer URL must match the token's iss claim exactly, including trailing slash. Recheck Entra app config.

驗證: Decode token at jwt.ms

替代方案

Microsoft MCP Gateway 對比其他方案

替代方案何時用它替代權衡
agentic-community/mcp-gateway-registryYou prefer the community OSS optionLess Azure-native

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills