Chapter 1. Troubleshoot the MCP gateway
You can troubleshoot common issues with solutions when working with the MCP gateway across installation, configuration, and operation.
1.1. Troubleshoot MCP gateway installation Copy linkLink copied to clipboard!
You can troubleshoot installation issues and solve problems when working with the MCP gateway.
1.2. MCP gateway pods not starting Copy linkLink copied to clipboard!
After installation, if your MCP gateway pods are stuck in one of several states that indicate that they are not starting as expected, you can take several steps to diagnose the problem.
Common causes include the following states and indicate an associated action:
-
ImagePullBackOff: Check image repository access and credentials. -
CrashLoopBackOff: Check the logs for application errors. -
Pending: Check resource availability and node capacity. -
Init Container Failure: Check RBAC permissions.
Prerequisites
- You installed MCP gateway.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway.
Procedure
Check the pod status by running the following command:
$ oc get pods -n <mcp_system>Replace
<mcp_system>with the name of the MCP gateway deployment that you are checking.Describe problem pods by running the following command:
$ oc describe pod -n <mcp_system> <pod_name>-
Replace
<mcp_system>with the name of the MCP gateway deployment that you are checking. -
Replace
<pod_name>with the name of the pod that you are checking.
-
Replace
Check the pod logs by running the following command:
$ oc logs -n <mcp_system> <pod_name>-
Replace
<mcp_system>with the name of the MCP gateway deployment that you are checking. -
Replace
<pod_name>with the name of the pod that you are checking.
-
Replace
1.3. Gateway and routing troubleshooting Copy linkLink copied to clipboard!
When traffic is not flowing after you installed MCP gateway, you can investigate each component of the gateway routing to check system health. Depending on the errors you are receiving, you can troubleshoot at several layers. Breaks can occur at the gateway, route, or policy levels.
If you have a Connection Refused/Timeout error and your client cannot reach the IP address, the cause might be the listener. In this case, one of the following situations likely applies:
- The port is not open.
- The load balancer has not assigned an IP address.
- The TLS handshake is failing.
When you have this type of error, check the listener first.
If you can connect to the Gateway object, but you get an HTTP error, such as 404, the cause can be a problem with the HTTPRoute custom resource (CR). The route exists, but the Gateway object has rejected it or the connection has failed. When you get these types of codes, check the HTTPRoute CR first.
If requests either fail with a 503 error or bypass the router, this means that the route is recognized, but the connection to the backend failed or was not authorized properly. In this case, start with API-level checks and narrow your investigation to Envoy filters as needed.
If the EnvoyFilter CR is not present, it usually means one of the following situations has occurred:
-
The
GatewayCR status is notProgrammed. -
There is a
labelsmismatch, and theEnvoyFilterCR is not injected into the pods. - The MCP controller component is crashing or stuck.
1.3.1. Troubleshoot the gateway listener Copy linkLink copied to clipboard!
If your MCP gateway cannot reach an MCP endpoint at the configured hostname, the Listener custom resource (CR) you configured might not be working. You can troubleshoot this situation by using a few commands and some insight.
Use the following concepts with the commands that follow to solve a non-functioning Listener CR:
-
Ensure that your
Gatewayobject hasAcceptedandProgrammedconditions set toTrue. -
Verify that the
hostnameparameter value in theListenerCR matches your DNS or hosts configuration.
Prerequisites
- You installed MCP gateway.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway.
Procedure
Check the general
Gatewayobject configuration by running the following command:$ oc get gateway -AThis command returns general information about all
Gatewayobjects in the cluster. If theGatewayobject you are troubleshooting exists, the command returns the following information:-
The
gatewayClassNameis it using, whether or not it has an IP address or hostname assigned -
The
status, such asReady,Programmed, orPending
-
The
Check the full metadata and status history for a specific
Gatewayobject that is stuck inPendingby running the following command:$ oc describe gateway <gateway_name> -n <gateway_system>-
Replace
<gateway_name>with the name of theGatewayobject. -
Replace
<gateway_system>with the namespace where theGatewayobject is applied.
-
Replace
-
Check for port conflicts and verify that the
SSL/TLScertificates are correctly attached toListenerCRs. Verify the
ListenerCR configuration by running the following command:$ oc get gateway <gateway_name> -n <gateway_system> -o yaml | grep -A 10 listeners-
Replace
<gateway_name>with the name of theGatewayobject. -
Replace
<gateway_system>with the namespace where theGatewayobject is applied.
-
Replace
Check all of your
ListenerCR configurations at the same time by running the following command:$ oc get gateway <gateway_name> -n <gateway_system> -o jsonpath='{range .spec.listeners[*]}{.name}{"\t"}{.hostname}{"\t"}{.port}{"\n"}{end}'-
Replace
<gateway_name>with the name of theGatewayobject. -
Replace
<gateway_system>with the namespace where theGatewayobject is applied.
-
Replace
Check that the Istio gateway pod is running by using the following command:
$ oc get pods -n <gateway_system> -l gateway.istio.io/managed=istio.io-gateway-controller-
Replace
<gateway_system>with the name of yourGatewayobject deployment. - This command checks the status of Envoy-proxy pods and returns pod, traffic flow, and policy errors.
-
Replace
Verify that the port you are trying to use is not already in use by running the following command:
$ oc get gateway -A -o yaml | grep "port:"
1.3.2. Troubleshoot traffic not reaching the backend MCP server Copy linkLink copied to clipboard!
When you are certain that an HTTPRoute custom resource (CR) exists for your application, but traffic is not reaching your backend MCP servers, you can take several steps to troubleshoot the problem.
On the client side, errors such as 401, 403, and 404 can indicate this situation.
Prerequisites
- You installed MCP gateway.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. - You registered an MCP server.
Procedure
Check the
HTTPRoutegeneral custom resource (CR) status by running the following command:$ oc get httproute -A-
This command returns general information about all
HTTPRouteobjects in the cluster.
-
This command returns general information about all
-
Check for the
Acceptedcondition in theHTTPRouteCRstatusfields. Check the full metadata and status history for one specific
HTTPRouteobject by running the following command:$ oc describe httproute <route_name> -n <namespace>-
Replace
<route_name>with the name of theHTTPRouteobject. -
Replace
<namespace>with the namespace where theHTTPRouteobject is applied.
-
Replace
-
Verify that the
hostnamesvalue in theHTTPRouteCR matches the gatewayListenerCRhostname. -
If the
HTTPRoutestatus showsAccepted: False, then theGatewayobject is not using the route. -
If the condition is
ResolvedRefs: False:, the route is accepted through theGatewayobject, but it cannot find the backend MCP service. There might be either a mismatch in the CRmetadata.name:field, or the MCP service is in a namespace theGatewayobject cannot access. Verify the parent reference by running the following command:
$ oc get httproute <route_name> -n <namespace> -o yaml | grep -A 5 parentRefs-
Replace
<route_name>with the name of theHTTPRouteobject. -
Replace
<namespace>with the namespace where theHTTPRouteobject is applied.
-
Replace
-
Ensure that the retrieved
parentRefsvalue matches yourGatewayCR name and namespace exactly. Check that the
allowedRoutes.namespacesvalue in theGatewayCR allows theHTTPRoutenamespace by running the following command:$ oc get gateway <gateway_name> -n <gateway_namespace> -o jsonpath='{range .spec.listeners[*]}{.name}{": "}{.allowedRoutes.namespaces.from}{"\n"}{end}'-
Replace
<gateway_name>with the name of theGatewayobject. -
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied.
-
Replace
1.3.3. Troubleshoot requests failing or bypassing the router Copy linkLink copied to clipboard!
When you are certain that an MCPGatewayExtension custom resource (CR) exists for your MCP server, but requests either fail or bypass the router, it might mean that the EnvoyFilter CR is not applied properly. You can take several steps to troubleshoot the problem.
The EnvoyFilter CR is automatically created in the Gateway CR namespace by the MCP gateway controller component when an MCPGatewayExtension CR is Ready.
You can look closely at the EnvoyFilter CR during deep troubleshooting, but do not manually edit or delete the CR.
Prerequisites
- You installed MCP gateway.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. - You registered an MCP server.
Procedure
Ensure that the
Gatewayobject exists and is in the expected namespace by checking the generalGatewayobject configuration by running the following command:$ oc get gateway -AThis command returns general information about all
Gatewayobjects in the cluster. If theGatewayobject you are troubleshooting exists, the command returns thegatewayClassNameis it using, whether or not it has an IP address or hostname assigned, and astatus, such asReady,Programmed, orPending.Verify that the
MCPGatewayExtensionCR isReadyby running the following command:$ oc get mcpgatewayextension -AVerify that a
ReferenceGrantCR exists if theMCPGatewayExtensionCR is in a different namespace than theGatewayobject by running the following command:$ oc get referencegrant <referencegrant_name> -n <gateway_system> -o yaml-
Replace
<referencegrant_name>with the names of theReferenceGrantCR. -
Replace
<gateway_system>with the namespace where theGatewayobject is applied.
-
Replace
Check the
HTTPRouteCR by running the following command:$ oc describe httproute <httproute_name> -n <httproute_namespace>-
Replace
<httproute_namespace>with the namespace where theHTTPRouteCR is applied. -
Replace
<httproute_name>with the names of theHTTPRouteCR. -
If the
HTTPRouteCR is notAcceptedby theGatewayobject, the route is not programmed into Envoy, causing a404. -
The conditions
Status.Parents.Conditions: Accepted: TrueandProgrammed: Trueshow that the route is correct.
-
Replace
If any of the CRs you just checked are not
Ready, check the controller logs forEnvoyFiltercreation errors by running the following command:$ oc logs -n <mcp_system> deployment/mcp-gateway-controller-
Replace
<mcp_system>with the name of your MCP gateway deployment. - This step verifies that the MCP controller is successfully generating the underlying Istio configurations.
-
Replace
Check that the
EnvoyFilterexists in theGatewaynamespace by running the following command:$ oc get envoyfilter -n <gateway_namespace> -l app.kubernetes.io/managed-by=mcp-gateway-controller-
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied.
-
Replace
Verify the
EnvoyFilterconfiguration by running the following command:$ oc describe envoyfilter -n <gateway_namespace> -l app.kubernetes.io/managed-by=mcp-gateway-controller-
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied. -
The
workloadSelectorlabels must match yourGatewaypods, or your policies are bypassed.
-
Replace
Compare the
EnvoyFilterlabels against your pod labels by running the following command:$ oc get pods -n <gateway_namespace> --show-labels-
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied.
-
Replace
Identify the port that the
Gatewayobject is configured to use by running the following command:$ oc get gateway <gateway_name> -n <gateway_namespace> -o jsonpath='{range .spec.listeners[*]}{.name}{": "}{.port}{"\n"}{end}'-
Replace
<gateway_name>with the name of theGatewayobject. -
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied.
-
Replace
Use the following commands to verify the
EnvoyFilterchain binding:Create a secure tunnel between a port on your computer and a port on the pod by running the following command:
$ oc port-forward deploy/<gateway_deployment_name> -n <gateway_system> 15000:15000-
Replace
<gateway_deployment_name>with the name of the Deployment related to the Gateway object. Typically this value is either<<gateway_name>-istioor<gateway_name>-openshift-default, depending on the ingress you used. Replace
<gateway_system>with the namespace where the Gateway object is applied.From a different terminal window, access localhost:15000 by running the following command:
$ curl -s localhost:15000/listeners
-
If this command returns empty, the
EnvoyFilterCR is not active on this pod. Traffic is bypassing your policies.
-
Replace
Restart the Istio gateway to force a configuration reload by running the following command:
$ oc rollout restart deployment/<gateway_name>-istio -n <gateway_namespace>-
Replace
<gateway_namespace>with the namespace where theGatewayobject is applied. -
Replace
<gateway_name>with the names of theGatewayobject.
-
Replace
1.4. Troubleshoot an MCPGatewayExtension status of not ready Copy linkLink copied to clipboard!
You can troubleshoot when your MCPGatewayExtension custom resource (CR) shows a Ready: False state by running a few commands.
Common causes include the following errors and indicate an associated action:
-
InvalidMCPGatewayExtension: This often means that thetargetRefpoints to a Gateway object that does not exist, or you have a typing error in thekindorgroup. -
ReferenceGrantRequired: This occurs if your extension is in one namespace but is trying to target aGatewayobject in another. To fix this, you must apply aReferenceGrantin theGatewayobject namespace. -
Conflict: Only oneMCPGatewayExtensioncan target a specificGatewayobject. If another extension is already pointing to theGatewayobject you configured with a new extension, the new one fails.
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 status of the specific
MCPGatewayExtensionCR by running the following command:$ oc get mcpgatewayextension -n <namespace>Replace
<namespace>with the namespace where yourMCPGatewayExtensionCR is applied.Check for conflicting
MCPGatewayExtensionCRs by running the following command:$ oc get mcpgatewayextension -AThere must be only one extension per namespace.
Verify that the target Gateway object exists by running the following command:
$ oc get gateway -n <gateway_namespace>Replace
<gateway_namespace>with the namespace where yourGatewayobject is applied.Check the
MCPServerRegistrationCR namespace and route status by running the following command:$ oc describe mcpsr <mcpsr_name> -n <mcpsr_namespace>-
Replace
<mcpsr_name>with the name of yourMCPServerRegistrationCR. -
Replace
<mcpsr_namespace>with the namespace where yourMCPServerRegistrationCR is applied.
-
Replace
-
Ensure that the
MCPGatewayExtensionCR targets theGatewayobject that theHTTPRouteCR is attached to.