MM

microsoft/mcp-gateway

部署与 DevOps

本页由 AI 翻译,技术细节请以原文为准。 查看原文

899 stars 94 forks 质量 86 趋势 43MIT

MCP 网关是 MCP 服务器的反向代理和管理层,使 Kubernetes 环境中的 MCP 服务器实现可扩展、会话感知的有状态路由和生命周期管理。

概览

是模型上下文协议(MCP)服务器的反向代理和管理层,实现了Kubernetes 环境中MCP服务器的可扩展、会话感知路由、授权和管理生命周期管理。 - 一个用于将流量路由到具有会话亲和性的MCP服务器的数据网关。- 一个用于管理MCP服务器生命周期(部署、更新、删除)的控制平面。- 企业级集成点,包括遥测、访问控制和可观测性。 - : 实现模型上下文协议的服务器,通常是可流式的HTTP端点。- : 代表网关中MCP服务器的逻辑资源,管理于/adapters范围。设计为与其他资源类型(如/agents)共存于统一的AI开发平台中。- : 注册的资源,定义了MCP工具,可通过工具网关路由器动态路由。每个工具包含其执行端点和输入模式的元数据。

概述(AI 翻译)

MCP 网关 是模型上下文协议(MCP)服务器的反向代理和管理层,支持Kubernetes 环境中可扩展、无状态的请求路由、授权和生命周期管理。

破坏性变更: 本版本需要 MCP 2026-07-28 客户端和适配器。它不提供遗留初始化、传输会话或协议降级。请参阅迁移指南,了解客户端需求、请求示例、部署设置和回滚考虑。

目录

  • 概述
  • 关键概念
  • 建筑学
  • 特色
  • 入门 – 本地部署
  • 入门指南 – 一键部署到 Azure

概述

该项目提供:

  • 一个数据网关,用于独立路由每个MCP请求到已准备好的服务器实例。
  • 管理MCP服务器生命周期的控制平面(部署、更新、删除)。
  • 企业级集成点,包括遥测、访问控制和可观测性。

关键概念

  • MCP 服务器:实现模型上下文协议的服务器,通常是可流式的 HTTP 端点。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Gateway

MCP Gateway is a reverse proxy and management layer for Model Context Protocol (MCP) servers, enabling scalable, stateless request routing, authorization and lifecycle management of MCP servers in Kubernetes environments.

Breaking change: this version requires MCP 2026-07-28 clients and adapters. It does not provide legacy initialization, transport sessions, or protocol downgrade. See the migration guide for client requirements, request examples, deployment settings, and rollback considerations.

Table of Contents

Overview

This project provides:

  • A data gateway for independently routing each MCP request to a ready server instance.
  • A control plane for managing the MCP server lifecycle (deploy, update, delete).
  • Enterprise-ready integration points including telemetry, access control and observability.

Key Concepts

  • MCP Server: A server implementing the Model Context Protocol, which typically a streamable HTTP endpoint.
  • Adapters: Logical resources representing MCP servers in the gateway, managed under the /adapters scope. Designed to coexist with other resource types (e.g., /agents) in a unified AI development platform.
  • Tools: Registered resources with MCP tool definitions that can be dynamically routed via the tool gateway router. Each tool includes metadata about its execution endpoint and input schema.
  • Tool Gateway Router: An MCP server that directs tool execution requests to registered tool servers based on tool definitions. Multiple router instances can handle requests without transport-session affinity.
  • Stateless MCP Routing: Each request carries its protocol metadata and is independently authorized. Legacy session headers and the gateway’s session_id query alias do not determine routing.
  • Agents & Sessions (Preview): Optional, opt-in resources for running LLM-driven agents on top of registered MCP tools. Agents are metadata (system prompt + model + allowed tool list); Sessions are individual runs that stream events over Server-Sent Events. Disabled unless FoundrySettings:Endpoint is configured.

Architecture

flowchart LR
    subgraph Clients[" "]
        direction TB
        DataClient["🔌 Agent/MCPData Client"]
        MgmtClient["⚙️ ManagementClient"]
    end

    subgraph Gateway["MCP Gateway"]
        direction TB
        
        subgraph Auth1["Authentication & Authorization"]
            Auth["🔐 Data Plane AuthBearer Token / RBAC"]
            Auth2["🔐 Control Plane AuthBearer Token / RBAC"]
        end
        
        subgraph DataPlane["Data Plane"]
在 GitHub 查看完整 README

安装

docker run -d -p 5000:5000 --name registry registry:2.7
新手?先看 mcpskill.org 教程 →