microsoft/mcp-gateway
Kubernetes MCP gateway for stateless routing and managed server lifecycles
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
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.
You only need to connect to a fixed server, must retain legacy MCP clients, or need a production-ready multi-replica agent runtime.
Quick Start & Installation
docker run -d -p 5000:5000 --name registry registry:2.7
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| mcp-gateway ★ | 931 | +3 | C# | MIT | Kubernetes MCP gateway for stateless routing and managed server lifecycles |
| rea | 488.8k | +7.6k | TypeScript | MIT | A local CLI and MCP server for evidence-backed app and binary analysis |
| skills | 338.7k | +4.4k | Shell | MIT | Composable Markdown skills that bring engineering workflows to coding agents |
| superpowers | 332.4k | +4.2k | Shell | MIT | A skills framework that gives coding agents a test-first development workflow |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/microsoft/mcp-gateway.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about mcp-gateway
Which endpoint should an MCP client use?
Does the gateway need a GPU, and what should I size first?
Can we self-host the gateway for commercial use?
When is this a better fit than direct MCP connections or a generic ingress?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy