Chapter 2. Troubleshoot MCP gateway on-premise MCP servers
You can troubleshoot common issues with on-premise Model Context Protocol (MCP) servers when working with the MCP gateway.
2.1. Troubleshoot MCP gateway on-premise MCP servers Copy linkLink copied to clipboard!
You can troubleshoot on-premise MCP servers issues and solve problems when working with the MCP gateway.
2.2. Troubleshoot on-premise MCP server registration issues Copy linkLink copied to clipboard!
When your on-premise MCP server is not discovered by your MCP gateway after you registered the server, or if you are having trouble with your tools, you can troubleshoot by checking for common problems.
Basic steps include making sure that your backend server is available, that routing is applied correctly, and that tool prefix headers are labeled correctly.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. -
You installed the OpenShift CLI (
oc). - You registered an MCP server.
Procedure
If tools from your on-premise MCP server do not display in
tools/list, check that the MCP server is properly discovered by MCP gateway components by running the following commands:List your
MCPServerRegistrationCRs by running the following command:$ oc get mcpsr -AGet the detailed status and configuration of the
MCPServerRegistrationCR that has missing tools by running the following command:$ oc describe mcpserverregistration <mcpsr_name> -n <mcpsr_namespace>-
Replace
<mcpsr_name>with thenameof your MCP server. -
Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.
-
Replace
Verify that the
MCPServerRegistrationCRtargetRefpoints to correctHTTPRoutename and namespace by running the following commands:Get the
nameandnamespaceof theHTTPRouteCR that theMCPServerRegistrationCR is attempting to attach to by running the following command:$ oc get mcpserverregistration <mcpsr_name> -n <mcpsr_namespace> -o jsonpath='{.spec.targetRef.name}{"\n"}{.spec.targetRef.namespace}{"\n"}'-
Replace
<mcpsr_name>with thenameof your MCP server. -
Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.
-
Replace
-
If the
MCPServerRegistrationCR targets theHTTPRouteCR that is applied in the same namespace, the.spec.targetRef.namespaceis not needed. No output is displayed. Cross-reference the
HTTPRoutedetails from of the previous command with yourHTTPRouteCRs by verifying that a route actually exists with those exact details by running the following command:$ oc get httproute <httproute_name> -n <httproute_namespace>-
Replace
<httproute_name>with the value from the output of the earlier step. -
Replace
<httproute_namespace>with the value from the output of the earlier step.
-
Replace
-
If you get a
NotFoundserverErrorfrom the earlier step, correct yourMCPServerRegistrationCR.
Verify that the MCP gateway controller component successfully bound the
MCPGatewayExtensionandHTTPRouteCR together by checking the status with the following command:$ oc get mcpserverregistration <mcpsr_name> -n <mcpsr_namespace> -o jsonpath='{.status.conditions[?(@.type=="Accepted")]}'-
Replace
<mcpsr_name>with the name of your MCP server. Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.-
If you get a
status: Falseoutput, the MCP gateway controller component found the route but could not use it. Check that you created aReferenceGrantCR if theMCPGatewayExtensionandHTTPRouteCRs are in different namespaces.
-
If you get a
-
Replace
Check that the backend MCP server is running by entering the following command:
$ oc get pods -n <mcpsr_namespace>Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.If your MCP server pods are crashing, check for the following conditions:
-
CrashLoopBackOff: This generally means that your MCP server is starting but then crashing. This problem can be caused by a missing environment variable or by permission issues. -
Pending: This might mean that the pod has not started because of a resource issue in the cluster. -
ErrImagePull: Either the cluster cannot reach the registry, or you do not have permission to pull the image. Check your OpenShift Container Platform settings and network configuration. -
If your pod has a
Runningstatus with a high restart count, your MCP server might be unstable because of memory constraints or connectivity issues. Check your OpenShift Container Platform settings and network configuration.
-
Verify that the targeted application of your
MCPServerRegistrationCR actually exists and has a valid entry point by running the following command:$ oc get svc -n <namespace> <service_name>-
Replace
<namespace>with the namespace where your application runs. -
Replace
<service_name>with the name of your application.
-
Replace
-
Check that your application has a standard
ClusterIPassigned to handle load balancing across pods. -
Compare the ports to your
MCPServerRegistrationCR to make sure that they match and that either theTCPorSCTPprotocol is used. Check that the selectors on the
ServiceCR for your application match the labels on your pods by running the following command:$ oc get endpoints <service_name> -n <namespace>-
Replace
<service_name>with the name of your application. -
Replace
<namespace>with the namespace where your application runs.
-
Replace
Check that the attached
HTTPRouteCR has valid backend reference by running the following command:$ oc describe httproute <route_name>
2.3. Troubleshoot on-premise MCP server tools not displaying Copy linkLink copied to clipboard!
When you have confirmed that your MCPServerRegistration CR is active, but your tools are not displaying, you can take some diagnostics steps to find the problem.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. -
You installed the OpenShift CLI (
oc). - You registered an MCP server.
Procedure
Check the MCP broker component router logs for errors by running the following command:
$ oc logs -n <mcp_system> -l app.kubernetes.io/name=<mcp_gateway>-
Replace
<mcp_system>with the namespace of your MCP gateway deployment. -
Replace
<mcp_gateway>with the name of your MCP gateway deployment.
-
Replace
-
If you see errors, check for typos in the
targetRefparameter value and ensure that you are pointing to an existingServiceCR. -
Verify that the backend MCP server is implementing the
tools/listmethod correctly. Using the MCP Inspector is the easiest way to check. - Check your backend MCP server logs for errors.
- Ensure that your backend MCP server is returning valid MCP protocol responses. Using the MCP Conformance Test Framework is the easiest way to catch protocol errors.
-
Verify that the
prefixentry in theMCPServerRegistrationCR is valid, meaning that there are no spaces or special characters. Start a debug session based on your existing MCP server deployment to initiate a backend server test by running the following command:
$ oc debug deployment/<mcpsr_name> -itReplace
<mcpsr_name>with the name of your MCP server.Test whether your backend MCP server is functional by running the following command:
sh-4.4# curl -X POST https://localhost:<port>/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'If the command returns a list of tools, your backend is healthy.
If your backend is healthy but tools are missing in the
GatewayCR, yourMCPServerRegistrationCR is not correctly mapping the service. Check the logs to see why the backend rejected the request by running the following command:$ oc logs -l app=<mcp_server_label>Replace
<mcp_server_label>with the application defined in themetadata.labels.app:section of your MCP serverPodorDeploymentCR.
2.4. Troubleshoot on-premise MCP server tools without prefixes Copy linkLink copied to clipboard!
When your MCP server tools are displayed without configured prefixes, you can troubleshoot by checking for common problems.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. -
You installed the OpenShift CLI (
oc). - You registered an MCP server.
Procedure
Check the
MCPServerRegistrationcustom resource (CR) by running the following command:$ oc get mcpsr <mcpsr_name> -n <mcpsr_namespace> -o yaml | grep prefix-
Replace
<mcpsr_name>with the name of your MCP server. -
Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.
-
Replace
-
Verify that the
prefixentry in theMCPServerRegistrationCR is valid, meaning that there are no spaces or special characters. Check the MCP gateway controller component logs for problems with your
MCPServerRegistrationCR by running the following command:$ oc logs -n <mcp_system> deployment/mcp-gateway-controller | grep prefixReplace
<mcp_system>with the namespace of your MCP gateway deployment.-
If you see
failed to generate prefix, then there is an error in yourMCPServerRegistrationCRmetadataor there is a conflict. -
If there is no output at all, then either the controller is not detecting your
MCPServerRegistrationCR, or the request is failing before it gets to the routing stage.
-
If you see
2.5. Restart the MCP gateway broker component Copy linkLink copied to clipboard!
While you are troubleshooting your on-premise MCP server, you might make changes to your MCPServerRegistration custom resource (CR). To ensure that your changes are applied, you must restart the MCP gateway broker component.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. -
You installed the OpenShift CLI (
oc). - You registered an MCP server.
Procedure
Restart the MCP gateway broker component after making
MCPServerRegistrationCR changes by running the following command:$ oc rollout restart deployment/<mcp_gateway> -n <mcp_system>-
Replace
<mcp_gateway>with the name of your MCP gateway deployment. -
Replace
<mcp_system>with the namespace of your MCP gateway deployment.
-
Replace