You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add stdio transport support to MCP client integration tests
- 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>
2. In VS Code, open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) and
37
+
run **Extensions: Install from VSIX…**.
38
+
3. Select the downloaded `.vsix` file.
39
+
40
+
The extension bundles the MCP server and will register it automatically on
41
+
activation. See the [VS Code Extension guide](./vscode/extension.md) for details.
42
+
43
+
### Alternative: Install the MCP Server (npm)
29
44
30
45
The server is published as a public package on [npmjs.org](https://www.npmjs.com/package/codeql-development-mcp-server). No authentication or special configuration is needed:
The package ships the bundled server (`dist/codeql-development-mcp-server.js`), production dependencies, and the CodeQL tool query source packs (`ql/*/tools/src/`).
The server ships with embedded copies of its tool query packs. If you prefer to manage the packs independently, or want to pin a specific version, download them from GHCR:
Copy file name to clipboardExpand all lines: docs/testing.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,12 +40,14 @@ Unit tests verify the VS Code extension's TypeScript code outside of the Extensi
40
40
41
41
Integration tests exercise individual MCP tools against a live server instance using the custom MCP client.
42
42
43
-
-**Client**: `client/src/ql-mcp-client.js` — starts the MCP server, invokes tools, and validates results.
43
+
-**Client**: `client/src/ql-mcp-client.js` — connects to the MCP server, invokes tools, and validates results.
44
+
-**Transport modes**: The client supports both `stdio` (default) and `http` transport modes, controlled by the `MCP_MODE` environment variable. In `stdio` mode the client spawns the server as a child process via `StdioClientTransport`; in `http` mode it connects to a separately started HTTP server via `StreamableHTTPClientTransport`.
44
45
-**Test data**: `client/integration-tests/primitives/tools/` — each test has `before/` and `after/` directories that define the initial fixture state and, for file-based tests, the expected final state.
45
46
-**Run command**: `npm run test:integration:default -w client` (or `npm run test:client` from the repo root).
46
47
-**Key properties**:
47
48
- Tests are deterministic and repeatable.
48
49
- No mocks — tests use real CodeQL databases and queries bundled under `server/ql/`.
50
+
- The default transport is `stdio`, matching the primary user experience.
49
51
- The `before/monitoring-state.json` file supplies tool arguments. For file-based tests, the integration-test runner diffs filesystem state from `before/` to `after/`; for monitoring-based tests, `after/` artifacts are generally not diffed and are only interpreted for specific validations (for example, `codeql_query_run` interpreted output).
50
52
51
53
### 2b — Extension integration tests
@@ -81,6 +83,7 @@ From the repository root:
81
83
82
84
```bash
83
85
# Build everything and run all layers (1a + 1b + 2a + 2b)
86
+
# Integration tests use stdio transport by default
84
87
npm run build-and-test
85
88
86
89
# Run only server unit tests (1a)
@@ -89,9 +92,13 @@ npm run test:server
89
92
# Run extension unit tests + integration tests (1b + 2b)
90
93
npm run test:vscode
91
94
92
-
# Run only MCP tool integration tests (2a)
95
+
# Run only MCP tool integration tests (2a) - stdio mode (default)
93
96
npm run test:client
94
97
98
+
# Run MCP tool integration tests with explicit transport mode
99
+
MCP_MODE=stdio npm run test:client # stdio transport (default)
100
+
MCP_MODE=http npm run test:client # HTTP transport
0 commit comments