Commit 7093a4e
authored
Improve MCP server integrations with
* Add CodeQL background server manager and LSP tools
Implements CodeQLServerManager for config-aware lifecycle management
of CodeQL's three background servers (language-server, query-server2,
cli-server) with session-isolated cache directories and automatic
restart on configuration changes.
Adds four LSP-based MCP tools:
- codeql_lsp_diagnostics (renamed from codeql_language_server_eval)
- codeql_lsp_completion
- codeql_lsp_definition
- codeql_lsp_references
Resolves #17 (server manager with config hashing, session isolation,
graceful shutdown) and #1 (LSP completion/definition/references tools).
* Fix server lifecycle bugs and replace hard-coded startup delays
- Fix duplicate --tuple-counting flag when both debug and
tupleCounting are set in buildQueryServerArgs
- Fix non-awaited force-kill timers in query-server and
language-server shutdown methods (process could outlive caller)
- Remove redundant process.on SIGINT/SIGTERM handlers from
lsp-diagnostics (already handled by shutdownServerManager)
- Replace hard-coded setTimeout delays (1.5-2s) in server
start() methods with waitForProcessReady utility that resolves
on first stderr/stdout output or rejects on spawn failure
- Add comprehensive tests for process-ready utility
* Fix CI failures and improve LSP tool reliability
- Add LSP tools to longRunningTools (300s timeout) in integration
test runner to prevent CI timeouts during JVM startup
- Convert relative workspace_uri to file:// URIs in lsp-handlers
- Replace synchronous readFileSync with async readFile
- Add isRunning() guards to LSP feature methods
- Guard exit notification in shutdown to prevent "not running" error
- Fix semantic_validation test to use resolvable QL code
- Centralize logger mock in test/setup.ts (removes 16 per-file mocks)
- Add server-manager getLanguageServer/getQueryServer/getCLIServer tests
- Clarify --debug/--tuple-counting arg ordering in server-config
- Add missing README.md files to integration test directories
* Address PR review comments & fix integration tests
* Fixes for codeql_lsp_* tool integration tests
* Address PR review comments from review #3773277390
- Fix race condition in server-manager getOrRestart: serialize concurrent
calls per server type using pendingStarts map with async/await pattern
- Fix lsp-handlers filePath docstring: document that relative paths are
accepted and resolved against getUserWorkspaceDir()
- Fix semantic_validation/syntax_validation READMEs: clarify that before/
after .ql files differ (not identical as previously stated)
- Fix semantic_validation/after/monitoring-state.json: update parameter
shape to use ql_code matching the codeql_lsp_diagnostics tool contract
- Add concurrent access serialization test for server-manager
* Address code-quality PR review feedbackcodeql execute *-server servers (#29)1 parent ca58e85 commit 7093a4e
File tree
87 files changed
+12293
-5995
lines changed- client
- integration-tests
- primitives/tools
- codeql_language_server_eval/semantic_validation
- after
- before
- codeql_lsp_completion
- basic_completion
- after
- before
- from_clause_completion
- after
- before
- codeql_lsp_definition
- basic_definition
- after
- before
- class_definition
- after
- before
- codeql_lsp_diagnostics
- semantic_validation
- after
- before
- syntax_validation
- after
- before
- valid_query_no_errors
- after
- before
- codeql_lsp_references
- basic_references
- after
- before
- predicate_references
- after
- before
- src/lib
- docs
- server
- dist
- src
- lib
- prompts
- tools
- codeql
- lsp
- utils
- test
- src
- lib
- prompts
- tools
- codeql
- lsp
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
87 files changed
+12293
-5995
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments