# Repository Briefing: microsoft/mcp-gateway
> Source: https://repoforai.com/repo/microsoft/mcp-gateway (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/microsoft/mcp-gateway
- **Official Docs / Website**: https://microsoft.github.io/mcp-gateway/
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: C#
- **License**: MIT
- **Engineering Health**: A+ (91/100 · Maintenance 35/35 · Adoption 16/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.0.1 (2026-11-16) — https://github.com/microsoft/mcp-gateway/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, API
- **Momentum**: 931 ★ total (+1 24h / +3 7d) · 97 forks
- **Topics**: `ai`, `api-gateway`, `arm-deployments`, `asp-net-core`, `azure`, `bicep`, `cloud-computing`, `cloud-computing-service`, `csharp`, `docker`, `gateway`, `infrastructure-as-code`
- **When to Use**: Best for: Platform teams already running Kubernetes that need one place to deploy MCP backends, control access, and route tool calls, and can upgrade clients and adapters together. Skip if: You only need to connect to a fixed server, must retain legacy MCP clients, or need a production-ready multi-replica agent runtime.

## Overview
```text
### Architecture & Core Mechanics
A C#/.NET 8 gateway separates the MCP data plane from the Kubernetes lifecycle control plane. POST /adapters/{name}/mcp sends each independently authorized request to a ready instance of a named adapter, returning JSON or request-scoped SSE. POST /mcp instead reaches a replicated tool router that selects a registered backend using the tool definition and its configured execution endpoint.

The /adapters and /tools APIs feed deployment and metadata managers. Workloads use StatefulSets and headless services, while resource metadata lives in Redis for local Kubernetes or Cosmos DB in the cloud. Stateless routing means the gateway stores no MCP transport sessions; it does not mean the control plane has no persistence.

### Key Capabilities & Differentiators
Adapters can proxy local or remote MCP servers. Tool registration captures the container image and version, input schema, execution port and path, replica count, and environment variables. The built-in React portal exposes resource management, pod logs, and a JSON-RPC test console. In Entra ID mode, the creator and mcp.admin can read and write; configured resource roles can grant read access.

The optional Azure Foundry integration adds agent runs with SSE event streaming. Agents can invoke registered MCP tools and delegate to other agents. gpt-4o is an example deployment; any agent configured with tools needs a model that can emit tool calls. Built-in shell execution and file read/write operations are disabled for all callers, including administrators.

### Trade-offs & Limitations
Compared with direct client-to-server connections or a generic Kubernetes ingress, the gateway adds API-driven workload lifecycle management, resource-level access control, and a common endpoint for registered tools. In return, operators own a Kubernetes deployment, a metadata store, container image publishing, and identity configuration. That is a substantial setup cost for one or two fixed backends.

The protocol cutover is a hard compatibility boundary: clients and adapters must support MCP 2026-07-28, and there is no legacy initialization, transport-session support, or downgrade. Keep that separate from agent run sessions: the preview stores session working directories on the serving pod and is intended for single-replica evaluation, not a multi-replica or multi-tenant production rollout without changes to storage and workload isolation.

### Hardware & Deployment Guide
The local build path uses the .NET 8 SDK, Docker Desktop with Kubernetes enabled, and a registry on port 5000. Build and push a sample MCP server image, then publish the gateway and tool-router images. The default target namespace is adapter and can be changed with Kubernetes__Namespace. Use an isolated namespace for end-to-end testing rather than replacing an existing deployment.

Plan for Redis locally or Cosmos DB in the cloud, and configure Entra ID application roles before exposing a shared deployment. The portal's development mode allows anonymous access. The core gateway does not require Foundry; that dependency applies to preview agent execution. Deploy v1.0.1 or later for the fix that stops tool invocations from following HTTP redirects returned by tool pods.
```

## Key Capabilities
```text
- Routing: /adapters/{name}/mcp targets a named server; /mcp uses a replicated router for registered tools.
- Protocol: Requires MCP 2026-07-28; requests route independently without transport-session affinity.
- Lifecycle: /adapters and /tools expose CRUD, deployment status, and running logs.
- Access control: Entra ID resource roles can grant reads; writes are reserved for the creator or mcp.admin.
- Operations: The gateway serves a React portal at /portal/ with resource management, pod logs, and an in-browser JSON-RPC console.
- Release security: v1.0.1 stops registered-tool invocations from following HTTP redirects, including during agent runs.
```

## Quick Start / Clone
```bash
docker run -d -p 5000:5000 --name registry registry:2.7
```
