Skip to content

🐛 Cannot connect to MCP inspector through Kagenti #718

Closed

Description

@evaline-ju

Describe the bug

When I try to open MCP inspector through Kagenti's MCP gateway tab, I see "Connection Error - Did you add the proxy session token in Configuration?" as in the screenshot
Image

I had done the installation at kagenti commit 160f5aa0334ae3de82f283edf46d87f95aeea013. This still leverages v0.4 of the MCP gateway.

Steps To Reproduce

  1. Open Kagenti UI
  2. Navigate to the MCP gateway tab: http://kagenti-ui.localtest.me:8080/mcp-gateway
  3. Click on "Open MCP inspector": http://mcp-inspector.localtest.me:8080/?serverUrl=http%3A%2F%2Fmcp-gateway-istio.gateway-system.svc.cluster.local%3A8080%2Fmcp&transport=streamable-http

Note: I did not change any URLs to leverage the MCP gateway URLs yet

Expected Behavior

Can connect to and use the MCP inspector, and interact with tools if the MCP gateway is leveraged

Additional Context

No response

Activity

  1. added
    bug
    on Feb 18, 2026
  2. pdettori commented on Feb 18, 2026

    @pdettori
    Member

    Root Cause Analysis

    Summary

    The MCP Inspector cannot connect to the MCP gateway because commit 68d2252 ("Let MCP Gateway share the Kagenti Gateway") moved the mcp-route HTTPRoute's parentRef from the dedicated mcp-gateway to the shared http gateway. This left the mcp-gateway Envoy with no backend routes, so all requests through it fail.

    Request flow (broken)

    MCP Inspector proxy
      → mcp-gateway-istio.gateway-system.svc.cluster.local:8080/mcp
        → Envoy ext_proc (mcp-gateway-broker-router) processes request:
          ✅ Rewrites :authority to mcp.127-0-0-1.sslip.io
          ✅ Sets x-mcp-method and x-mcp-servername headers
          ✅ Clears route cache
        → Envoy re-evaluates routing
        → ❌ No HTTPRoute attached to mcp-gateway → 404 / connection reset
          → ext_proc stream canceled ("rpc error: code = Canceled desc = context canceled")
            → MCP Inspector shows "Connection Error"
    

    The breaking change

    In charts/kagenti/templates/mcp-gateway.yaml, the mcp-route HTTPRoute parentRef was changed from:

    parentRefs:
      - name: mcp-gateway
        namespace: "{{ .Values.mcpGateway.namespaces.gatewaySystem }}"

    to:

    parentRefs:
      - name: http
        namespace: kagenti-system

    This means the route now only applies to the shared http gateway (http-istio service in kagenti-system), while the dedicated mcp-gateway (mcp-gateway-istio service in gateway-system) has zero routes attached.

    Evidence from cluster inspection

    Broker logs (mcp-gateway-broker-router) show requests are received and processed by the ext_proc, but every request ends with:

    [ext_proc] Process: Error receiving request  error="rpc error: code = Canceled desc = context canceled"
    

    Envoy logs (mcp-gateway-istio) confirm:

    envoy ext_proc: Received gRPC error on stream: 14, message upstream connect error or disconnect/reset before headers.
      reset reason: connection termination{upstream_reset_before_response_started{connection_termination}}
    

    Connectivity tests from inside the cluster:

    Target Result
    mcp-gateway-istio:8080/mcp (no Host header) HTTP 404
    mcp-gateway-istio:8080/mcp (Host: mcp.127-0-0-1.sslip.io) HTTP 404
    http-istio:80/mcp (Host: mcp.127-0-0-1.sslip.io) HTTP 503 (upstream reset)
    mcp-gateway-broker:8080/mcp (direct) Connection reset by peer

    The HTTP 503 on the http gateway path suggests the broker also has issues receiving direct HTTP connections (likely expects traffic through the ext_proc/Envoy pipeline, not raw HTTP).

    Proposed fix

    Add the mcp-gateway back as a second parentRef to the mcp-route, so the route is attached to both gateways:

    parentRefs:
      - name: http
        namespace: kagenti-system
      - name: mcp-gateway
        namespace: "{{ .Values.mcpGateway.namespaces.gatewaySystem }}"

    This preserves the "share the Kagenti Gateway" intent from 68d2252 while restoring the dedicated mcp-gateway routing that the MCP Inspector relies on.

  3. added a commit that references this issue on Feb 18, 2026
    60471c8
  4. self-assigned this
    on Feb 19, 2026
  5. esnible commented on Feb 19, 2026

    @esnible
    Member

    @evaline-ju I am researching the problem.

    From outside the cluster, I have no problem with curl to http://mcp.127-0-0-1.sslip.io:8080/mcp .
    From inside the cluster, I have no problem with curl to http://mcp-gateway-istio.gateway-system.svc.cluster.local:8080/mcp

    From Kagenti MCP Inspector http://mcp-inspector.localtest.me:8080/ there are four cases to consider:

    The proxy is not reachable! The browser is trying to talk to 6277, but nothing is listening on that port. There are no HTTPRoutes to that port.

    I experimented with creating an HTTPRoute to the mcp-inspector's proxy port. Then I expanded the MCP Inspector's config, and set the Inspector Proxy Address to a new HTTPRoute, mcp-inspector-proxy.localtest.me:8080, and it worked fine.

    Would it make sense to expose a HTTPRoute for MCP Inspector's proxy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions