Chapter 4. Troubleshoot MCP gateway external MCP servers
You can troubleshoot external MCP server issues and solve problems when working with the MCP gateway.
4.1. Troubleshoot external MCP server connectivity issues Copy linkLink copied to clipboard!
If your external MCP server cannot connect, or if tools are not displaying, you can troubleshoot by checking custom resources (CRs) and network settings.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. - You registered an external MCP server.
-
You created a
SecretCR for authentication.
Procedure
If you are seeing errors such as
502 Bad Gatewayand403 Forbidden, check theServiceEntryCR by running the following command:$ oc get serviceentry -n <namespace>Replace with the
<namespace>where theServiceEntryCR is applied.-
If the command returns an empty list, create a
ServiceEntryCR to allow egress.
-
If the command returns an empty list, create a
For detailed troubleshooting, such as to checks ports and the TLS setting, examine the
ServiceEntryCR activity by running the following command:$ oc describe serviceentry <se_name> -n <namespace>-
Replace with the
<se_name>with the name theServiceEntryCR. -
Replace with the
<namespace>where theServiceEntryCR is applied.
-
Replace with the
-
Verify that
ServiceEntryCRhostsvalues are exact matches externalhostnamevalues. If you are seeing
TLSerrors, verify that aDestinationRuleCR exists by running the following command:$ oc get destinationrule -n <namespace>Replace with the
<namespace>where theDestinationRuleCR is applied.-
If the previous command returns
No resources found in <namespace> namespace, create aDestinationRuleCR. -
Ensure that
DestinationRuleCRhostvalues exactly matchServiceEntryCR host values. -
Check the
TLSconfiguration inDestinationRuleCR.
-
If the previous command returns
For detailed troubleshooting of actual connection details, such as encryption, load balancing, and connection pooling, examine the
DestinationRuleCR by running the following command:$ oc describe destinationrule <dr_name> -n <namespace>-
Replace with the
<dr_name>with the name theDestinationRuleCR. Replace with the
<namespace>where theDestinationRuleCR is applied.- Ensure that your network egress policies allow external traffic from the pod.
-
Replace with the
Test the DNS resolution by running the following command:
$ oc run -it --rm debug --image=<image_path/name> --restart=Never -- \ nslookup <external_hostname>-
Replace
<image_path/name>with the path to your application image. -
Replace
<external_hostname>with your external MCP serverhostnameparameter value.
-
Replace
Test the external connectivity by running the following command:
$ oc run -it --rm debug --image=<image_path/name> --restart=Never -- \ curl -v https://<external_hostname_url>-
Replace
<image_path/name>with the path to your application image. -
Replace
<external_hostname_url>with your external MCP server URL.
-
Replace
-
Verify that the
HTTPRouteCRbackendRefvalue is configured with the correct external hostname. -
Ensure that the
HTTPRouteCR has theURLRewritefilter applied to rewrite to the external hostname.
4.2. Troubleshoot external MCP server authentication issues Copy linkLink copied to clipboard!
If your registered external MCP server fails authentication and returns 401 or 403 errors, troubleshoot by checking the credentials and the logs.
Prerequisites
- You installed MCP gateway.
- You installed Connectivity Link.
-
You installed the OpenShift CLI (
oc). -
You configured a
Gatewayobject. -
You configured an
HTTPRouteobject for the gateway. - You registered an external MCP server.
-
You created a
SecretCR for authentication.
Procedure
Check that a Secret custom resource (CR) exists and that it has the correct
labelby running the following command:$ oc get secret <secret_name> -n <namespace> --show-labels-
Replace
<secret_name>with the name of yourSecretCR. -
Replace
<namespace>with the namespace where yourSecretCR is applied.
-
Replace
Verify the
SecretCR contents by running the following command:$ oc get secret <secret_name> -n <namespace> -o yaml-
Replace
<secret_name>with the name of yourSecretCR. -
Replace
<namespace>with the namespace where yourSecretCR is applied.
-
Replace
Check the
MCPServerRegistrationCRcredentialRefparameter value by running the following command:$ oc get mcpsr <mcpsr_name> -n <namespace> -o yaml | grep -A 3 credentialRef-
Replace
<mcpsr_name>with the name of yourMCPServerRegistrationCR. -
Replace
<namespace>with the namespace where yourMCPServerRegistrationCR is applied.
-
Replace
-
Ensure that the
SecretCR has the labelmcp.kuadrant.io/secret: "true". -
Verify that the
SecretCR data key matches thecredentialRef.keyin theMCPServerRegistrationCR. - Check the credential format.
- Verify that the credential you are using has the necessary permissions for the external service.
Check the MCP gateway broker component logs for credential errors by running the following command:
$ oc logs -n <mcp_system> deployment/mcp-gateway | grep -i authReplace
<mcp_system>with the name of your MCP gateway deployment.