[UI-REWRITE]: Add virtual server drawer Try-it UI - #90
Draft
gandhipratik203 wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Pratik Gandhi <gandhipratik203@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.
Refs IBM/mcp-context-forge#6417
Summary
VITE_ENABLE_VIRTUAL_SERVER_TOOL_TRY_IT=falseand gate the new virtual-server Try-it UI behind it.server_idfor virtual-server scopedtools/call./servers/:id/tools.Notes
Virtual-server Try-it is implemented behind
VITE_ENABLE_VIRTUAL_SERVER_TOOL_TRY_IT=falseby default. Production behavior remains unchanged until the flag is enabled.The frontend currently invokes
tool.nameas the available qualified tool address and follows the existing direct live-invoke cancellation behavior; both are subject to backend confirmation in IBM/mcp-context-forge#6416.Verification
npm testnpm run lintnpm run buildManual verification
Manual test steps
Setup
Save the mock script from the next collapsible at the repo root as
virtual-server-try-it-manual.mjs.Two terminals:
If Vite chooses another port, pass it to the script:
Optional modes:
Terminal B opens a Chrome for Testing window with
/auth/session,/api/rbac/my/permissions,/api/servers,/api/servers/:id,/api/servers/:id/tools, component endpoints,/api/gateways, and/api/rpcmocked. Ctrl-C in terminal B to close. Do everything in that window, in the tab it opens.Steps
1. Open Actions for testVS -> View details.
Expect: the details drawer opens with Components selected.
2. Click Try it.
Expect: Live tool call appears, no Preview button appears, and snippets include
server_id.3. Fill
querywithcloudflareandlimitwith5. Add headerX-Tenant-Idwith valueteam-a, then click Live invoke.Expect: Live invoke 200, Requested through testVS, Answered by github-mcp, and Scoped result for github.search_issues.
4. Inspect Terminal B.
Expect:
/api/rpclogsmethod: "tools/call",params.name: "github.search_issues",params.server_id: "76c7b637dafc4d7197f14817ddffeda9", arguments{ "query": "cloudflare", "limit": 5 }, andx-tenant-id: "team-a".5. Stop Terminal B and rerun with
PERMISSIONS=NO_EXECUTE BASE_URL=http://localhost:5175 node virtual-server-try-it-manual.mjs. Open the drawer and click Try it.Expect: Live invoke requires tools.execute. and the live invoke button is disabled.
6. Stop Terminal B and rerun with
PERMISSIONS=NO_SERVERS_USE BASE_URL=http://localhost:5175 node virtual-server-try-it-manual.mjs. Open the drawer and click Try it.Expect: Live invoke requires servers.use. and the live invoke button is disabled.
7. Stop Terminal B and rerun with
TOOLS=EMPTY BASE_URL=http://localhost:5175 node virtual-server-try-it-manual.mjs. Open the drawer and click Try it.Expect: the Try-it empty state renders from fetched
/servers/:id/tools; it does not fall back toassociatedToolIds.Teardown
Ctrl-C both terminals.
Mock script (virtual-server-try-it-manual.mjs)
Save at the repo root. Requires
@playwright/test, already a dev dependency; runnpx playwright install chromiumif the browser is missing.Manual test results
Latest local manual verification was run against this PR branch on August 30, 2026, using the mock script above and Vite served from the PR checkout with
VITE_ENABLE_VIRTUAL_SERVER_TOOL_TRY_IT=true.node --check virtual-server-try-it-manual.mjsexits cleanly/app/gatewaysand logsvirtual server actions: ok/api/rpcsendsmethod: "tools/call",params.name: "github.search_issues",params.server_id: "76c7b637dafc4d7197f14817ddffeda9", and arguments{ "query": "cloudflare", "limit": 5 }/api/rpcreceivesx-tenant-id: "team-a"Captured
/api/rpcpayload from the passing run:{ "jsonrpc": "2.0", "id": "tool-live-1788096311653", "method": "tools/call", "params": { "name": "github.search_issues", "server_id": "76c7b637dafc4d7197f14817ddffeda9", "arguments": { "query": "cloudflare", "limit": 5 } } }Captured forwarded headers:
{ "x-csrf-token": "mock-csrf-token", "x-tenant-id": "team-a" }Scope of this verification: the manual script is mock-backed. It covers frontend behavior for the virtual-server Try-it tab, fetched attached tools, scoped MCP JSON-RPC payload construction, snippets containing
server_id, passthrough headers, RBAC-gated live invoke states, and rendering of virtual-server/backing-gateway result context. It does not verify execution against a real upstream tool.