Add stdio transport support to client integration test runner#77
Merged
data-douser merged 6 commits intomainfrom Feb 23, 2026
Merged
Conversation
- Update client to support both stdio and http transport modes (MCP_MODE env var, default: stdio) - In stdio mode, client spawns server via StdioClientTransport from MCP SDK - Update run-integration-tests.sh to skip manual server start/stop in stdio mode - Add test:integration:http and test:integration:stdio scripts to client/package.json - Update CI workflow to test both transport modes via matrix strategy - Update docs/testing.md to document stdio as default transport - Update docs/getting-started.md and docs/public.md to recommend VSIX installation Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Add MCP_SERVER_PATH env var support for configuring the server binary path in stdio mode. Update CLI help text to document new environment variables. Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update client integration test runner for MCP server functionality
Add stdio transport support to client integration test runner
Feb 23, 2026
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
stdio transport support to client integration test runner
Bug 1 — CWD mismatch in stdio mode (both platforms): StdioClientTransport inherited the client/ working directory, so relative paths passed to CodeQL CLI (e.g. server/ql/javascript/...) resolved to client/server/ql/... which does not exist. Add cwd: repoRoot to the transport options to match the HTTP-mode behavior where start-server.sh explicitly cd's to the repo root. Bug 2 — False success on Windows in stdio mode: StdioClientTransport.close() could cause an abrupt process exit on Windows before printTestSummary() and process.exit(exitCode) were reached, so the shell script saw exit code 0 and reported success despite test failures. Move summary printing and process.exitCode assignment above the disconnect() call in all four run methods so results are always reported even if disconnect triggers an early exit.
data-douser
approved these changes
Feb 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds dual-transport support to the client-side integration test infrastructure so the existing MCP tool integration tests can run against the server over either stdio (default) or HTTP, and updates CI/docs accordingly (no server tool changes).
Changes:
- Update
client/src/ql-mcp-client.jsto selectStdioClientTransportvsStreamableHTTPClientTransportbased onMCP_MODE(defaulting to stdio) and supportMCP_SERVER_PATHfor stdio runs. - Update the integration test runner script + client package scripts to support explicit
stdio/httpmodes, with lifecycle management differences between transports. - Update GitHub Actions workflow and documentation to reflect stdio as the primary/default transport and recommend VSIX installation.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
client/src/ql-mcp-client.js |
Adds stdio transport support and mode-aware logging/exit flow for integration runs. |
client/scripts/run-integration-tests.sh |
Adds MCP_MODE defaulting to stdio and avoids HTTP server lifecycle steps when running stdio. |
client/package.json |
Adds explicit test:integration:http / test:integration:stdio scripts and aligns monitoring script flags. |
client/src/lib/cli-parser.js |
Documents new env vars (MCP_MODE, MCP_SERVER_PATH, etc.) in CLI help output. |
.github/workflows/client-integration-tests.yml |
Adds a mcp-mode: [http, stdio] matrix and gates HTTP cleanup steps. |
docs/testing.md |
Documents dual transport modes and notes stdio as the default transport for integration tests. |
docs/public.md |
Recommends VSIX/extension installation as the primary path; keeps npm as an alternative. |
docs/getting-started.md |
Clarifies VSIX install steps and reinforces extension-first onboarding. |
.gitignore |
Ignores additional client query output artifacts to prevent accidental commits. |
Collaborator
|
@copilot apply changes based on the comments in this thread |
…warding - Normalize MCP_MODE to lowercase in client constructor so that MCP_MODE=STDIO works the same as MCP_MODE=stdio - Select stdio transport by default; only use HTTP when MCP_MODE === "http" (previously any non-"stdio" value fell through to HTTP) - Add shift 2 in run_tests_in_mode() so mode_name and enable_monitoring positional args are not forwarded to node as extra CLI arguments Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Contributor
Author
Both review comments addressed in 04661fb:
|
data-douser
approved these changes
Feb 23, 2026
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.
Integration Testing Improvement PR: MCP Server Primitives
Related Issue: #76
⚠ Scope Guard: This PR extends beyond
client/integration-tests/**by necessity — the integration test runner infrastructure, CI workflow, and documentation all required updates to support dual-transport testing. No server code changes.Summary
Client integration tests only exercised the HTTP transport, but
stdiois the default (and most common) mode for end users. This PR addsStdioClientTransportsupport to the MCP client so integration tests can run against either transport, defaults everything tostdio, and updates CI to matrix-test both modes. TheMCP_MODEenv var is normalized to lowercase and only an explicit value of"http"triggers HTTP transport — all other values (including typos or case variations) default to stdio, consistent across both the JS client and the bash runner.Primitive Metadata
Test Additions / Modifications
No new test cases — the existing integration tests now run over both transports.
client/src/ql-mcp-client.js:connect()branches onMCP_MODEenv var (normalized to lowercase,stdiodefault). OnlyMCP_MODE=httptriggers HTTP transport; all other values useStdioClientTransport. Server path configurable viaMCP_SERVER_PATH.client/scripts/run-integration-tests.sh: Skips manual server start/stop/wait in stdio mode (client manages lifecycle).MCP_MODEdefaults tostdio. Usesshift 2inrun_tests_in_mode()so internal positional args (mode_name,enable_monitoring) are not forwarded to the node CLI.client/package.json: Addedtest:integration:httpandtest:integration:stdioscripts.client/src/lib/cli-parser.js: Documented new env vars (MCP_MODE,MCP_SERVER_PATH,MCP_SERVER_URL,ENABLE_MONITORING_TOOLS) in help text..github/workflows/client-integration-tests.yml: Addedmcp-mode: [http, stdio]matrix dimension. Server cleanup conditional on HTTP mode.docs/testing.md: Documents stdio as default transport for Layer 2a.docs/getting-started.md,docs/public.md: Recommend VSIX installation as primary method.Before vs After File States
N/A — no fixture file changes. The transport layer is transparent to test assertions.
Assertions Added
Edge & Negative Cases
StdioClientTransportspawns server as child process — if server crashes, transport surfaces the error naturally via MCP SDKmatrix.mcp-mode == 'http'to avoid no-op failures in stdio runsMCP_MODEis case-insensitive:STDIO,Stdio,stdioall resolve to stdio transport; onlyhttp(any case) triggers HTTP — consistent between the JS client and bash runnerNon-Goals / Deferred Follow-ups
session_*tools) unchanged — they work identically over both transportsLocal Verification
CI will validate actual integration test execution over both transports via the updated matrix.
Checklist
client/integration-tests/**primitives/tools/<tool>/<test>/before|after)beforehas matching file inafternpm run lint:fixandnpm run build-and-testsuccessfullyScreenshots / Logs (Optional)
N/A — transport-layer change; no visible output differences.
Additional Notes
The scope guard is intentionally exceeded: this is a test infrastructure change (runner + CI + docs), not a test case change. The
StdioClientTransportimport comes from the existing@modelcontextprotocol/sdkdependency — no new packages added.Maintainers: Reject or request split if scope exceeds integration test boundaries.
Original prompt
stdiomode #76✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.