Skip to content

Commit 6e2e0e2

Browse files
data-douserCopilot
andauthored
More prep for initial public release readiness (#24)
* Changes for initial public release readiness This commit makes the following changes as part of the overall effort to prepare this 'advanced-security/codeql-development-mcp-server' to be fully ready for initial public release: - Rename entry point to codeql-development-mcp-server.ts - Scope all codeql-pack.yml with advanced-security/ prefix - Add npm publishConfig for GitHub Packages - Add CODEQL_PATH env var with PATH-prepend strategy - New package-paths.ts module for npm-install-safe path resolution - Logger writes all output to stderr (stdout reserved for MCP protocol) - Fix process.cwd() usages in language-resources, language-server-eval, temp-dir, and session-data-manager - Fix relative cwd/test paths resolved against workspaceRootDir - Language server spawn() honors CODEQL_PATH via PATH prepend - Use path.delimiter for Windows portability - Relax engines to node >=22.0.0 - Fix VERSION constant from 1.0.0 to 2.23.9 - Update server/README.md env vars and file listing - Updates unit tests to cover source code changes - Adds 'docs/public.md' documentation of intended public features * fix: CODEQL_PATH tests and startup validation - Fix codeql-path-tests CI job that timed out (~17min) on all three OSes due to bash pipe PID tracking bug (`$!` captured subshell PID, not server PID). Replace inline workflow steps with portable bash scripts using background watchdog + `wait` pattern (no GNU `timeout`). - Add startup-time validation (`validateCodeQLBinaryReachable`) that runs `codeql version --format=terse` before tool registration. Server now fails fast with actionable error when codeql is not on PATH and CODEQL_PATH is not set. - Add Test 3: verify server fails at startup when codeql is missing from both PATH and CODEQL_PATH. - Address 5 Copilot PR review comments: - Implement caching in `resolveCodeQLBinary()` (short-circuit on repeat calls) - Fix JSDoc in temp-dir.ts (`<repoRoot>` -> `<packageRoot>`) - Gate Windows backslash test to `process.platform === 'win32'` - Use `path.isAbsolute()` for cross-platform database path check - Guard `additionalPacksPath` with `existsSync()` for npm-installed layouts Scripts: server/scripts/test-codeql-path-{invalid,missing,valid}.sh Tests: 375 passed (4 new) * Attempted fix for cli-executor.test.ts * Attempted fix for codeql-path-tests on windows-latest * Address more PR review comments * Standardize on node24 : v24.13.0 This commit: - addresses the latest PR review comments for #24 - enforces consistent repo use of node v24.13.0 / node24 * Update package-lock.json * Attempted fix for build-server.yml workflow * Fix npm optional dependencies not installed from cache in CI (#25) --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent b69e7c6 commit 6e2e0e2

File tree

73 files changed

+2553
-477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2553
-477
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/typescript-node:22",
2+
"image": "mcr.microsoft.com/devcontainers/typescript-node:24",
33
"customizations": {
44
"vscode": {
55
"extensions": [

.github/ISSUE_TEMPLATE/mcp-server-primitive-create.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body:
1919
2020
1. **Repository Context**: Begin by reading these critical reference files:
2121
- **Repository Structure**: `README.md` - Overview of MCP server architecture and capabilities
22-
- **Server Implementation**: `server/src/ql-mcp-server.ts` - Main server implementation
22+
- **Server Implementation**: `server/src/codeql-development-mcp-server.ts` - Main server implementation
2323
- **Existing Tools**: `server/src/tools/codeql-tools.ts` - Current tool implementations
2424
- **Existing Resources**: `server/src/tools/codeql-resources.ts` - Current resource implementations
2525

.github/ISSUE_TEMPLATE/mcp-server-primitive-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body:
1919
2020
1. **Repository Context**: Begin by reading these critical reference files:
2121
- **Repository Structure**: `README.md` - Overview of MCP server architecture
22-
- **Server Implementation**: `server/src/ql-mcp-server.ts` - Main server implementation
22+
- **Server Implementation**: `server/src/codeql-development-mcp-server.ts` - Main server implementation
2323
- **Current Tools**: `server/src/tools/codeql-tools.ts` - Tool implementations to update
2424
- **Current Resources**: `server/src/tools/codeql-resources.ts` - Resource implementations to update
2525

.github/agents/mcp-enabled-ql-query-developer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: mcp-enabled-ql-query-developer
33
description: An agent enabled with QL MCP Server tools for developing CodeQL queries using test-driven development (TDD).
4-
model: Claude Opus 4.5 (copilot)
5-
tools: ['agent', 'codeql-dev-mcp-server/*', 'edit', 'read', 'search', 'todo', 'web', 'vscode']
4+
model: Claude Opus 4.6 (1M context) (copilot)
5+
tools: ['agent', 'ql-mcp/*', 'edit', 'read', 'search', 'todo', 'web', 'vscode']
66
handoffs:
77
- agent: ql-mcp-tool-developer
88
label: Fix MCP Tool Issue
@@ -18,7 +18,7 @@ handoffs:
1818

1919
My `mcp-enabled-ql-query-developer` agent:
2020

21-
- Uses the QL MCP Server tools (`codeql-dev-mcp-server/*`) to develop, test, and validate CodeQL queries, libraries, and tests.
21+
- Uses the QL MCP Server tools (`ql-mcp/*`) to develop, test, and validate CodeQL queries, libraries, and tests.
2222
- Follows test-driven development (TDD) practices: write tests first, then implement queries to pass those tests.
2323
- Leverages the `codeql` CLI for all CodeQL operations.
2424
- ALWAYS uses verbose help (`codeql <subcommand> -h -vv`) when learning about `codeql` CLI commands.

.github/agents/mcp-enabled-ql-workshop-developer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: mcp-enabled-ql-workshop-developer
33
description: An agent that creates CodeQL query development workshops from production queries using the QL MCP Server tools. Use this agent to generate guided learning materials that teach developers how to build CodeQL queries incrementally.
4-
model: Claude Opus 4.5 (copilot)
4+
model: Claude Opus 4.6 (1M context) (copilot)
55
handoffs:
66
- agent: ql-mcp-tool-tester
77
label: Validate Solution Stage
@@ -35,7 +35,7 @@ My `mcp-enabled-ql-workshop-developer` agent:
3535

3636
## Core Capabilities
3737

38-
- Uses the QL MCP Server tools (`codeql-dev-mcp-server/*`) to create comprehensive CodeQL query development workshops.
38+
- Uses the QL MCP Server tools (`ql-mcp/*`) to create comprehensive CodeQL query development workshops.
3939
- Follows the [`create-codeql-query-development-workshop`](../skills/create-codeql-query-development-workshop/SKILL.md) skill to generate workshops from production-grade queries.
4040
- Validates AST/CFG tools queries using the [`validate-ql-mcp-server-tools-queries`](../skills/validate-ql-mcp-server-tools-queries/SKILL.md) skill to ensure non-empty output.
4141
- Leverages the `codeql` CLI for all CodeQL operations.

.github/agents/ql-agent-skills-developer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: ql-agent-skills-developer
33
description: Develops and improves Agent Skills for the CodeQL Development MCP Server.
44
argument-hint: 'Provide the name(s) of the Agent Skill(s) to be created or improved under the .github/skills/ directory, along with specific requirements where available.'
5-
model: Claude Opus 4.5 (copilot)
5+
model: Claude Opus 4.6 (1M context) (copilot)
66
handoffs:
77
- label: Validate a newly created workshop
88
agent: ql-mcp-tool-tester

.github/agents/ql-mcp-tool-developer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: ql-mcp-tool-developer
33
description: An agent for developing new tools and/or improving existing tools for the QL MCP Server.
44
argument-hint: 'Provide the name(s) of the CodeQL Development MCP Server tool(s) to be created or improved, along with specific requirements where available.'
5-
model: Claude Opus 4.5 (copilot)
5+
model: Claude Opus 4.6 (1M context) (copilot)
66
handoffs:
77
- label: Test the CodeQL MCP Server tools via workshop
88
agent: ql-mcp-tool-tester
@@ -38,7 +38,7 @@ My `ql-mcp-tool-developer` agent:
3838
- Runs unit tests: `npm test --workspace=server`.
3939
- Runs integration tests: `client/scripts/run-integration-tests.sh`.
4040
- Manually validates tools using: `client/src/ql-mcp-client.js`.
41-
- Verifies server startup/shutdown: `server/dist/ql-mcp-server.js`.
41+
- Verifies server startup/shutdown: `server/dist/codeql-development-mcp-server.js`.
4242
- Maintains server documentation:
4343
- Keeps `server/QL-MCP-SERVER.md` synchronized with tool changes.
4444
- Updates the mermaid architecture diagram for structural changes.

.github/agents/ql-mcp-tool-tester.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: ql-mcp-tool-tester
33
description: An agent for testing and validating tools for the latest QL Development MCP Server.
44
argument-hint: 'Provide the name(s) of the CodeQL Development MCP Server tool(s) to be tested and validated, along with specific testing requirements, where available.'
5-
model: Claude Opus 4.5 (copilot)
5+
model: Claude Opus 4.6 (1M context) (copilot)
66
---
77

88
# `ql-mcp-tool-tester` Agent

.github/prompts/ql-mcp-server-fix-build-and-test.prompt.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
name: ql-mcp-server-fix-build-and-test
33
description: A prompt for fixing build issues for the QL MCP Server and ensuring extensive testing of the server functionality.
44
agent: ql-mcp-tool-developer
5-
model: Claude Opus 4.5 (copilot)
6-
tools: [agent, edit, execute, memory, read, search, todo, 'codeql-dev-mcp-server/*']
5+
model: Claude Opus 4.6 (copilot)
76
---
87

98
# `ql-mcp-server-fix-build-and-test` Prompt

.github/skills/add-mcp-support-for-new-language/SKILL.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,27 @@ This skill includes automation scripts to accelerate implementation:
3737

3838
## Quick Reference: Files to Modify
3939

40-
| Category | File Path | Change |
41-
| ----------------- | -------------------------------------------------------------- | --------------------------------------- |
42-
| **TypeScript** | `server/src/prompts/workflow-prompts.ts` | Add to `SUPPORTED_LANGUAGES` |
43-
| | `server/src/lib/query-file-finder.ts` | Add to `LANGUAGE_EXTENSIONS` |
44-
| | `server/src/lib/cli-tool-registry.ts` | Update error message strings |
45-
| **Query Packs** | `server/ql/{language}/tools/src/` | Create 4 tool queries |
46-
| | `server/ql/{language}/tools/test/` | Create test cases |
47-
| **Scripts** | `server/scripts/install-packs.sh` | Add to `VALID_LANGUAGES` + install call |
48-
| | `server/scripts/extract-test-databases.sh` | Add to `VALID_LANGUAGES` |
49-
| | `server/scripts/run-query-unit-tests.sh` | Add to `VALID_LANGUAGES` |
50-
| **Documentation** | `server/ql/README.md` | Add language to list |
51-
| | `server/src/prompts/tools-query-workflow.prompt.md` | Add to supported languages |
52-
| | `server/src/prompts/explain-codeql-query.prompt.md` | Add to language list |
53-
| | `server/src/prompts/document-codeql-query.prompt.md` | Add to language list |
54-
| **Skills** | `.github/skills/create-codeql-query-tdd-generic/SKILL.md` | Add to supported languages |
55-
| | `.github/skills/validate-ql-mcp-server-tools-queries/SKILL.md` | Add to language table |
56-
| **CI/CD** | `.github/workflows/query-unit-tests.yml` | Add to matrix (standard) |
57-
| | `.github/workflows/query-unit-tests-{lang}.yml` | Create if special OS needed |
40+
| Category | File Path | Change |
41+
| ----------------- | -------------------------------------------------------------- | ----------------------------------------------- |
42+
| **TypeScript** | `server/src/prompts/workflow-prompts.ts` | Add to `SUPPORTED_LANGUAGES` |
43+
| | `server/src/lib/query-file-finder.ts` | Add to `LANGUAGE_EXTENSIONS` |
44+
| | `server/src/lib/cli-tool-registry.ts` | Update error message strings |
45+
| **Query Packs** | `server/ql/{language}/tools/src/` | Create 4 tool queries |
46+
| | `server/ql/{language}/tools/test/` | Create test cases |
47+
| **npm Package** | `server/package.json` | Add `ql/{language}/tools/src/` to `files` array |
48+
| **Scripts** | `server/scripts/install-packs.sh` | Add to `VALID_LANGUAGES` + install call |
49+
| | `server/scripts/extract-test-databases.sh` | Add to `VALID_LANGUAGES` |
50+
| | `server/scripts/run-query-unit-tests.sh` | Add to `VALID_LANGUAGES` |
51+
| **Documentation** | `server/ql/README.md` | Add language to list |
52+
| | `server/src/prompts/tools-query-workflow.prompt.md` | Add to supported languages |
53+
| | `server/src/prompts/explain-codeql-query.prompt.md` | Add to language list |
54+
| | `server/src/prompts/document-codeql-query.prompt.md` | Add to language list |
55+
| | `docs/public.md` | Add to Supported Languages table |
56+
| **Skills** | `.github/skills/create-codeql-query-tdd-generic/SKILL.md` | Add to supported languages |
57+
| | `.github/skills/validate-ql-mcp-server-tools-queries/SKILL.md` | Add to language table |
58+
| **CI/CD** | `.github/workflows/query-unit-tests.yml` | Add to matrix (standard) |
59+
| | `.github/workflows/query-unit-tests-{lang}.yml` | Create if special OS needed |
60+
| | `.github/workflows/release.yml` | Add to `LANGUAGES` list in pack publish step |
5861

5962
## Phase 1: Create Query Pack Structure
6063

@@ -97,7 +100,7 @@ server/ql/{language}/tools/
97100
Create `server/ql/{language}/tools/src/codeql-pack.yml`:
98101

99102
```yaml
100-
name: ql-mcp-{language}-tools-src
103+
name: advanced-security/ql-mcp-{language}-tools-src
101104
version: 0.0.1
102105
library: false
103106
dependencies:
@@ -109,11 +112,11 @@ dependencies:
109112
Create `server/ql/{language}/tools/test/codeql-pack.yml`:
110113

111114
```yaml
112-
name: ql-mcp-{language}-tools-test
115+
name: advanced-security/ql-mcp-{language}-tools-test
113116
version: 0.0.1
114117
dependencies:
115118
codeql/{language}-queries: '*'
116-
ql-mcp-{language}-tools-src: '*'
119+
advanced-security/ql-mcp-{language}-tools-src: ${workspace}
117120
extractor: { language }
118121
```
119122

@@ -545,12 +548,16 @@ Before submitting the PR:
545548
- [ ] Pack lock files generated (`codeql-pack.lock.yml`)
546549
- [ ] TypeScript source updated and builds successfully
547550
- [ ] All scripts updated with new language
551+
- [ ] `server/package.json` `files` array includes `ql/{language}/tools/src/`
552+
- [ ] `.github/workflows/release.yml` `LANGUAGES` list includes new language
553+
- [ ] `docs/public.md` Supported Languages table updated
548554
- [ ] Documentation updated (4+ files)
549555
- [ ] Skills updated (2+ files)
550556
- [ ] CI workflow configured (matrix or dedicated)
551-
- [ ] Server bundle rebuilt (`server/dist/ql-mcp-server.js`)
557+
- [ ] Server bundle rebuilt (`server/dist/codeql-development-mcp-server.js`)
552558
- [ ] All existing tests still pass
553559
- [ ] New language tests pass
560+
- [ ] `npm pack --dry-run` (from `server/`) includes the new language's `.ql`, `.md`, and `codeql-pack.yml` files
554561

555562
## Success Criteria
556563

0 commit comments

Comments
 (0)