Replace JavaScript client with Go binary and integration test runner#221
Merged
data-douser merged 5 commits intodd/ql-mcp-client/2from Apr 6, 2026
Merged
Conversation
Closed
23 tasks
- Remove client/src/ directory with all JS files (ql-mcp-client.js and 14 library modules) - Remove client/package.json and client/eslint.config.mjs - Add Go module (go.mod, go.sum) with cobra and mcp-go dependencies - Add CLI entry point (main.go) and root Cobra command (cmd/root.go) - Add CLI helpers (cmd/helpers.go) and integration test command (cmd/integration_tests.go) - Add MCP client library (internal/mcp/client.go) with stdio and HTTP transport - Add integration test runner (internal/testing/runner.go, params.go) - Add comprehensive unit tests for all packages (16 tests, all passing) - Update Makefile to remove go.mod guards (Go source now available) - Update run-integration-tests.sh to build and use Go binary - Update test-config.json logDir paths for custom_log_directory tests Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove JavaScript client and supporting library
Replace JavaScript client with Go binary and integration test runner
Apr 6, 2026
data-douser
reviewed
Apr 6, 2026
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/86c1cb26-2977-409f-ace0-aabc4fc9cee7 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
data-douser
added a commit
that referenced
this pull request
Apr 7, 2026
…221) * Initial plan * Replace JavaScript client with Go binary and integration test runner - Remove client/src/ directory with all JS files (ql-mcp-client.js and 14 library modules) - Remove client/package.json and client/eslint.config.mjs - Add Go module (go.mod, go.sum) with cobra and mcp-go dependencies - Add CLI entry point (main.go) and root Cobra command (cmd/root.go) - Add CLI helpers (cmd/helpers.go) and integration test command (cmd/integration_tests.go) - Add MCP client library (internal/mcp/client.go) with stdio and HTTP transport - Add integration test runner (internal/testing/runner.go, params.go) - Add comprehensive unit tests for all packages (16 tests, all passing) - Update Makefile to remove go.mod guards (Go source now available) - Update run-integration-tests.sh to build and use Go binary - Update test-config.json logDir paths for custom_log_directory tests Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Final validation complete Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert unrelated go.mod changes in server/ql/go/tools/test/ Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Replace actual repo reference with placeholder in helpers_test.go Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/86c1cb26-2977-409f-ace0-aabc4fc9cee7 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
data-douser
added a commit
that referenced
this pull request
Apr 7, 2026
…221) * Initial plan * Replace JavaScript client with Go binary and integration test runner - Remove client/src/ directory with all JS files (ql-mcp-client.js and 14 library modules) - Remove client/package.json and client/eslint.config.mjs - Add Go module (go.mod, go.sum) with cobra and mcp-go dependencies - Add CLI entry point (main.go) and root Cobra command (cmd/root.go) - Add CLI helpers (cmd/helpers.go) and integration test command (cmd/integration_tests.go) - Add MCP client library (internal/mcp/client.go) with stdio and HTTP transport - Add integration test runner (internal/testing/runner.go, params.go) - Add comprehensive unit tests for all packages (16 tests, all passing) - Update Makefile to remove go.mod guards (Go source now available) - Update run-integration-tests.sh to build and use Go binary - Update test-config.json logDir paths for custom_log_directory tests Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Final validation complete Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert unrelated go.mod changes in server/ql/go/tools/test/ Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Replace actual repo reference with placeholder in helpers_test.go Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/86c1cb26-2977-409f-ace0-aabc4fc9cee7 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
data-douser
added a commit
that referenced
this pull request
Apr 7, 2026
…th Go implementation (#223) * Initial plan * Phase 1: Update documentation and GitHub config for Go-based client Update all .github config files, documentation, workflows, and package.json to reflect the intended Go-based ql-mcp-client architecture. No Go source code is introduced — only documentation, config, and a stub Makefile. - Create .github/instructions/client_go.instructions.md for Go conventions - Update client_src_js.instructions.md to Go guidance - Update client_integration_tests.instructions.md for Go test runner - Update agent files to reference Go client instead of JS client - Update ql-mcp-server-fix-build-and-test.prompt.md with make commands - Add actions/setup-go to CI workflows - Rewrite client/README.md and CLI-USAGE.md for gh-ql-mcp-client - Update client/integration-tests/README.md for Go test runner - Update docs/testing.md to describe Go MCP client - Update package.json to use make -C client targets, remove client workspace - Add stub client/Makefile with go.mod-conditional targets Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/f5595942-48af-4847-8d28-fba34a17ba76 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Update client/.gitignore for go ql-mcp-client * Replace JavaScript client with Go binary and integration test runner (#221) * Initial plan * Replace JavaScript client with Go binary and integration test runner - Remove client/src/ directory with all JS files (ql-mcp-client.js and 14 library modules) - Remove client/package.json and client/eslint.config.mjs - Add Go module (go.mod, go.sum) with cobra and mcp-go dependencies - Add CLI entry point (main.go) and root Cobra command (cmd/root.go) - Add CLI helpers (cmd/helpers.go) and integration test command (cmd/integration_tests.go) - Add MCP client library (internal/mcp/client.go) with stdio and HTTP transport - Add integration test runner (internal/testing/runner.go, params.go) - Add comprehensive unit tests for all packages (16 tests, all passing) - Update Makefile to remove go.mod guards (Go source now available) - Update run-integration-tests.sh to build and use Go binary - Update test-config.json logDir paths for custom_log_directory tests Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Final validation complete Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert unrelated go.mod changes in server/ql/go/tools/test/ Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Replace actual repo reference with placeholder in helpers_test.go Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/86c1cb26-2977-409f-ace0-aabc4fc9cee7 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Remove client_src_js.instructions.md * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Address PR review feedback * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Improve ql-mcp-client from PR feedback * Fix "--no-install-packs" in client integration test runner * Fixes for failing client integration tests * Fix extension mcp-tool-e2e.integration.test.ts * More fixes for PR review feedback * Fix client-integration-tests.yml Windows job * More fixes for PR review feedback * Updates for compatibility with main-merged PRs * Fix client-integration-tests for extract dbs * Address PR review feedback: fix Close() kill, remove enableAnnotationTools setting, record skipped results, fix schema default, clarify changelog Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/a90a53a5-b2ad-4775-8b61-f11d16b33749 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert test-integration to skip pack install by default, add test-integration-with-packs for explicit pack setup Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/a90a53a5-b2ad-4775-8b61-f11d16b33749 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Address review thread 4071470992: path check, changelog, timeout help, error message, cross-platform test, output path sandboxing Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/0666a5dd-b460-4e6e-9749-f729c46f0b62 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
data-douser
added a commit
that referenced
this pull request
Apr 16, 2026
…th Go implementation (#223) * Initial plan * Phase 1: Update documentation and GitHub config for Go-based client Update all .github config files, documentation, workflows, and package.json to reflect the intended Go-based ql-mcp-client architecture. No Go source code is introduced — only documentation, config, and a stub Makefile. - Create .github/instructions/client_go.instructions.md for Go conventions - Update client_src_js.instructions.md to Go guidance - Update client_integration_tests.instructions.md for Go test runner - Update agent files to reference Go client instead of JS client - Update ql-mcp-server-fix-build-and-test.prompt.md with make commands - Add actions/setup-go to CI workflows - Rewrite client/README.md and CLI-USAGE.md for gh-ql-mcp-client - Update client/integration-tests/README.md for Go test runner - Update docs/testing.md to describe Go MCP client - Update package.json to use make -C client targets, remove client workspace - Add stub client/Makefile with go.mod-conditional targets Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/f5595942-48af-4847-8d28-fba34a17ba76 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Update client/.gitignore for go ql-mcp-client * Replace JavaScript client with Go binary and integration test runner (#221) * Initial plan * Replace JavaScript client with Go binary and integration test runner - Remove client/src/ directory with all JS files (ql-mcp-client.js and 14 library modules) - Remove client/package.json and client/eslint.config.mjs - Add Go module (go.mod, go.sum) with cobra and mcp-go dependencies - Add CLI entry point (main.go) and root Cobra command (cmd/root.go) - Add CLI helpers (cmd/helpers.go) and integration test command (cmd/integration_tests.go) - Add MCP client library (internal/mcp/client.go) with stdio and HTTP transport - Add integration test runner (internal/testing/runner.go, params.go) - Add comprehensive unit tests for all packages (16 tests, all passing) - Update Makefile to remove go.mod guards (Go source now available) - Update run-integration-tests.sh to build and use Go binary - Update test-config.json logDir paths for custom_log_directory tests Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Final validation complete Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert unrelated go.mod changes in server/ql/go/tools/test/ Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/8c006672-cf7e-4045-9488-f6d97fafe2f2 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Replace actual repo reference with placeholder in helpers_test.go Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/86c1cb26-2977-409f-ace0-aabc4fc9cee7 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Remove client_src_js.instructions.md * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Address PR review feedback * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> * Improve ql-mcp-client from PR feedback * Fix "--no-install-packs" in client integration test runner * Fixes for failing client integration tests * Fix extension mcp-tool-e2e.integration.test.ts * More fixes for PR review feedback * Fix client-integration-tests.yml Windows job * More fixes for PR review feedback * Updates for compatibility with main-merged PRs * Fix client-integration-tests for extract dbs * Address PR review feedback: fix Close() kill, remove enableAnnotationTools setting, record skipped results, fix schema default, clarify changelog Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/a90a53a5-b2ad-4775-8b61-f11d16b33749 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Revert test-integration to skip pack install by default, add test-integration-with-packs for explicit pack setup Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/a90a53a5-b2ad-4775-8b61-f11d16b33749 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> * Address review thread 4071470992: path check, changelog, timeout help, error message, cross-platform test, output path sandboxing Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/0666a5dd-b460-4e6e-9749-f729c46f0b62 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com> --------- Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
Integration Testing Improvement PR: MCP Server Primitives
Use this template for PRs that implement an accepted issue created from:
.github/ISSUE_TEMPLATE/mcp-integration-testing-improvement.yml.Related Issue:
⚠ Scope Guard: This PR modifies files under
client/to replace the JavaScript-based integration test client with an equivalent Go binary. The integration test fixtures underclient/integration-tests/**are preserved; only twotest-config.jsonpaths were adjusted.Summary
Phase 2 of the
ql-mcp-clientmigration: remove the JS-basedql-mcp-client.jsand all supporting modules, replace with an equivalent Go CLI (gh-ql-mcp-client) built on Cobra + mcp-go. The integration test runner is ported from JavaScript to Go, preserving all existing test fixtures and their before/after structure.Removed
client/src/— all 18 JS files (entry point, 14 lib modules, 3 command modules)client/package.json,client/eslint.config.mjsAdded — Go CLI framework
client/main.go→cmd.Execute()client/cmd/root.go— root command with--mode,--host,--port,--formatflagsclient/cmd/helpers.go—parseRepo()utilityclient/cmd/integration_tests.go—integration-testssubcommand wiring MCP client to test runnerAdded — MCP client library (
internal/mcp/)node server/dist/...as child process) and HTTP transportcodeql_*CLI tools)Added — Integration test runner (
internal/testing/)Go port of the JS
integration-test-runner.js:runner.go— discovers fixtures inclient/integration-tests/primitives/tools/, enforces tool availability, handles deprecated session tools, priority-based orderingparams.go— parameter resolution chain:test-config.json→monitoring-state.jsonembedded params → tool-specific defaults (30+ tools){{tmpdir}}placeholder resolution to<repoRoot>/.tmp/Modified
client/Makefile— removed@if [ -f go.mod ]guards; addedVERSIONextraction fromcmd/root.goclient/scripts/run-integration-tests.sh— builds Go binary viamake build, invokesgh-ql-mcp-client integration-testsinstead ofnode src/ql-mcp-client.jstest-config.json(2 files) —logDirpaths updated fromclient/.../aftertoserver/.tmp/query-logs/custom-test-dirPrimitive Metadata
Test Additions / Modifications
client/cmd/root_test.go: Unit tests for root command help output, version constant, default flag values, subcommand visibilityclient/cmd/helpers_test.go: Unit tests forparseRepo()with valid placeholder values and invalid inputsclient/internal/mcp/client_test.go: Unit tests for tool timeout selection, config defaults, unconnected client close, constant valuesclient/internal/testing/runner_test.go: Unit tests for{{tmpdir}}placeholder resolution, tool priority ordering, string truncation, mock caller integrationclient/internal/testing/params_test.go: Unit tests for test-config.json parsing, monitoring-state.json parameter extraction, tool-specific defaults (validate_codeql_query, codeql_resolve_languages), unknown tool error, file extension filteringclient/integration-tests/primitives/tools/codeql_query_run/custom_log_directory/test-config.json: UpdatedlogDirpathclient/integration-tests/primitives/tools/codeql_test_run/custom_log_directory/test-config.json: UpdatedlogDirpathBefore vs After File States
Assertions Added
Edge & Negative Cases
buildToolParams()owner/repostrings (empty, no slash, missing owner, missing repo) return errors fromparseRepo()session_*/sessions_*tools are skipped during integration test discoveryClose()does not error{{tmpdir}}placeholders in non-string values are left unchangedNon-Goals / Deferred Follow-ups
Local Verification
Checklist
client/integration-tests/**primitives/tools/<tool>/<test>/before|after)beforehas matching file inafternpm run lint:fixandnpm run build-and-testsuccessfullyScreenshots / Logs (Optional)
All 16 Go unit tests pass:
Additional Notes
--modeflag isstdio(matching the most common local development workflow), unlike the reference branch which defaults tohttp.t.TempDir()for isolated test directories.