mcp-code-context 3.9.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +288 -215
- package/INSTRUCTIONS.md +28 -11
- package/README.md +124 -11
- package/dist/src/core/engine.d.ts +1 -1
- package/dist/src/core/engine.js +1 -1
- package/dist/src/core/indexManager.d.ts +1 -1
- package/dist/src/core/indexManager.js +26 -26
- package/dist/src/core/sessionManager.d.ts +1 -1
- package/dist/src/core/sessionManager.js +1 -1
- package/dist/src/core/validator.d.ts +2 -2
- package/dist/src/core/validator.js +8 -2
- package/dist/src/core/validator.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +119 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/operations/apiRoutes.d.ts +31 -0
- package/dist/src/operations/apiRoutes.js +170 -0
- package/dist/src/operations/apiRoutes.js.map +1 -0
- package/dist/src/operations/architectureLinter.d.ts +45 -0
- package/dist/src/operations/architectureLinter.js +223 -0
- package/dist/src/operations/architectureLinter.js.map +1 -0
- package/dist/src/operations/astComplexity.d.ts +38 -0
- package/dist/src/operations/astComplexity.js +243 -0
- package/dist/src/operations/astComplexity.js.map +1 -0
- package/dist/src/operations/astMockGenerator.d.ts +34 -0
- package/dist/src/operations/astMockGenerator.js +203 -0
- package/dist/src/operations/astMockGenerator.js.map +1 -0
- package/dist/src/operations/astQuery.d.ts +47 -0
- package/dist/src/operations/astQuery.js +169 -0
- package/dist/src/operations/astQuery.js.map +1 -0
- package/dist/src/operations/astTransform.d.ts +1 -1
- package/dist/src/operations/astTransform.js +11 -2
- package/dist/src/operations/astTransform.js.map +1 -1
- package/dist/src/operations/asyncBlockers.d.ts +33 -0
- package/dist/src/operations/asyncBlockers.js +162 -0
- package/dist/src/operations/asyncBlockers.js.map +1 -0
- package/dist/src/operations/blastRadiusReport.d.ts +43 -0
- package/dist/src/operations/blastRadiusReport.js +236 -0
- package/dist/src/operations/blastRadiusReport.js.map +1 -0
- package/dist/src/operations/callHierarchy.d.ts +28 -0
- package/dist/src/operations/callHierarchy.js +166 -0
- package/dist/src/operations/callHierarchy.js.map +1 -0
- package/dist/src/operations/circularDependencies.d.ts +28 -0
- package/dist/src/operations/circularDependencies.js +201 -0
- package/dist/src/operations/circularDependencies.js.map +1 -0
- package/dist/src/operations/classHierarchyFlattener.d.ts +35 -0
- package/dist/src/operations/classHierarchyFlattener.js +185 -0
- package/dist/src/operations/classHierarchyFlattener.js.map +1 -0
- package/dist/src/operations/compress.d.ts +2 -2
- package/dist/src/operations/compress.js +154 -20
- package/dist/src/operations/compress.js.map +1 -1
- package/dist/src/operations/conceptSearch.d.ts +19 -0
- package/dist/src/operations/conceptSearch.js +176 -0
- package/dist/src/operations/conceptSearch.js.map +1 -0
- package/dist/src/operations/confirmationStore.d.ts +1 -1
- package/dist/src/operations/confirmationStore.js +1 -1
- package/dist/src/operations/conflictPredictor.d.ts +21 -0
- package/dist/src/operations/conflictPredictor.js +139 -0
- package/dist/src/operations/conflictPredictor.js.map +1 -0
- package/dist/src/operations/contextCompactor.d.ts +38 -0
- package/dist/src/operations/contextCompactor.js +348 -0
- package/dist/src/operations/contextCompactor.js.map +1 -0
- package/dist/src/operations/cstCodemod.d.ts +34 -0
- package/dist/src/operations/cstCodemod.js +205 -0
- package/dist/src/operations/cstCodemod.js.map +1 -0
- package/dist/src/operations/deadSymbols.d.ts +32 -0
- package/dist/src/operations/deadSymbols.js +178 -0
- package/dist/src/operations/deadSymbols.js.map +1 -0
- package/dist/src/operations/envContract.d.ts +35 -0
- package/dist/src/operations/envContract.js +194 -0
- package/dist/src/operations/envContract.js.map +1 -0
- package/dist/src/operations/errorAudit.d.ts +36 -0
- package/dist/src/operations/errorAudit.js +201 -0
- package/dist/src/operations/errorAudit.js.map +1 -0
- package/dist/src/operations/importIntegrity.d.ts +48 -0
- package/dist/src/operations/importIntegrity.js +395 -0
- package/dist/src/operations/importIntegrity.js.map +1 -0
- package/dist/src/operations/incrementalDiff.d.ts +47 -0
- package/dist/src/operations/incrementalDiff.js +216 -0
- package/dist/src/operations/incrementalDiff.js.map +1 -0
- package/dist/src/operations/lexicalScope.d.ts +51 -0
- package/dist/src/operations/lexicalScope.js +212 -0
- package/dist/src/operations/lexicalScope.js.map +1 -0
- package/dist/src/operations/read.d.ts +21 -0
- package/dist/src/operations/read.js +21 -0
- package/dist/src/operations/read.js.map +1 -1
- package/dist/src/operations/readCore.js +37 -17
- package/dist/src/operations/readCore.js.map +1 -1
- package/dist/src/operations/rename.js +35 -24
- package/dist/src/operations/rename.js.map +1 -1
- package/dist/src/operations/sqlValidator.d.ts +36 -0
- package/dist/src/operations/sqlValidator.js +202 -0
- package/dist/src/operations/sqlValidator.js.map +1 -0
- package/dist/src/operations/symbolQuery.js +112 -23
- package/dist/src/operations/symbolQuery.js.map +1 -1
- package/dist/src/operations/taintAnalysis.d.ts +46 -0
- package/dist/src/operations/taintAnalysis.js +220 -0
- package/dist/src/operations/taintAnalysis.js.map +1 -0
- package/dist/src/operations/testImpact.d.ts +31 -0
- package/dist/src/operations/testImpact.js +179 -0
- package/dist/src/operations/testImpact.js.map +1 -0
- package/dist/src/operations/typeInference.d.ts +54 -0
- package/dist/src/operations/typeInference.js +565 -0
- package/dist/src/operations/typeInference.js.map +1 -0
- package/dist/src/operations/wireContract.d.ts +34 -0
- package/dist/src/operations/wireContract.js +185 -0
- package/dist/src/operations/wireContract.js.map +1 -0
- package/dist/src/operations/write.d.ts +2 -2
- package/dist/src/operations/write.js +151 -82
- package/dist/src/operations/write.js.map +1 -1
- package/dist/src/parsers/base.d.ts +9 -1
- package/dist/src/parsers/base.js +61 -1
- package/dist/src/parsers/base.js.map +1 -1
- package/dist/src/parsers/csharp.d.ts +1 -1
- package/dist/src/parsers/csharp.js +1 -1
- package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
- package/dist/src/parsers/dartTreeSitter.js +1 -1
- package/dist/src/parsers/go.d.ts +1 -1
- package/dist/src/parsers/go.js +1 -1
- package/dist/src/parsers/java.d.ts +1 -1
- package/dist/src/parsers/java.js +1 -1
- package/dist/src/parsers/kotlin.d.ts +1 -1
- package/dist/src/parsers/kotlin.js +1 -1
- package/dist/src/parsers/php.d.ts +1 -1
- package/dist/src/parsers/php.js +1 -1
- package/dist/src/parsers/python.d.ts +1 -1
- package/dist/src/parsers/python.js +1 -1
- package/dist/src/parsers/registry.d.ts +1 -1
- package/dist/src/parsers/registry.js +1 -1
- package/dist/src/parsers/ruby.d.ts +1 -1
- package/dist/src/parsers/ruby.js +1 -1
- package/dist/src/parsers/rust.d.ts +1 -1
- package/dist/src/parsers/rust.js +1 -1
- package/dist/src/parsers/typescript.d.ts +1 -1
- package/dist/src/parsers/typescript.js +1 -1
- package/dist/src/tools/adminHandlers.js +8 -7
- package/dist/src/tools/adminHandlers.js.map +1 -1
- package/dist/src/tools/context.d.ts +4 -0
- package/dist/src/tools/context.js +14 -0
- package/dist/src/tools/context.js.map +1 -1
- package/dist/src/tools/pipeline.js +27 -1
- package/dist/src/tools/pipeline.js.map +1 -1
- package/dist/src/tools/readHandlers.d.ts +150 -0
- package/dist/src/tools/readHandlers.js +642 -35
- package/dist/src/tools/readHandlers.js.map +1 -1
- package/dist/src/tools/toolDefinitions.d.ts +2190 -1
- package/dist/src/tools/toolDefinitionsAdmin.d.ts +1 -1
- package/dist/src/tools/toolDefinitionsAdmin.js +12 -12
- package/dist/src/tools/toolDefinitionsAdmin.js.map +1 -1
- package/dist/src/tools/toolDefinitionsCore.d.ts +2189 -0
- package/dist/src/tools/toolDefinitionsCore.js +422 -42
- package/dist/src/tools/toolDefinitionsCore.js.map +1 -1
- package/dist/src/tools/writeHandlers.js +31 -17
- package/dist/src/tools/writeHandlers.js.map +1 -1
- package/dist/src/utils/appDir.d.ts +1 -1
- package/dist/src/utils/appDir.js +1 -1
- package/dist/src/utils/auditLogger.d.ts +1 -1
- package/dist/src/utils/auditLogger.js +1 -1
- package/dist/src/utils/backupManager.d.ts +1 -1
- package/dist/src/utils/backupManager.js +1 -1
- package/dist/src/utils/conceptEngine.d.ts +56 -0
- package/dist/src/utils/conceptEngine.js +234 -0
- package/dist/src/utils/conceptEngine.js.map +1 -0
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +2 -1
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/diff.d.ts +1 -1
- package/dist/src/utils/diff.js +1 -1
- package/dist/src/utils/fileLock.d.ts +1 -1
- package/dist/src/utils/fileLock.js +1 -1
- package/dist/src/utils/fileWalker.d.ts +1 -1
- package/dist/src/utils/fileWalker.js +1 -1
- package/dist/src/utils/fileWatcher.d.ts +1 -1
- package/dist/src/utils/fileWatcher.js +1 -1
- package/dist/src/utils/fuzzySearch.d.ts +1 -1
- package/dist/src/utils/fuzzySearch.js +1 -1
- package/dist/src/utils/gemfileParser.d.ts +1 -1
- package/dist/src/utils/gemfileParser.js +1 -1
- package/dist/src/utils/logger.d.ts +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/utils/metaprogramming.d.ts +1 -1
- package/dist/src/utils/metaprogramming.js +1 -1
- package/dist/src/utils/projectRoot.d.ts +9 -0
- package/dist/src/utils/projectRoot.js +94 -0
- package/dist/src/utils/projectRoot.js.map +1 -0
- package/dist/src/utils/railsRoutes.d.ts +1 -1
- package/dist/src/utils/railsRoutes.js +1 -1
- package/dist/src/utils/rateLimiter.d.ts +26 -1
- package/dist/src/utils/rateLimiter.js +26 -1
- package/dist/src/utils/rateLimiter.js.map +1 -1
- package/dist/src/utils/streaming.d.ts +1 -1
- package/dist/src/utils/streaming.js +1 -1
- package/dist/src/utils/telemetry.d.ts +1 -1
- package/dist/src/utils/telemetry.js +1 -1
- package/dist/src/utils/virtualSchema.d.ts +31 -0
- package/dist/src/utils/virtualSchema.js +367 -0
- package/dist/src/utils/virtualSchema.js.map +1 -0
- package/llms.txt +24 -6
- package/package.json +4 -2
- package/skills/code-context-logo.png +0 -0
- package/skills/code-context-pro/SKILL.md +149 -0
- package/skills/code-context-pro/references/benchmarks.md +25 -0
- package/skills/code-context-pro/references/decision-tree.md +32 -0
- package/skills/code-context-pro/references/multi-ide-setup.md +104 -0
- package/skills/code-context-pro.zip +0 -0
- package/HIRE_ME.md +0 -234
- package/SPONSORS.md +0 -104
- package/vitest.config.ts +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,215 +1,288 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
- `
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- `
|
|
185
|
-
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
- `
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- `
|
|
201
|
-
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [7.0.0] - 2026-11-07
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **53 Pure AST WebAssembly Tools Suite**: Expanded total tool coverage to 53 production-ready AST operations with zero native dependencies across 10 programming languages (TypeScript, JavaScript, Python, PHP, Dart, Ruby, Java, Go, C#, Rust, and Kotlin).
|
|
7
|
+
- **6 Enterprise AST Operations (v7.0.0)**:
|
|
8
|
+
- `detect_async_eventloop_blockers`: SRE async event-loop blocker detector for Node.js (`fs.readFileSync`, `child_process.execSync`) and Python (`time.sleep`, `subprocess.run`).
|
|
9
|
+
- `verify_env_contract_drift`: Environment variable contract auditor detecting undeclared usages against `.env.example`.
|
|
10
|
+
- `audit_error_handling_contracts`: AST exception & error swallowing guard preventing silent `catch (e) {}` blocks.
|
|
11
|
+
- `extract_api_route_matrix`: Zero-runtime REST & FastAPI route extractor for Express, FastAPI, and Ruby on Rails.
|
|
12
|
+
- `flatten_class_hierarchy`: Trait, mixin, and interface inheritance flattener resolving complete method hierarchies.
|
|
13
|
+
- `detect_circular_dependencies`: Tarjan's strongly connected components (SCC) O(V+E) import cycle detector.
|
|
14
|
+
- **OMNI-MAXIMUS Adversarial Certification**: Certified 98/100 Resilient with 304 unit and integration tests passing at 100%. All 49 candidate leads falsified as zero false positives.
|
|
15
|
+
- **Companion Skill (`code-context-pro`)**: Bundled agent skill in `skills/code-context-pro/` for Claude Code, Cursor, Windsurf, and Antigravity.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- **DOM XSS Neutralization**: Sanitized raw symbol and code injections in interactive visual HTML architecture map (`get_semantic_repo_map` in HTML mode).
|
|
19
|
+
- **WASM Memory Disposal**: Ensured deterministic `tree.delete()` in `finally` blocks across all AST operations, eliminating WebAssembly linear memory accumulation.
|
|
20
|
+
- **Process Spawning Hardening**: Added strict 15,000ms timeouts and `isValidGitRef` regex checks on child processes (`blastRadiusReport`, `conflictPredictor`).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## [6.0.0] - 2026-10-29
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **8 Next-Gen AST Operations**:
|
|
28
|
+
- `query_code_ast`: Native S-Expression Tree-sitter query engine with syntax highlighting and regex capture filters.
|
|
29
|
+
- `incremental_ast_diff`: O(log N) tree diffing with `tree.edit()` for instantaneous change detection without full re-parsing.
|
|
30
|
+
- `get_ast_complexity_matrix`: Dual McCabe Cyclomatic and Sonar Cognitive complexity scoring per symbol.
|
|
31
|
+
- `generate_ast_mocks`: Typed zero-hallucination test mocks and factory generator for unit tests.
|
|
32
|
+
- `detect_dead_ast_symbols`: Dead code and zombie export detector across workspace.
|
|
33
|
+
- `resolve_lexical_scope`: Scope-aware variable resolution and identifier shadowing verification.
|
|
34
|
+
- `sql_ast_validator`: Embedded SQL injection taint analysis and AST query validation.
|
|
35
|
+
- `ast_codemod_transpile`: Lossless CST codemod refactoring engine (CJS to ESM, console stripping).
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## [5.0.0] - 2026-10-25
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- **AST Boundary & Safety Guardrails**:
|
|
43
|
+
- `generate_ast_impact_report`: Cryptographic Markdown blast radius audit report with SHA-256 digest for PRs.
|
|
44
|
+
- `compact_context_ledger`: Lossless AST context compactor preserving signatures while stripping function bodies.
|
|
45
|
+
- `enforce_architecture_rules`: Architectural boundary and layer compliance linter.
|
|
46
|
+
- `backfill_types`: Duck-type interface inference for legacy JavaScript/Python codebases.
|
|
47
|
+
- `trace_taint_flow`: Static source-to-sink vulnerability taint analyzer.
|
|
48
|
+
- `verify_import_integrity`: Anti-hallucination import verifier against package manifests and local exports.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## [4.0.0] - 2026-10-20
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
- **Pure WebAssembly Tree-sitter Architecture**: Completely migrated from native C++ bindings to `web-tree-sitter` and `tree-sitter-wasms`. Zero compilation dependencies across Windows, macOS, and Linux.
|
|
56
|
+
- **Virtual ORM Schema Intelligence**: Zero-DB-connection schema extraction for Prisma, Drizzle, Rails ActiveRecord, Laravel Eloquent, and Django ORM.
|
|
57
|
+
- **Offline Conceptual Vector Search (`search_code_concept`)**: In-memory domain intention search without external embeddings.
|
|
58
|
+
- **3-Hop Call Hierarchy (`get_call_hierarchy`)**: Call graph exploration with Mermaid export.
|
|
59
|
+
- **Wire Contract Validation (`validate_wire_contract`)**: Cross-language frontend/backend contract discrepancy checker.
|
|
60
|
+
- **Semantic Conflict Prediction (`predict_semantic_conflicts`)**: Pre-merge AST signature divergence analysis.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## [3.9.2] - 2026-10-12
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- **Project Root Fallback & Boundary Resolution** — fixed critical issue where omitted or `undefined` `projectRoot` arguments were coerced to the literal string `"undefined"`, resolving to `<cwd>/undefined` and causing spurious `outside project boundary` security errors when accessing valid files.
|
|
69
|
+
- **Smart Root Discovery** — introduced `resolveProjectRoot` and `findProjectRoot` in `src/utils/projectRoot.ts`, which automatically walks up the directory tree to discover root markers (`.git`, `package.json`, `composer.json`, `pyproject.toml`, `requirements.txt`, `Cargo.toml`, `go.mod`, `Gemfile`, `pom.xml`, `build.gradle`), falling back cleanly to `process.cwd()`.
|
|
70
|
+
- **SecurityValidator Hardening** — `SecurityValidator` constructor now safely handles `undefined`, `null`, or blank inputs without generating an invalid boundary path.
|
|
71
|
+
- **Optional Schema Requirements** — made `projectRoot` optional in tool definitions across both `CORE_TOOLS` and `ADMIN_TOOLS`, allowing LLM agents to execute surgical reads, writes, and symbol lookups with only `filePath` or `rootDir`.
|
|
72
|
+
- **Startup Diagnostics** — added clear banner signature on stdio initialization: `[mcp-code-context] v3.9.2 running on stdio`.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## [3.9.1] - 2026-07-17
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- **`get_rails_routes` namespace bug** — routes inside `namespace :admin do` / `namespace :api do` now correctly produce prefixed paths (`/admin/users`, `/api/v1/orders`) and namespaced controllers (`admin/users`, `api/v1/orders`). Root cause: the original regex `/^(?:namespace|scope)\s+[:'"]([^'"]+)['"]/` captured `admin do` instead of `admin` when using symbol syntax (`:admin`). Rewrote parser to handle symbol (`:admin`) and string (`'admin'`) syntax separately.
|
|
81
|
+
- **`get_rails_routes` depth tracking** — replaced fragile `do/end` counter with indentation-based namespace stack. Parser now correctly handles nested namespaces (`api > v1`), `resources` blocks with `member do`, and `scope` blocks without false prefix leakage.
|
|
82
|
+
- **`get_semantic_repo_map` Gemfile + Concerns injection** — repo map XML now appends `<gem>` blocks and `<concern>` entries when a Gemfile and concerns directory are present.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## [3.9.0] - 2026-07-17
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- **`get_gemfile_context`** (R7) — parses `Gemfile` and returns known gems with their implicit Rails behavior. Uses `gemDescriptions.json` lookup table (updateable without recompile). Includes mtime-keyed cache for zero re-read cost.
|
|
91
|
+
- **`find_metaprogramming`** (R3) — scans Ruby files for dynamic method generation entry points: `define_method`, `method_missing`, `class_eval/module_eval`, `instance_eval`, `send/public_send`, `ActiveSupport::Concern`, `included do`, `attr_accessor/reader/writer`, `delegate :to =>`, `has_many :through`. Accepts single file or full directory scan.
|
|
92
|
+
- **`get_rails_routes`** (R2) — parses `config/routes.rb` and returns a structured route map (method, path, controller, action). Supports `resources`, `resource`, explicit HTTP verbs (`get/post/patch/put/delete`), `namespace/scope` prefixing, `root`, and `do`-block nesting warnings. mtime-keyed cache.
|
|
93
|
+
- **Concern Resolution in `analyze_impact`** (R5) — `rubyModuleResolvesToFile()` now checks `app/models/concerns` and `app/controllers/concerns` via `findRailsConcerns()` before falling back to file system candidates. Prevents false positives for stdlib mixins.
|
|
94
|
+
- **`findRailsConcerns()`** utility — scans both concern directories and returns a `Map<moduleName, filePaths[]>` for use by impact analysis and future tools.
|
|
95
|
+
|
|
96
|
+
### Changed
|
|
97
|
+
|
|
98
|
+
- `gemDescriptions.json` — new data file for gem behavior descriptions (bundled in `src/utils/`)
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## [3.8.1] - 2026-07-16
|
|
103
|
+
|
|
104
|
+
### Added
|
|
105
|
+
|
|
106
|
+
- **`insertCode` fix for brace-less languages (Ruby, Python)** — `inside_start`/`inside_end` positions now use AST-aware methods instead of `indexOf("{")` / `lastIndexOf("}")`. Added `getInsideStartIndex()` and `getInsideEndIndex()` to `BaseParser` with language-specific overrides in `RubyParser` and `PythonParser`.
|
|
107
|
+
- **Ruby import analysis** — `extractImports` in `compress.ts` now detects `require` and `require_relative` patterns. `analyzeImpact` adds Ruby patterns with file-resolution guard (prevents false positives from stdlib mixins like `include Comparable`).
|
|
108
|
+
- **ActiveRecord schema injection in `get_semantic_repo_map`** — repo map now includes `db_column` symbols for AR models, showing database columns alongside methods in the XML/Markdown output.
|
|
109
|
+
|
|
110
|
+
### Fixed
|
|
111
|
+
|
|
112
|
+
- **`insert_symbol inside_start/inside_end` for Ruby** — previously returned wrong position (`-1`) for any Ruby class or method. Now inserts correctly after the opening header line (`inside_start`) and before the closing `end` keyword (`inside_end`).
|
|
113
|
+
- **`insert_symbol inside_start/inside_end` for Python** — previously searched for `{`/`}` that don't exist. Now uses colon+newline and indentation-aware end position.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## [3.8.0] - 2026-07-15
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
|
|
121
|
+
- **Ruby full support** — `RubyParser` now complete with `search()` method for `search_code_pattern` tool compatibility
|
|
122
|
+
- **ActiveRecord Virtual Schema Extractor** — new `src/utils/railsSchema.ts` utility:
|
|
123
|
+
- Parses `db/schema.rb` via O(n) line-by-line state machine (no backtracking risk)
|
|
124
|
+
- mtime-keyed in-memory cache — zero I/O on repeated reads of unchanged schema
|
|
125
|
+
- `modelToTable()` — Rails CoC PascalCase → snake_case → pluralize (`AdminUser → admin_users`, `Category → categories`)
|
|
126
|
+
- `formatSchemaAnnotation()` — emits XML comment block with column names and types
|
|
127
|
+
- **AR schema injection in `read_file_surgical`** — when reading `.rb` files inheriting from `ApplicationRecord` or `ActiveRecord::Base`, virtual schema columns are prepended as XML comments
|
|
128
|
+
- Context-aware: when `symbolName` is set, reads full file to detect AR inheritance before injecting
|
|
129
|
+
- Graceful: no-op when `db/schema.rb` is absent or table not found
|
|
130
|
+
|
|
131
|
+
### Fixed
|
|
132
|
+
|
|
133
|
+
- **`RubyParser.extractSymbol` off-by-one** — `tree.rootNode.text` omits leading whitespace on Windows/WASM, causing `startIndex` drift. Fixed by adjusting indices relative to `tree.rootNode.startIndex`.
|
|
134
|
+
|
|
135
|
+
### Tests
|
|
136
|
+
|
|
137
|
+
- Added `tests/unit/parsers/ruby.spec.ts` — 5 vitest specs: symbol discovery, surgical replace, `extractSymbol` scoping, `parseSchemaRb` column extraction, `modelToTable` CoC mapping
|
|
138
|
+
- All 115 WASM parser tests passing (100%)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## [3.7.1] - 2026-06-18
|
|
143
|
+
|
|
144
|
+
### Fixed
|
|
145
|
+
|
|
146
|
+
- **`ast_transform` wrap_with_try_catch**: Missing closing `}` for method body caused unbalanced braces and syntax errors in all TypeScript class methods
|
|
147
|
+
- **`ast_transform` wrap_with_try_catch**: Missing newline after `try {` caused parse failure on all function types
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## [3.7.0] - 2026-06-18
|
|
152
|
+
|
|
153
|
+
### 🚀 Production Readiness Release — Adversarial Audit Hardening
|
|
154
|
+
|
|
155
|
+
This release fixes **critical architectural issues** identified through three rounds of adversarial analysis and AST-based code review. All stoppers resolved. Ready for multi-agent production deployments.
|
|
156
|
+
|
|
157
|
+
### Fixed — Critical (Production Blockers)
|
|
158
|
+
|
|
159
|
+
1. **Session State Leakage / Memory Leak**
|
|
160
|
+
- Global state (`globalLockManager`, `globalConfirmationStore`, `rateLimiter`) accumulated across client sessions with no cleanup.
|
|
161
|
+
- **Fix**: `SessionManager` per-client state isolation with LRU eviction and 30-min timeout cleanup.
|
|
162
|
+
|
|
163
|
+
2. **No Phase 1 Crash Recovery**
|
|
164
|
+
- Pending operations stored in memory only. Server crash between Phase 1 → Phase 2 lost all work.
|
|
165
|
+
- **Fix**: SQLite-backed `PendingOperationStore` — operations persist across restarts.
|
|
166
|
+
|
|
167
|
+
3. **TOCTOU in Multi-File Writes**
|
|
168
|
+
- Phase 2 only verified hash of the primary file, not dependent files in `pendingWrites`.
|
|
169
|
+
- **Fix**: Hash verified on all files in the write set before applying.
|
|
170
|
+
|
|
171
|
+
4. **Symlink Boundary Escape**
|
|
172
|
+
- `path.resolve()` used for boundary validation — does not follow symlinks.
|
|
173
|
+
- **Fix**: `fs.realpath()` in `SecurityValidator.validateFilePath()`.
|
|
174
|
+
|
|
175
|
+
5. **`new Promise(async ...)` Anti-pattern in Worker**
|
|
176
|
+
- `runInWorker` used `new Promise(async (resolve) => ...)` — swallowed async errors.
|
|
177
|
+
- **Fix**: Refactored to standard async/await pattern.
|
|
178
|
+
|
|
179
|
+
6. **`WORKER_FILE` Resolved at Import-Time**
|
|
180
|
+
- Worker path calculated before `dist/` exists — crashes on fresh install.
|
|
181
|
+
- **Fix**: Lazy `getWorkerFile()` evaluated at runtime.
|
|
182
|
+
|
|
183
|
+
7. **ReDoS in `impactAnalysis`, `rename`, `readCore`**
|
|
184
|
+
- Dynamic `new RegExp()` constructed in main thread without timeout.
|
|
185
|
+
- **Fix**: All operation-level regex routed through `safeRegex` worker pool.
|
|
186
|
+
|
|
187
|
+
8. **Rate Limiter Shared Globally**
|
|
188
|
+
- Single `'global'` bucket shared across all MCP clients.
|
|
189
|
+
- **Fix**: Per-session `SESSION_ID` (pid-based) rate limiting.
|
|
190
|
+
|
|
191
|
+
9. **`configure_file_watcher` Without `rootDir` Validation**
|
|
192
|
+
- Watcher path not validated through `SecurityValidator`.
|
|
193
|
+
- **Fix**: Watcher uses only validated `projectRoot`.
|
|
194
|
+
|
|
195
|
+
10. **Confirmation Token Leak Without Cleanup**
|
|
196
|
+
- Expired tokens accumulated in memory indefinitely.
|
|
197
|
+
- **Fix**: `setInterval` 60s cleanup in `ConfirmationStore`.
|
|
198
|
+
|
|
199
|
+
11. **Windows Path Case Sensitivity in Boundary Check**
|
|
200
|
+
- `fs.realpath()` returns `C:\` (uppercase), `path.resolve()` returns `c:\` (lowercase).
|
|
201
|
+
- **Fix**: `.toLowerCase()` normalization on both sides before comparison.
|
|
202
|
+
|
|
203
|
+
12. **`ast_transform` try/catch Indentation Bug**
|
|
204
|
+
- `applyWrapTryCatch` added extra indent on top of existing indentation.
|
|
205
|
+
- **Fix**: Correct base-indent detection using last line of rawBody as closing-indent anchor.
|
|
206
|
+
|
|
207
|
+
### Added
|
|
208
|
+
|
|
209
|
+
#### 25 Tools (up from 13 in v3.6.x)
|
|
210
|
+
|
|
211
|
+
New tools added in this release:
|
|
212
|
+
|
|
213
|
+
| Tool | Purpose |
|
|
214
|
+
|------|---------|
|
|
215
|
+
| `ast_transform` | Declarative AST transforms: add_parameter, wrap_with_try_catch, add_decorator, change_return_type, extract_variable |
|
|
216
|
+
| `search_symbols` | AST-aware symbol search by name (fuzzy-capable), not text grep |
|
|
217
|
+
| `explain_symbol` | Signature + location + callers in one call |
|
|
218
|
+
| `batch_read` | Read N symbols from N files in 1 round-trip |
|
|
219
|
+
| `get_rate_limit_status` | Token balance + `canAfford` map per operation |
|
|
220
|
+
| `get_session_stats` | Per-session diagnostics (pending ops, locks, tokens) |
|
|
221
|
+
| `clear_session_cache` | Invalidate cache for current session only |
|
|
222
|
+
| `list_pending_operations` | Recovery listing after crash |
|
|
223
|
+
|
|
224
|
+
#### Architecture Improvements
|
|
225
|
+
|
|
226
|
+
- `SessionManager`: Per-client isolated state (locks, confirmations, rate limiter, cache pool)
|
|
227
|
+
- `safeRegexPool.ts` + `safeRegexApi.ts`: Worker pool split from monolithic `safeRegex.ts`
|
|
228
|
+
- `toctou.ts`: TOCTOU hash helpers extracted to own module
|
|
229
|
+
- `pendingStore.ts` + `pendingStoreInit.ts`: SQLite crash-recovery layer
|
|
230
|
+
- `toolDefinitionsAdmin.ts` + `toolDefinitionsCore.ts`: Tool definitions split from 1000-line index
|
|
231
|
+
- All `src/` files under 300 lines (from 1000-line monolith)
|
|
232
|
+
|
|
233
|
+
#### DX / Ergonomics
|
|
234
|
+
|
|
235
|
+
- `diffFormat` param on all write tools: `unified` | `compact` | `summary` | `none`
|
|
236
|
+
- Phase 2 does NOT require re-sending `newContent`/`code` (server stores from Phase 1)
|
|
237
|
+
- `aroundPattern` output includes `"Match found at line N (showing lines X-Y):"`
|
|
238
|
+
- `get_cache_stats` includes `hits`, `misses`, `hitRate`
|
|
239
|
+
- `get_file_watcher_status` includes `paths[]` (capped at 50)
|
|
240
|
+
- `get_server_stats` includes `rateLimiter.tokensAvailable` and `operationCosts`
|
|
241
|
+
- `MAX_FILES_REPO_MAP` = 2000 (was 500)
|
|
242
|
+
|
|
243
|
+
### Test Results
|
|
244
|
+
|
|
245
|
+
- **83/83 tests passing** (100%)
|
|
246
|
+
- Security tests: ✅
|
|
247
|
+
- File lock tests: ✅
|
|
248
|
+
- Rate limiter tests: ✅
|
|
249
|
+
- WASM parser tests (TS/PHP/Python/Dart): ✅
|
|
250
|
+
- Backup manager, diff, TOCTOU, cache, confirmation store: ✅
|
|
251
|
+
- Multi-process concurrency tests: ✅
|
|
252
|
+
- Performance tests: ✅
|
|
253
|
+
|
|
254
|
+
### Migration from v3.6.x
|
|
255
|
+
|
|
256
|
+
- **Zero breaking changes** in the public tool API.
|
|
257
|
+
- `parse_file` now returns `startLine`/`endLine` per symbol — additive, no breakage.
|
|
258
|
+
- New tools are purely additive.
|
|
259
|
+
- Session isolation is automatic — no configuration needed.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## [3.6.4] - 2026-05-14
|
|
264
|
+
|
|
265
|
+
### Added
|
|
266
|
+
- Language parsers: C#, Go, Java, Kotlin, Ruby, Rust (Tree-sitter WASM)
|
|
267
|
+
- `parse_file` returns `startLine`/`endLine` per symbol
|
|
268
|
+
- Fuzzy search with `fuzzyMatch` + `fuzzyThreshold` parameters
|
|
269
|
+
- Pagination via `startIndex` on `search_code_pattern`
|
|
270
|
+
- `diffFormat` parameter on write tools
|
|
271
|
+
|
|
272
|
+
### Fixed
|
|
273
|
+
- `parse_file` symbols missing line numbers
|
|
274
|
+
- CVE in `@modelcontextprotocol/sdk` (updated to 1.29.0)
|
|
275
|
+
- Incorrect TypeScript version `5.7.0` → `5.7.2`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## [3.6.1] - 2026-04-28
|
|
280
|
+
|
|
281
|
+
### Added
|
|
282
|
+
- Persistent WASM SQLite cache (`CacheManager`)
|
|
283
|
+
- Structured logging via pino (stderr-safe for MCP)
|
|
284
|
+
- File watcher via chokidar
|
|
285
|
+
- Multi-process file locking via proper-lockfile
|
|
286
|
+
- Rolling 5-version backup system
|
|
287
|
+
- `rollback_file` and `clean_backups` tools
|
|
288
|
+
- 74 tests (unit + integration + performance + stress)
|
package/INSTRUCTIONS.md
CHANGED
|
@@ -71,8 +71,8 @@ This MCP server provides **surgical code editing** with Tree-sitter AST parsing.
|
|
|
71
71
|
|
|
72
72
|
## 🚨 Critical Rules
|
|
73
73
|
|
|
74
|
-
### 1. **
|
|
75
|
-
|
|
74
|
+
### 1. **Project Root (Auto-Resolved in v7.0.0)**
|
|
75
|
+
While `projectRoot` is supported for explicit boundary locking, in v7.0.0 it is optional and automatically resolved from `filePath` or `rootDir` by walking up to the nearest project marker (`.git`, `package.json`, etc.). You can omit it without fear of boundary errors.
|
|
76
76
|
|
|
77
77
|
### 2. **NEVER Skip Phase 1**
|
|
78
78
|
Always preview diffs before applying. Tokens are stored in memory and expire on server restart.
|
|
@@ -253,14 +253,31 @@ newContent: "{ return 42; }"
|
|
|
253
253
|
|
|
254
254
|
---
|
|
255
255
|
|
|
256
|
-
## 🚀
|
|
256
|
+
## 🚀 v7.0.0 Features (Enterprise Polyglot)
|
|
257
257
|
|
|
258
|
-
###
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
258
|
+
### 53 Pure AST WebAssembly Tools
|
|
259
|
+
- ✅ **Full Enterprise Suite**: 53 pure AST tools with zero native compilation dependencies.
|
|
260
|
+
- ✅ **Structural S-Expression DSL**: `query_code_ast` with tree-sitter queries.
|
|
261
|
+
- ✅ **Fast Tree Diffing**: `incremental_ast_diff` with `tree.edit()`.
|
|
262
|
+
- ✅ **Metrics & Auditing**: `get_ast_complexity_matrix`, `detect_dead_ast_symbols`, `resolve_lexical_scope`, `sql_ast_validator`, `ast_codemod_transpile`, `detect_async_eventloop_blockers`, `verify_env_contract_drift`, `audit_error_handling_contracts`, `extract_api_route_matrix`, `flatten_class_hierarchy`, `detect_circular_dependencies`.
|
|
263
|
+
- ✅ **Startup Diagnostics**: Stdio initialization signature `[mcp-code-context] v7.0.0 running on stdio`.
|
|
262
264
|
|
|
263
|
-
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 🚀 Previous: v3.9.2 Features
|
|
268
|
+
|
|
269
|
+
### Core Improvements
|
|
270
|
+
- ✅ **Smart Project Root Discovery**: `resolveProjectRoot` & `findProjectRoot` automatically detect project markers (`.git`, `package.json`, `composer.json`, `pyproject.toml`, etc.), preventing boundary errors when `projectRoot` is omitted or undefined.
|
|
271
|
+
- ✅ **Optional Schema Requirements**: `projectRoot` is now optional across all tools in `CORE_TOOLS` and `ADMIN_TOOLS`, allowing LLM agents to execute surgical operations with just `filePath` or `rootDir`.
|
|
272
|
+
- ✅ **SecurityValidator Guard**: Robust handling of undefined/null boundaries, safely defaulting to `process.cwd()`.
|
|
273
|
+
- ✅ **Startup Diagnostics**: Stdio initialization signature `[mcp-code-context] v3.9.2 running on stdio`.
|
|
274
|
+
|
|
275
|
+
### Previously Added in v3.9.0 - v3.9.1
|
|
276
|
+
- ✅ **Ruby Intelligence**: `get_gemfile_context`, `find_metaprogramming`, `get_rails_routes`, and Rails concerns resolution in `analyze_impact`.
|
|
277
|
+
- ✅ **Semantic Repo Map Enhancements**: Injects `<gem>` behavior blocks and `<concern>` entries when Gemfile and concerns directories exist.
|
|
278
|
+
|
|
279
|
+
### Previously Added in v3.8.x
|
|
280
|
+
- ✅ **New Tools**: `get_session_stats`, `clear_session_cache`, `list_pending_operations`
|
|
264
281
|
- ✅ **Session-scoped state**: No state leakage between MCP clients
|
|
265
282
|
- ✅ **Crash recovery**: SQLite-backed pending operations store
|
|
266
283
|
- ✅ **Expanded ReDoS protection**: 15+ patterns (was 6)
|
|
@@ -288,6 +305,6 @@ See `llms.txt` for complete API reference and technical details.
|
|
|
288
305
|
|
|
289
306
|
---
|
|
290
307
|
|
|
291
|
-
**Version**:
|
|
292
|
-
**Last Updated**:
|
|
293
|
-
**Status**: Production-ready with session-scoped state
|
|
308
|
+
**Version**: 7.0.0
|
|
309
|
+
**Last Updated**: October 12, 2026
|
|
310
|
+
**Status**: Production-ready with smart project root discovery and session-scoped state
|