Understand MCP server registration
You must register your Model Context Protocol (MCP) servers so that each server can be discovered and routed to by the MCP gateway.
When you register a backend MCP server, you must define a prefix in the MCPServerRegistration custom resource (CR) for each tool and prompt name. Prefixing each MCP server’s listed capabilities avoids name collisions with other MCP servers.
The MCP gateway then automatically federates the MCP server’s tools and prompts.
To connect an MCP server to the MCP gateway, you must first create an HTTPRoute CR, and then create an MCPServerRegistration CR for the server that references the route.
When a client calls a tool or requests a prompt, the MCP gateway identifies the target upstream server by the prefix, strips the prefix, then routes the request to the correct MCP server with authentication and authorization through an AuthPolicy CR.
Register an MCP server for use with the MCP gateway
Direct your MCP gateway to discover and route to your Model Context Protocol (MCP) servers by registering them.
To connect each MCP server to the MCP gateway, you must first create an HTTPRoute custom resource (CR) that routes to the server. Then, you must create an MCPServerRegistration custom resource (CR) that references the HTTPRoute CR.
-
You installed the MCP gateway.
-
You have a
Gatewayobject configured with your requirements. -
You configured a listener for the MCP gateway.
-
You created an
HTTPRouteCR for the MCP gateway. -
You created and applied an
MCPGatewayExtensionCR. -
If you are using a gateway in a namespace that is different from the one where the
MCPGatewayExtensionCR was applied, you created aReferenceGrantobject. -
You are logged into an OpenShift Container Platform cluster with an
adminrole.
-
Create an
HTTPRouteCR that routes to your MCP server by using the following template:ExampleHTTPRouteCRapiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: <mcp_api_key_server_route> namespace: <mcp_test> labels: mcp-server: 'true' spec: parentRefs: - name: <mcp_gateway> namespace: <gateway_system> hostnames: - 'api-key-server.mcp.local' rules: - matches: - path: type: PathPrefix value: / backendRefs: - name: <mcp_api_key_server> port: 9090-
For the
metadata.name:parameter value, replace<mcp_api_key_server_route>with the name of the http route. -
For the
metadata.namespace:parameter value, replace<mcp_test>with the namespace you need to use. TheHTTPRouteCR must be in the same namespace as theMCPServerRegistrationCR unlesstargetRef.namespaceis set in theMCPServerRegistrationCR. -
For the
spec.parentRefs.name:andspec.parentRefs.namespace:parameter values, use the values from theGatewayCR that you are targeting. -
For the
spec.hostnames:parameter value, replace the list with your required internal routing hostname. -
For the
spec.rules.backendRefs.name:parameter value, replace<mcp_api_key_server>with your MCP gateway service name. -
For the
spec.rules.backendRefs.port:parameter value, replace9090with your MCP server port.
-
-
Apply the CR by running the following command:
$ oc apply -f <mcp_api_key_server_route.yaml>Replace
<mcp_api_key_server_route.yaml>with the name of the http route you created. -
Create an
MCPServerRegistrationCR that references yourHTTPRouteCR by using the following template:ExampleMCPServerRegistrationCRapiVersion: mcp.kuadrant.io/v1alpha1 kind: MCPServerRegistration metadata: name: <mcp_server_one> namespace: <mcp_test> spec: prefix: <serverone>_ targetRef: group: "gateway.networking.k8s.io" kind: "HTTPRoute" name: "<mcp_api_key_server_route>" namespace: "<mcp_test>" credentialRef: name: <mcp_server_one_secret> key: api-key-
Replace the
metadata.name:andmetadata.namespace:field values with the ones you want to use. If you did not use aReferenceGrantCR, the value ofmetadata.namespace:must be the same as specified in theHTTPRouteobject. -
Replace the
spec.prefix:field with the value that you want to prefix the tools available with this MCP server. -
Replace the
spec.targetRef.name fieldvalue with the name of theHTTPRouteCR you applied. In this example,<mcp_api_key_server_route>is used. -
Replace the
spec.targetRef.namespace:field value with the namespace where yourHTTPRouteCR is applied. In this example,<mcp_test>is used. -
Replace the
credentialRef.name:field value with the name of yourSecretCR. In this example,<mcp_server_one_secret>is used. You can omit this parameter if your MCP server does not require authentication or authorization. -
For more information about these parameters, see "Understanding the
MCPServerRegistrationcustom resource."ImportantThe
prefixfield only accepts lowercase letters (a-z), digits (0-9), and underscores (_). The value must start with a letter or digit. This is enforced at the CRD schema level.Existing
MCPServerRegistrationCRs with non-conforming prefixes continue to function but cannot be updated. To update such resources, delete and re-create them with a conforming prefix.
-
-
Apply the CR by running the following command:
$ oc apply -f <mcp_server_one.yaml>Replace
<mcp_server_one.yaml>with yourMCPServerRegistrationCR. -
Check the status of your current
MCPServerRegistrationCR by running the following command:$ oc get mcpsr -n <mcp_server_one>Replace
<mcp_server_one>with thenameof yourMCPServerRegistrationCR.Example outputNAMESPACE NAME PREFIX TARGET PATH READY TOOLS CREDENTIALS AGE mcp-test my-mcp-server myserver_ mcp-api-key-server-route /mcp True 4 30s -
Check the status of all
MCPServerRegistrationCRs in the cluster by running the following command:$ oc get mcpsr -AExample outputNAMESPACE NAME PREFIX TARGET PATH READY TOOLS CREDENTIALS AGE mcp-test mcp-server-one serverone mcp-api-key-server /mcp True 4 14m mcp-test mcp-server-two servertwo mcp-generic-route /mcp True 7 2d mcp-prod analytics-tools stats analytics-route /mcp True 3 5h -
Check on tool discovery status by running the following command:
$ oc get mcpsr -A -o yamlExample outputapiVersion: v1 items: - apiVersion: mcp.kuadrant.io/v1alpha1 kind: MCPServerRegistration metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"mcp.kuadrant.io/v1alpha1","kind":"MCPServerRegistration","metadata":{"annotations":{},"labels":{"mcp.kuadrant.io/managed":"true"},"name":"test-server1","namespace":"mcp-test"},"spec":{"targetRef":{"group":"gateway.networking.k8s.io","kind":"HTTPRoute","name":"mcp-server1-route"},"prefix":"test1_"}} creationTimestamp: "2026-03-31T09:50:26Z" finalizers: - mcp.kuadrant.io/finalizer generation: 1 labels: mcp.kuadrant.io/managed: "true" name: test-server1 namespace: mcp-test resourceVersion: "302234" uid: d9603011-2e0f-4f3f-88d6-eda986f365d1 spec: path: /mcp targetRef: group: gateway.networking.k8s.io kind: HTTPRoute name: mcp-server1-route prefix: test1_ status: conditions: - lastTransitionTime: "2026-04-07T08:49:53Z" message: server added successfully. Total tools added 5 reason: Ready status: "True" type: Ready discoveredTools: 5 kind: List metadata: resourceVersion: "When you examine the
statusblock fordiscoveredTools, you can see that thestatus.conditions:fields show that an MCP server is present and that tools are available and ready.
Understand the MCPServerRegistration custom resource
You can explore the required parts and values for an MCPServerRegistration custom resource (CR) by studying the references contained here.
| Field | Type | Required | Description |
|---|---|---|---|
|
MCPServerRegistrationSpec |
Yes |
The specification for the |
|
MCPServerRegistrationStatus |
No |
The status for the CR |
| Field | Type | Required | Description |
|---|---|---|---|
|
TargetReference |
Yes |
An |
|
String |
No |
The prefix added to all consolidated tools from referenced servers. Avoids naming conflicts when aggregating tools from multiple sources, such as |
|
String |
No |
The URL path where the MCP server endpoint is exposed. Default value is |
|
SecretReference |
No |
Reference to a |
| Field | Type | Required | Description |
|---|---|---|---|
|
String |
No |
Group of the target resource. Default value is |
|
String |
No |
Kind of the target resource. Default value is |
|
String |
Yes |
Name of the target |
|
String |
No |
Namespace of the target resource. Defaults to same namespace. |
| Field | Type | Required | Description |
|---|---|---|---|
|
String |
Yes |
Name of the |
|
String |
No |
Key within the |
| Field | Type | Description |
|---|---|---|
|
List of conditions that define the status of the Kubernetes resource. |
|
|
Integer |
Number of tools discovered from this |
Verify an MCP server registration
You can test that your Model Context Protocol (MCP) server tools are available through the MCP gateway by starting a session and listing available tools and prompts.
-
You completed all MCP gateway installation and configuration steps.
-
You registered the MCP server you want to verify.
-
Connect to the MCP gateway and initialize a session to dump response headers to a file by running the following command:
$ curl -s -D /tmp/mcp_headers -X POST http://_<example.com>_/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-11-25", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}'Replace
<example.com>with your URL and port. -
Extract the MCP session ID from the dumped response headers by running the following command:
$ SESSION_ID=$(grep -i "mcp-session-id:" /tmp/mcp_headers | cut -d' ' -f2 | tr -d '\r') \ echo "MCP Session ID: $SESSION_ID" -
List the tools using the session ID by running the following command:
$ curl -X POST http://<example.com>/mcp \ -H "Content-Type: application/json" \ -H "mcp-session-id: $SESSION_ID" \ -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'Replace
<example.com>with your URL and port. -
Expected output: Your MCP server tools are listed in the response, prefixed with the
prefixvalue you configured in theMCPServerRegistrationCR. -
Verify that your MCP server prompts are also available by running the following command:
# Use the same SESSION_ID from the previous step curl -X POST http://_<example.com>_/mcp \ -H "Content-Type: application/json" \ -H "mcp-session-id: $SESSION_ID" \ -d '{"jsonrpc": "2.0", "id": 3, "method": "prompts/list"}'Replace
<example.com>with your URL and port. -
Expected output: Your MCP server prompts are listed in the response and are prefixed with the
prefixvalue you configured in theMCPServerRegistrationCR. -
Retrieve a specific prompt by using the
prompts/getmethod with the prefixed name as shown in the following command:$ curl -X POST http://_<example.com>_/mcp \ -H "Content-Type: application/json" \ -H "mcp-session-id: $SESSION_ID" \ -d '{ "jsonrpc": "2.0", "id": 4, "method": "prompts/get", "params": { "name": "myserver_gh_pr_review", "arguments": { "pr_number": "42" } } }'Replace
<example.com>with your URL and port. -
Clean up by running the following command:
$ rm -f /tmp/mcp_headers