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

You can troubleshoot installation issues and solve problems when working with the MCP gateway.

1.2. MCP gateway pods not starting

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 Gateway object.
  • You configured an HTTPRoute object for the gateway.

Procedure

  1. 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.

  2. 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.
  3. 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.

1.3. Gateway and routing troubleshooting

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 Gateway CR status is not Programmed.
  • There is a labels mismatch, and the EnvoyFilter CR is not injected into the pods.
  • The MCP controller component is crashing or stuck.

1.3.1. Troubleshoot the gateway listener

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 Gateway object has Accepted and Programmed conditions set to True.
  • Verify that the hostname parameter value in the Listener CR matches your DNS or hosts configuration.

Prerequisites

  • You installed MCP gateway.
  • You installed the OpenShift CLI (oc).
  • You configured a Gateway object.
  • You configured an HTTPRoute object for the gateway.

Procedure

  1. Check the general Gateway object configuration by running the following command:

    $ oc get gateway -A

    This command returns general information about all Gateway objects in the cluster. If the Gateway object you are troubleshooting exists, the command returns the following information:

    • The gatewayClassName is it using, whether or not it has an IP address or hostname assigned
    • The status, such as Ready, Programmed, or Pending
  2. Check the full metadata and status history for a specific Gateway object that is stuck in Pending by running the following command:

    $ oc describe gateway <gateway_name> -n <gateway_system>
    • Replace <gateway_name> with the name of the Gateway object.
    • Replace <gateway_system> with the namespace where the Gateway object is applied.
  3. Check for port conflicts and verify that the SSL/TLS certificates are correctly attached to Listener CRs.
  4. Verify the Listener CR 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 the Gateway object.
    • Replace <gateway_system> with the namespace where the Gateway object is applied.
  5. Check all of your Listener CR 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 the Gateway object.
    • Replace <gateway_system> with the namespace where the Gateway object is applied.
  6. 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 your Gateway object deployment.
    • This command checks the status of Envoy-proxy pods and returns pod, traffic flow, and policy errors.
  7. 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:"

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 Gateway object.
  • You configured an HTTPRoute object for the gateway.
  • You registered an MCP server.

Procedure

  1. Check the HTTPRoute general custom resource (CR) status by running the following command:

    $ oc get httproute -A
    • This command returns general information about all HTTPRoute objects in the cluster.
  2. Check for the Accepted condition in the HTTPRoute CR status fields.
  3. Check the full metadata and status history for one specific HTTPRoute object by running the following command:

    $ oc describe httproute <route_name> -n <namespace>
    • Replace <route_name> with the name of the HTTPRoute object.
    • Replace <namespace> with the namespace where the HTTPRoute object is applied.
  4. Verify that the hostnames value in the HTTPRoute CR matches the gateway Listener CR hostname.
  5. If the HTTPRoute status shows Accepted: False, then the Gateway object is not using the route.
  6. If the condition is ResolvedRefs: False:, the route is accepted through the Gateway object, but it cannot find the backend MCP service. There might be either a mismatch in the CR metadata.name: field, or the MCP service is in a namespace the Gateway object cannot access.
  7. 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 the HTTPRoute object.
    • Replace <namespace> with the namespace where the HTTPRoute object is applied.
  8. Ensure that the retrieved parentRefs value matches your Gateway CR name and namespace exactly.
  9. Check that the allowedRoutes.namespaces value in the Gateway CR allows the HTTPRoute namespace 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 the Gateway object.
    • Replace <gateway_namespace> with the namespace where the Gateway object is applied.

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.

Important

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 Gateway object.
  • You configured an HTTPRoute object for the gateway.
  • You registered an MCP server.

Procedure

  1. Ensure that the Gateway object exists and is in the expected namespace by checking the general Gateway object configuration by running the following command:

    $ oc get gateway -A

    This command returns general information about all Gateway objects in the cluster. If the Gateway object you are troubleshooting exists, the command returns the gatewayClassName is it using, whether or not it has an IP address or hostname assigned, and a status, such as Ready, Programmed, or Pending.

  2. Verify that the MCPGatewayExtension CR is Ready by running the following command:

    $ oc get mcpgatewayextension -A
  3. Verify that a ReferenceGrant CR exists if the MCPGatewayExtension CR is in a different namespace than the Gateway object by running the following command:

    $ oc get referencegrant <referencegrant_name> -n <gateway_system> -o yaml
    • Replace <referencegrant_name> with the names of the ReferenceGrant CR.
    • Replace <gateway_system> with the namespace where the Gateway object is applied.
  4. Check the HTTPRoute CR by running the following command:

    $ oc describe httproute <httproute_name> -n <httproute_namespace>
    • Replace <httproute_namespace> with the namespace where the HTTPRoute CR is applied.
    • Replace <httproute_name> with the names of the HTTPRoute CR.
    • If the HTTPRoute CR is not Accepted by the Gateway object, the route is not programmed into Envoy, causing a 404.
    • The conditions Status.Parents.Conditions: Accepted: True and Programmed: True show that the route is correct.
  5. If any of the CRs you just checked are not Ready, check the controller logs for EnvoyFilter creation 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.
  6. Check that the EnvoyFilter exists in the Gateway namespace 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 the Gateway object is applied.
  7. Verify the EnvoyFilter configuration 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 the Gateway object is applied.
    • The workloadSelector labels must match your Gateway pods, or your policies are bypassed.
  8. Compare the EnvoyFilter labels against your pod labels by running the following command:

    $ oc get pods -n <gateway_namespace> --show-labels
    • Replace <gateway_namespace> with the namespace where the Gateway object is applied.
  9. Identify the port that the Gateway object 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 the Gateway object.
    • Replace <gateway_namespace> with the namespace where the Gateway object is applied.
  10. Use the following commands to verify the EnvoyFilter chain binding:

    1. 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>-istio or <gateway_name>-openshift-default, depending on the ingress you used.
      • Replace <gateway_system> with the namespace where the Gateway object is applied.

        1. From a different terminal window, access localhost:15000 by running the following command:

          $ curl -s localhost:15000/listeners
      • If this command returns empty, the EnvoyFilter CR is not active on this pod. Traffic is bypassing your policies.
  11. 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 the Gateway object is applied.
    • Replace <gateway_name> with the names of the Gateway object.

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 the targetRef points to a Gateway object that does not exist, or you have a typing error in the kind or group.
  • ReferenceGrantRequired: This occurs if your extension is in one namespace but is trying to target a Gateway object in another. To fix this, you must apply a ReferenceGrant in the Gateway object namespace.
  • Conflict: Only one MCPGatewayExtension can target a specific Gateway object. If another extension is already pointing to the Gateway object you configured with a new extension, the new one fails.

Prerequisites

  • You installed MCP gateway.
  • You installed Connectivity Link.
  • You configured a Gateway object.
  • You configured an HTTPRoute object for the gateway.
  • You installed the OpenShift CLI (oc).
  • You registered an MCP server.

Procedure

  1. Check the status of the specific MCPGatewayExtension CR by running the following command:

    $ oc get mcpgatewayextension -n <namespace>

    Replace <namespace> with the namespace where your MCPGatewayExtension CR is applied.

  2. Check for conflicting MCPGatewayExtension CRs by running the following command:

    $ oc get mcpgatewayextension -A

    There must be only one extension per namespace.

  3. 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 your Gateway object is applied.

  4. Check the MCPServerRegistration CR namespace and route status by running the following command:

    $ oc describe mcpsr <mcpsr_name> -n <mcpsr_namespace>
    • Replace <mcpsr_name> with the name of your MCPServerRegistration CR.
    • Replace <mcpsr_namespace> with the namespace where your MCPServerRegistration CR is applied.
  5. Ensure that the MCPGatewayExtension CR targets the Gateway object that the HTTPRoute CR is attached to.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top