MCP profile
The
mcpprofile custom resource definition (CRD) lets you define a Model Context Protocol (MCP) profile on NetScaler® using Kubernetes-native configuration. An MCP profile carries the settings that NetScaler applies when it proxies MCP traffic between your clients and the upstream MCP servers.
You can use the
mcpprofile CRD to:
-
Apply a FRONTEND profile to the client-facing side of the MCP proxy. A FRONTEND profile is attached to a
Gatewaythrough itsspec.infrastructure.parametersReffield. -
Apply a BACKEND profile to the upstream side that connects to the MCP servers. A BACKEND profile is attached to an
mcprouterule through anExtensionReffilter and binds to the backend service group. -
Select the proxy deployment mode:
FORWARD(one NetScaler in the client environment that routes to many MCP servers, selected by a target-server header) orREVERSE(NetScaler in front of a single MCP backend). -
Replace the client
Hostheader and URL with the target MCP server values in forward-proxy deployments. -
Inject the MCP access token as an
Authorizationheader, sourced from a Kubernetes Secret, so that the raw token is never stored in the resource.
Note:
The
profileType value is immutable after the profile is created. For a FRONTEND profile, NetScaler programs only the profileType, proxyMode, and comment values. The remaining settings apply to BACKEND profiles only.
Deploy the mcpprofile CRD
The mcpprofile CRD is in the mcpprofile.yaml file in the NetScaler Ingress Controller GitHub repository. The NetScaler Kubernetes Gateway Controller Helm chart also installs it. Deploy the CRD using the following command:
kubectl create -f https://raw.githubusercontent.com/netscaler/netscaler-k8s-ingress-controller/master/crd/mcp/mcpprofile.yaml
Note:
Do not modify the CRD deployment YAML file.
mcpprofile CRD attributes
The following table lists the top-level attributes available under
spec for the mcpprofile CRD.
| Attribute | Description | Supported values |
|---|---|---|
config |
Contains all the parameters for the MCP profile on NetScaler. This field is required. | Object |
config attributes
The following attributes are available under
spec.config.
| Attribute | Description | Supported values |
|---|---|---|
profileType |
Side of the MCP proxy that this profile applies to. This value is immutable after it is set. | FRONTEND, BACKEND (default BACKEND) |
proxyMode |
Proxy deployment mode. FORWARD places NetScaler in the client environment and routes to many MCP servers through a target-server header. REVERSE places NetScaler in front of a single MCP backend. Applied to both FRONTEND and BACKEND profiles. |
FORWARD, REVERSE (default FORWARD) |
hostReplacement |
Replaces the client Host header with the target MCP server FQDN before forwarding. Applies to forward-proxy BACKEND profiles only, and is ignored when proxyMode is REVERSE. |
ENABLED, DISABLED (default ENABLED) |
urlReplacement |
Rewrites the client URL to the backend MCP URL before forwarding. Applies to forward-proxy BACKEND profiles only, and is ignored when proxyMode is REVERSE. |
ENABLED, DISABLED (default ENABLED) |
insertHeaderInClientRequest |
When ENABLED, NetScaler injects the token from mcpTokenOrApi as an Authorization header on client requests, so that you do not need a rewrite policy that exposes the token. Applies to BACKEND profiles only. |
ENABLED, DISABLED (default DISABLED) |
mcpProtocolVersion |
MCP protocol version that NetScaler advertises when it monitors an MCP server. | String (maximum 10 characters) |
mcpTokenOrApi |
Reference to a Kubernetes Secret that holds the MCP access token. Used for monitoring probes and, when insertHeaderInClientRequest is ENABLED, for client traffic. |
Object |
comment |
Any information about the MCP profile. | String (maximum 255 characters) |
mcpTokenOrApi attributes
The
mcpTokenOrApi object references a Kubernetes Secret. The Secret value must be the full authorization header line, for example Authorization: Bearer <token>.
| Attribute | Description | Supported values |
|---|---|---|
name |
Name of the Kubernetes Secret that contains the token. This field is required. | String of lowercase letters, numbers, and hyphens (-) that starts and ends with a letter or number |
namespace |
Namespace of the Secret. Must be the same namespace as the MCP profile; cross-namespace references are not supported. Defaults to the namespace of the MCP profile. | String of lowercase letters, numbers, and hyphens (-) that starts and ends with a letter or number |
key |
Key within the Secret data that holds the token. | String (default token) |
How to write the profile configuration
In the
mcpprofile YAML definition, set the kind as mcpprofile. In the spec section, add a config block with the settings for the profile.
Keep the following guidelines in mind:
-
Set
profileTypetoBACKEND(the default) for upstream profiles andFRONTENDfor client-facing profiles. -
The
profileTypevalue cannot be changed after the profile is created. -
Set
hostReplacement,urlReplacement, andinsertHeaderInClientRequeston BACKEND profiles only. They apply in forward-proxy mode. -
Store the MCP token in a Kubernetes Secret and reference it through
mcpTokenOrApi. The Secret value is the fullAuthorizationheader line. -
Attach a FRONTEND profile to a
Gatewaythroughspec.infrastructure.parametersRef, and attach a BACKEND profile to anmcprouterule through anExtensionReffilter.
Sample profile configurations
Frontend profile
The following configuration creates a client-facing MCP profile and attaches it to a
Gateway.
apiVersion: citrix.com/v1
kind: mcpprofile
metadata:
name: mcp-frontend
namespace: default
spec:
config:
profileType: FRONTEND
proxyMode: FORWARD
comment: "Client-facing MCP profile"
Attach the profile to a
Gateway through the infrastructure.parametersRef field.
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: mcp-gateway
namespace: default
spec:
gatewayClassName: netscaler-mcp
infrastructure:
parametersRef:
group: citrix.com
kind: mcpprofile
name: mcp-frontend
listeners:
- name: mcp-http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: All
Backend profile with token injection
The following configuration creates a backend MCP profile that injects the MCP token as an
Authorization header. The token is stored in a Kubernetes Secret.
apiVersion: v1
kind: Secret
metadata:
name: github-mcp-token
namespace: default
type: Opaque
stringData:
token: "Authorization: Bearer <your-mcp-access-token>"
---
apiVersion: citrix.com/v1
kind: mcpprofile
metadata:
name: github-mcp-backend
namespace: default
spec:
config:
profileType: BACKEND
proxyMode: FORWARD
urlReplacement: ENABLED
insertHeaderInClientRequest: ENABLED
mcpTokenOrApi:
name: github-mcp-token
key: token
comment: "GitHub MCP backend profile"
Reverse-proxy backend profile
The following configuration creates a backend MCP profile for a deployment where NetScaler is in front of a single MCP server.
apiVersion: citrix.com/v1
kind: mcpprofile
metadata:
name: single-mcp-backend
namespace: default
spec:
config:
profileType: BACKEND
proxyMode: REVERSE
mcpProtocolVersion: "2025-06-18"
comment: "Single upstream MCP server"