Skip to content

feat: add Test connection tab to virtual server details drawer - #76

Open
marekdano wants to merge 2 commits into
mainfrom
5650-virtual-server-test-connection
Open

feat: add Test connection tab to virtual server details drawer#76
marekdano wants to merge 2 commits into
mainfrom
5650-virtual-server-test-connection

Conversation

@marekdano

@marekdano marekdano commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a "Test connection" tab to the virtual server details drawer, running an MCP handshake against the virtual server's own endpoint and surfacing the result - negotiation path, server identity, advertised capabilities, credential source used, and component counts cross-checked against the virtual server's own aggregate (flagged on mismatch).

Closes IBM/mcp-context-forge#5650.

Depends on IBM/mcp-context-forge#6405 (fixes IBM/mcp-context-forge#6370) — the original gateway-scoped POST /v1/mcp-servers/test-handshake endpoint could never succeed for a virtual server, since its SSRF allowlist only ever matches registered-gateway URLs. #6405 adds a virtual-server-scoped POST /v1/virtual-servers/{id}/test-handshake instead: it derives the test target from the server's own ID and dispatches in-process (no SSRF allowlist involved), reusing the caller's own forwarded session/bearer credentials by default. This PR has been updated to call that endpoint. Still opening as draft — #6405 is open but not yet merged, so full manual end-to-end verification against a running backend is still pending.

What's included

  • src/api/virtualServers.tstestVirtualServerHandshake() wrapper for POST /v1/virtual-servers/{id}/test-handshake.
  • src/components/servers/HandshakeTestPanel.tsx — the handshake test panel: read-only endpoint display (the target is now derived server-side from the ID, not caller-supplied, so the URL field is no longer editable), optional header-override form, result rendering (latency, negotiation path, server identity, capabilities, component-count badges with mismatch flagging against the virtual server's aggregate, credential source including the new session source, per-failure-class actionable copy, size-capped raw preview).
  • src/components/gateways/VirtualServerDetailsPanel.tsx — adds the Components / Test connection tab shell (following the #5648 drawer-tab pattern), passes the server's own ID through for the handshake call, and computes+forwards the virtual server's own aggregated tool/resource/prompt counts for mismatch comparison.
  • openapi.json — adds the new POST /v1/virtual-servers/{server_id}/test-handshake path and ServerHandshakeRequest schema, and extends GatewayHandshakeResponse.credentialSource with the new session value, matching #6405's backend schema changes.
  • Tests: HandshakeTestPanel.test.tsx (idle/success/failure/validation/cancel/unmount/capabilities/credential-source/failure-copy/count-mismatch, including a regression case built from a real backend response) and updated cases in VirtualServerDetailsPanel.test.tsx covering the tab wiring against the new endpoint.

Test plan

Screenshots

Screenshot 2026-08-25 at 12 08 20

Signed-off-by: Marek Dano <mk.dano@gmail.com>
… endpoint

IBM/mcp-context-forge#6405 replaces the gateway-scoped test-handshake call
this panel relied on (which could never succeed for a virtual server, per
IBM/mcp-context-forge#6370) with POST /v1/virtual-servers/{id}/test-handshake,
which derives its target from the server's own ID instead of a caller-supplied
URL. Update HandshakeTestPanel to call the new endpoint by server ID, drop the
now-meaningless URL input in favor of a read-only endpoint display, and add
the "session" credential source the new endpoint can report.

Signed-off-by: Marek Dano <mk.dano@gmail.com>
@marekdano
marekdano force-pushed the 5650-virtual-server-test-connection branch from 8ee03ff to e908afd Compare August 25, 2026 11:05
@marekdano
marekdano marked this pull request as ready for review August 25, 2026 11:06
@marekdano

Copy link
Copy Markdown
Contributor Author

This PR can be merged after the PR IBM/mcp-context-forge#6405 is in main

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

Labels

None yet

Projects

None yet

1 participant