Installing and Configuring MCP Gateway¶
This guide demonstrates how to install and configure the MCP Gateway to aggregate multiple Model Context Protocol (MCP) servers behind a single endpoint.
Note: This guide installs MCP Gateway standalone with Helm. On OLM-based clusters (including OpenShift), install via the Kuadrant Operator instead — see OLM Install.
Prerequisites¶
MCP Gateway runs on Kubernetes and integrates with Gateway API and Istio. You should be familiar with:
- Kubernetes - Basic kubectl and YAML knowledge
- Gateway API - Kubernetes standard for traffic routing
- Istio - Gateway API provider
Choose your setup approach:
Option A: Local Setup Start (5 minutes)
- Want to try MCP Gateway immediately with minimal setup
- Automated script handles everything for you
- Perfect for evaluation and testing
- Quick Start Guide
Option B: Existing Cluster
- You have a Kubernetes cluster with Gateway API CRDs and Istio already installed
- Are ready to deploy MCP Gateway immediately
- If you want to deploy isolated MCP Gateway instances for different teams there is a specific guide for that Isolated Gateway Deployment Guide which goes into more detail.
Installation¶
Step 1: Install CRDs¶
export MCP_GATEWAY_VERSION=1.1.0
kubectl apply -k "https://github.com/kuadrant/mcp-gateway/config/crd?ref=v${MCP_GATEWAY_VERSION}"
Verify CRDs are installed:
Note: CRDs are also installed automatically when deploying via Helm.
Step 2: Install MCP Gateway¶
Find your Gateway name and namespace, then install from GitHub Container Registry:
helm upgrade -i mcp-gateway oci://ghcr.io/kuadrant/charts/mcp-gateway \
--version ${MCP_GATEWAY_VERSION} \
--namespace mcp-system \
--create-namespace \
--set controller.enabled=true \
--set gateway.publicHost=your-hostname.example.com \
--set mcpGatewayExtension.create=true \
--set mcpGatewayExtension.gatewayRef.name=your-gateway \
--set mcpGatewayExtension.gatewayRef.namespace=gateway-system
This automatically installs:
- MCP Gateway Controller - Watches MCPGatewayExtension and MCPServerRegistration resources
- MCPGatewayExtension - Custom resource targeting your Gateway
When the MCPGatewayExtension becomes ready, the controller automatically creates:
- MCP Broker/Router Deployment - Aggregates tools from upstream MCP servers
- MCP Broker/Router Service - Named
mcp-gatewayin the MCPGatewayExtension namespace - HTTPRoute - Named
mcp-gateway-route, routes traffic from the Gateway listener to the broker service for/mcpand/.well-known/oauth-protected-resource. The hostname is derived from the listener (wildcards like*.example.combecomemcp.example.com). This can be disabled by settingspec.httpRouteManagement: Disabledon the MCPGatewayExtension if you need a custom HTTPRoute (e.g. with CORS headers or custom filters). Note: disabling does not delete a previously createdmcp-gateway-route; you must remove it manually - EnvoyFilter - Configures Istio to route requests through the external processor (created in the Gateway's namespace)
- ServiceAccount - For the broker/router pods
- Configuration Secret -
mcp-gateway-configcontaining server configuration
Note: Istio creates the Gateway's Service as type
LoadBalancer. On clusters without a load balancer, its external address stays pending. To useClusterIPinstead (Istio 1.26 or later), create a ConfigMap in the Gateway's namespace and reference it from the Gateway'sspec.infrastructure.parametersRef.If the Gateway already references a ConfigMap through
parametersRef, preserve its configuration instead of running the following commands. If other Gateways share that ConfigMap, copy its data into a new ConfigMap with an unused name and point only this Gateway'sparametersRefto the copy. Then addspec.type: ClusterIPto the selected ConfigMap'sserviceconfiguration, preserving its other settings.Check that
gateway-optionsis unused in the Gateway's namespace. If it exists, choose an unused name and replacegateway-optionsin both commands:kubectl apply -f - <<EOF apiVersion: v1 kind: ConfigMap metadata: name: gateway-options namespace: gateway-system data: service: | spec: type: ClusterIP EOF kubectl patch gateway your-gateway -n gateway-system --type merge \ -p '{"spec":{"infrastructure":{"parametersRef":{"group":"","kind":"ConfigMap","name":"gateway-options"}}}}'Then reach the gateway with
kubectl port-forwardor your own ingress. For example, for an HTTP listener on port8080, run the following and useMCP_URL="http://localhost:8080/mcp"in Verify the Installation:
What the Controller Configures¶
The controller reads the targeted Gateway listener (identified by sectionName) and uses it to configure the broker/router deployment. The following flags are set automatically based on the listener:
| Flag | Value | Source |
|---|---|---|
--mcp-broker-public-address |
0.0.0.0:8080 |
Fixed |
--mcp-gateway-private-host |
<gateway>-<gatewayClassName>.<gateway-namespace>.svc.cluster.local:<listener-port> (with https:// for HTTPS listeners) |
Gateway name, namespace, gatewayClassName, listener port and protocol |
--mcp-gateway-public-host |
Listener hostname (wildcards like *.example.com become mcp.example.com) |
Listener hostname |
--mcp-gateway-config |
/config/config.yaml |
Fixed |
Note: The router authenticates its own hairpin backend-init requests with a short-lived JWT signed by the same HMAC key as client session JWTs (
GATEWAY_SIGNING_KEY). There is no separate router-key secret to manage; the previous--mcp-router-keyflag has been removed.
The --mcp-gateway-private-host flag enables hair-pinning for 2025-11-25 protocol tools/call: the router sends an initialize request back through the gateway to establish a backend session. The port in this address matches the listener port from the Gateway spec. 2026-07-28 calls do not hairpin.
This address is the Service the Gateway controller creates for your Gateway, for example mcp-gateway-istio.gateway-system.svc.cluster.local:8080 for a Gateway named mcp-gateway in gateway-system with class istio and listener port 8080. Setting spec.privateHost on the MCPGatewayExtension overrides it exactly as written, so add https:// yourself for HTTPS listeners.
HTTPS Listeners and caCertBundleRef¶
When the targeted Gateway listener uses HTTPS, the controller automatically prepends https:// to the private host. For 2025-11-25 protocol tools/call, the router hairpins an initialize request back through that listener and verifies the TLS certificate against the target server's HTTPRoute hostname. The listener certificate must cover those hostnames as well as the public endpoint; see HTTPS listener setup.
For listeners using a private CA (e.g. cert-manager with a self-signed CA), include that CA in MCPGatewayExtension.spec.caCertBundleRef. The same bundle is the broker's base trust pool for upstream MCP servers. If the gateway listener CA and upstream CAs differ, concatenate both PEMs in the Secret. See Custom CA Certificates.
2026-07-28 MCP calls do not hairpin; they are routed through Envoy and do not use caCertBundleRef for gateway-listener TLS.
Supported TLS Configurations¶
The gateway uses TLS termination (tls.mode: Terminate) on HTTPS listeners. Envoy decrypts incoming TLS, processes the request (ext_proc, AuthPolicy), then forwards plain HTTP to backends. This affects which backend setups work:
Fully supported — tool discovery and tool calls work:
- HTTP listener → HTTP backend — no TLS involved.
- HTTPS listener → HTTP backend — Envoy terminates client TLS, forwards HTTP to backend. For 2025-11-25 hairpin over a private-CA listener, set
caCertBundleRef. - HTTPS listener → external HTTPS backend (with DestinationRule) — Envoy terminates client TLS, then a DestinationRule configures TLS origination to the external service. See External MCP Servers.
Partial support — tool discovery works, tool calls require additional configuration:
- Any listener → internal HTTPS backend (
caCertSecretRef) — the broker connects directly to the backend using the CA cert, so tool discovery works. However,tools/callis routed through Envoy, which sends plain HTTP to the TLS backend after termination. The backend rejects the non-TLS connection. To enabletools/call, create an Istio DestinationRule with TLS origination for that service — the same pattern used for external MCP servers. See the Istio documentation on destination rule TLS settings for configuringcredentialNamewith a custom CA certificate.
HTTPS listener count¶
With HTTP, multiple listeners can share the same port — the client-facing listener and backend server listeners share a single Envoy route table, so the router can re-route tools/call requests to any backend on the same port.
With HTTPS, each listener gets its own TLS filter chain with an isolated route table (selected by SNI). The router re-routes tools/call by rewriting the :authority header, which can only reach routes within the same filter chain. A backend HTTPRoute on a separate HTTPS listener is unreachable from the client's filter chain. Use a single HTTPS listener with a wildcard hostname for both client and backend traffic. See Configure Gateway Listener and Route for examples.
The --mcp-gateway-public-host flag tells the router which Host header to expect on incoming requests, so it avoids rewriting it during routing.
The EnvoyFilter is configured to intercept traffic on the listener's port and route it through the ext_proc (external processor) running on port 50051.
The configuration secret only contains MCP server entries for MCPServerRegistrations whose HTTPRoutes attach to the same listener. This ensures team isolation when multiple teams share a single Gateway with different listeners.
For full details on all MCPGatewayExtension spec fields, see the MCPGatewayExtension API Reference.
Post-Installation Configuration¶
After installation, the controller automatically creates the HTTPRoute for gateway access. You can connect your MCP servers:
- Register MCP Servers - Connect internal MCP servers
- Connect to External MCP Servers - Connect to external APIs
If you need to customize the HTTPRoute (e.g. add CORS headers), see Configure Gateway Listener and Route.
Verify the Installation¶
After registering at least one MCP server (see Register MCP Servers), check that the gateway serves tool calls end to end.
This procedure requires a server that supports the 2025 protocol family. Servers supporting only 2026-07-28 are not visible to this 2025-11-25 session. See Multi Protocol Support for protocol negotiation and tool visibility.
Set MCP_URL to your Gateway listener's scheme, public hostname and port:
If authentication is enabled, include the credentials required by your policy in every curl request. For bearer tokens, set ACCESS_TOKEN to a valid token and add -H "Authorization: Bearer $ACCESS_TOKEN". See Authentication Configuration.
- Initialize a session with protocol version
2025-11-25and save the session ID:
MCP_HEADERS=$(mktemp)
curl -s -D "$MCP_HEADERS" -X POST "$MCP_URL" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-11-25", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}'
SESSION_ID=$(grep -i "mcp-session-id:" "$MCP_HEADERS" | cut -d' ' -f2 | tr -d '\r')
rm -f "$MCP_HEADERS"
- Check that your MCPServerRegistration is ready:
The READY column should show True.
- List tools:
curl -s -X POST "$MCP_URL" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: $SESSION_ID" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
The response should include your server's tools, prefixed with the prefix from its MCPServerRegistration.
- Call one of those tools. Replace
<tool-name>andargumentswith a prefixed tool from thetools/listresponse and its input (notdiscover_toolsorselect_tools, which the gateway answers itself):
curl -s -w '\nHTTP %{http_code}\n' -X POST "$MCP_URL" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: $SESSION_ID" \
-d '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "<tool-name>", "arguments": {}}}'
The response should contain a result without "isError": true, and end with HTTP 200. Depending on the server, the body comes back as plain JSON or as a data: line in an event stream. If the call fails, note the HTTP status and see tools/list Works but tools/call Fails.
Note: Don't stop at
tools/list. The broker answersinitializeandtools/listitself, so both succeed even when the Gateway listener layout or the private host is wrong.tools/call(likeprompts/getandresources/read) is routed through your server's HTTPRoute, and for2025-11-25sessions the router first hairpins aninitializerequest through the private host. That's why this check uses2025-11-25: with2026-07-28there is no hairpin, so a wrong private host would go unnoticed.
API Reference¶
Optional Configuration¶
- Authentication - Configure OAuth-based authentication
- Authorization - Set up fine-grained access control
- User Based Tool Filtering - Define what tools a client is allowed to see.
- Virtual MCP Servers - Create focused tool collections
- Isolated Gateway Deployment - Multi-instance deployments for team isolation