feat: add MCP handshake test mode to Test Connection - #16
Open
Altamimi-Dev wants to merge 1 commit into
Open
Conversation
UI half of the MCP handshake test, split out of IBM/mcp-context-forge#5934 now that the client lives in this repo. Test Connection gains a mode toggle. HTTP request keeps the existing raw-request behavior; MCP handshake calls the new POST /v1/mcp-servers/test-handshake and reports whether the target actually speaks MCP: - Detail rows for server name/version, protocol version, negotiation path (server/discover or initialize) and credential source - Count badges for first-page tools/resources/prompts, rendered as "3+ tools" when countsPartial marks the listing truncated - A failure-class badge (transport / protocol negotiation / authentication / invalid response) with the backend's actionable copy - A collapsible raw-response preview - Method, content type and body inputs are hidden in handshake mode; the in-flight request is aborted on unmount, cancel, and mode switch New user-facing copy goes through react-intl, with keys added to the en-US, es-ES and pt-BR mcpServer namespaces. The en-US messages are byte-identical to the strings they replace. Component counts use ICU plural forms. openapi.json gains only the new /v1/mcp-servers/test-handshake path plus the GatewayHandshakeRequest/GatewayHandshakeResponse schemas, extracted from the gateway's app.openapi(). The snapshot stays pinned at API v1.0.7 otherwise, so the generated types pick up the handshake endpoint without dragging in unrelated spec drift. Relates to IBM/mcp-context-forge#5649 Signed-off-by: Ahmad Al Tamimi <altamimi.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on IBM/mcp-context-forge#5934
Summary
UI half of the MCP handshake test, split out of IBM/mcp-context-forge#5934 now that the client lives in this repo — same pattern as #15.
Test Connection currently only proves a URL answers HTTP. This adds a second mode that proves the target actually speaks MCP.
HTTP requestkeeps the existing raw-request behavior;MCP handshakecalls the newPOST /v1/mcp-servers/test-handshake. Method, content type and body inputs are hidden in handshake mode since they don't apply.server/discoverorinitialize), and credential source (stored server credentials / form headers / none).3+ toolswhen the backend'scountsPartialflags a truncated listing (nextCursorpresent).i18n
All new user-facing copy goes through
react-intl(useIntl+intl.formatMessage), with keys added to themcpServernamespace for en-US, es-ES and pt-BR. The en-US messages are byte-identical to the inline strings they replace, so the ported tests assert unchanged output. Component counts use ICU plural forms ({count, plural, one {# tool} other {# tools}}).Two things stayed inline deliberately:
Latency: … msline — identical to the adjacent HTTP-mode line, which is not localized yet. Worth migrating together when this file gets a full localization pass rather than localizing one of the pair.server/discoverandinitialize— protocol identifiers, not prose.openapi.json
The snapshot gained only
.paths."/v1/mcp-servers/test-handshake"plus theGatewayHandshakeRequest/GatewayHandshakeResponseschemas, extracted from the gateway'sapp.openapi()on the #5934 branch. Everything else is untouched and the spec stays pinned atAPI v1.0.7— a wholesale regen would pull in unrelated main-side drift ahead of the next version bump. All$refs in the added fragment (HTTPValidationError) already existed in the snapshot.npm run generatepicks up the new endpoint and emits the handshake types.Verification
npm run generate— orval emitsGatewayHandshakeRequest/GatewayHandshakeResponsetypesnpm run test— 2821 passed, 1 skipped (157 files);TestConnectionPanel.test.tsxalone is 32 passed, including the 10 new handshake tests (mode switch, success detail rows,countsPartialbadge, all four failure classes, abort-on-unmount, error-clearing on mode switch)npm run lintandnpm run format:check— cleannpm run build— generate +tsc -b+ vite build cleangit diff --numstat openapi.json—280 0, purely additiveOne note:
npm run i18n:compilefails on this branch, but it fails identically on an untouched checkout ofmain(Error: No JSON file found in src/i18n/locales—compile-folderis pointed at the parent directory rather than the per-locale directories). Pre-existing, and happy to fix it in a separate PR if that's useful.Relates to IBM/mcp-context-forge#5649 — the backend half is IBM/mcp-context-forge#5934; together they complete the issue.