/ 目录 / 演练场 / 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