Troubleshooting
This guide helps you diagnose and resolve common issues with MCP Gateway.
Enabling Debug Logging
To get more detailed logs, set the LOG_LEVEL environment variable to debug:
apiVersion: mcp-gateway.ohcs.io/v1alpha1
kind: MCPGateway
metadata:
name: my-gateway
spec:
domain: mcp.example.com
env:
- name: LOG_LEVEL
value: debugViewing Logs
Operator Logs
The operator manages CRDs and creates Kubernetes resources:
kubectl logs -l app.kubernetes.io/name=mcp-gateway-operator -n mcp-gateway-systemGateway Logs
The gateway handles MCP request routing:
kubectl logs -l app.kubernetes.io/name=mcp-gatewayTo follow logs in real-time:
kubectl logs -f -l app.kubernetes.io/name=mcp-gatewayCommon Issues
Gateway Not Routing Requests
Symptoms: Requests return 404 or connection refused.
Possible causes:
ConfigMap not synced - The operator may not have updated the gateway ConfigMap yet.
# Check if the ConfigMap exists and has content kubectl get configmap -l app.kubernetes.io/managed-by=mcp-gateway-operatorMCPRemoteServer/MCPContainerServer not ready - Check the status of your server resources:
kubectl get mcpremoteservers,mcpcontainerserversPath mismatch - Ensure the request path matches the
spec.pathin your server resource.
TLS Certificate Issues
Symptoms: Browser shows certificate errors, or curl fails with SSL errors.
Debugging steps:
Check if the certificate Secret exists:
kubectl get secret -l app.kubernetes.io/managed-by=mcp-gateway-operatorIf using cert-manager, check the Certificate resource:
kubectl get certificates kubectl describe certificate <name>Check cert-manager logs for issuance errors:
kubectl logs -l app=cert-manager -n cert-manager
Authentication Failures
Symptoms: Requests return 401 Unauthorized.
Debugging steps:
Verify the auth token Secret exists and has the correct key:
kubectl get secret <auth-secret-name> -o yamlEnsure the MCPGateway references the correct Secret:
kubectl get mcpgateway <name> -o yaml | grep -A2 authSecretRefConfirm the client is sending the correct header:
curl -v -H "Authorization: Bearer <token>" https://mcp.example.com/
Container Server Not Responding
Symptoms: Requests to MCPContainerServer paths timeout or fail.
Debugging steps:
Check if the container pod is running:
kubectl get pods -l app.kubernetes.io/managed-by=mcp-gateway-operatorCheck pod logs for errors:
kubectl logs <pod-name>For STDIO transport, verify the container accepts stdin:
kubectl attach -it <pod-name>For HTTP transport, verify the container is listening on the expected port:
kubectl exec <pod-name> -- netstat -tlnp
Ingress Not Working
Symptoms: External requests don’t reach the gateway.
Debugging steps:
Check Ingress resource status:
kubectl get ingress kubectl describe ingress <gateway-name>Verify the ingress controller is running:
kubectl get pods -n ingress-nginx # or your ingress namespaceCheck if the Service has endpoints:
kubectl get endpoints <gateway-name>
Getting Help
If you’re still experiencing issues:
- Check the GitLab Issues for known problems
- Enable debug logging and collect relevant logs
- Open a new issue with your configuration and logs