| name | ql-mcp-server-fix-build-and-test |
|---|---|
| description | A prompt for fixing build issues for the QL MCP Server and ensuring extensive testing of the server functionality. |
| agent | ql-mcp-tool-developer |
| model | Claude Opus 4.6 (copilot) |
When you encounter build issues with the QL MCP Server or need to ensure that the server functionality is thoroughly tested, use this prompt to guide your actions.
- Fix any build issues in the QL MCP Server codebase.
- Ensure that all unit and integration tests for the server pass successfully.
- Validate that the server starts up and shuts down correctly.
- Confirm that all changes are properly bundled and that the build artifacts are up-to-date (i.e.,
server/dist/**).
PRIOR to pushing any commit for any branch, ALWAYS run the necessary commands to ensure that the server/dist/** directory is up-to-date with the latest changes from the TypeScript source files in server/src/**. This includes running the build and bundling commands to generate the compiled JavaScript files. Thus, there MUST NOT be any git diff changes for a given commit after re-running the npm run build command from the root of the repository.
The package.json file in the root of this repository provides the scripts that are used to run specific combinations of scripts from the server/ (for build and unit tests) and client/ (for integration tests) workspaces. Instead of changing to each workspace directory, stay in the root of the repository and just use the commands available via npm run and especially those "commands" listed below.
Before running any build or test commands, ensure that all dependencies are installed and up-to-date by running:
npm installThe npm run tidy command enforces consistent linting and formatting across the workspaces and .github/** files of this repository. Run this command to fix any linting or formatting issues.
npm run tidyBuild the QL MCP Server to check for and fix any build issues.
npm run buildRe-run the build and run all server unit tests plus client integration tests to ensure everything is functioning correctly PRIOR to committing any changes.
npm run testFor HTTP mode integration tests, the QL MCP Server must be running. You can start the server using the shell scripts:
client/scripts/start-server.sh
client/scripts/wait-for-server.shTo stop the server after running the integration tests:
client/scripts/stop-server.shFor stdio mode, the Go client spawns the server automatically — no manual start/stop is needed.
Client integration tests are executed via the Go binary gh-ql-mcp-client.
To get help on using the MCP Client binary, including help for the integration-tests subcommand, run:
gh-ql-mcp-client --helpWhen focusing specifically on fixing client integration tests, build the binary and run the integration tests directly:
make -C client build
gh-ql-mcp-client integration-tests --mode stdio --no-install-packsBecause integration tests can be time-consuming, you can run specific tests or tools as needed using the following commands:
# Run all integration tests with default settings
gh-ql-mcp-client integration-tests --mode stdio --no-install-packs
# Run tests for specific tools
gh-ql-mcp-client integration-tests --mode stdio --tools codeql_query_run --no-install-packs
# Run specific tests for a tool
gh-ql-mcp-client integration-tests --mode stdio --tools codeql_query_run --tests basic_query_run --no-install-packspackage.json- The mainpackage.jsonfile that defines thescriptsfor building and testing the MCP Server, with references to theserver/workspace andmake -C clienttargets.server/package.json- Thepackage.jsonfile in theserver/workspace that defines the build and test scripts specific to the MCP Server.client/Makefile- The Makefile in theclient/directory that defines build, test, lint, and cross-compile targets for the Go CLI.