mcp-code-context 3.6.2 → 3.7.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 +140 -268
- package/INSTRUCTIONS.md +31 -12
- package/README.md +223 -107
- package/SECURITY.md +55 -21
- package/dist/src/core/cacheManager.d.ts +4 -5
- package/dist/src/core/cacheManager.js +49 -33
- package/dist/src/core/cacheManager.js.map +1 -1
- package/dist/src/core/engine.d.ts +1 -1
- package/dist/src/core/engine.js +3 -3
- package/dist/src/core/engine.js.map +1 -1
- package/dist/src/core/indexManager.d.ts +58 -0
- package/dist/src/core/indexManager.js +252 -0
- package/dist/src/core/indexManager.js.map +1 -0
- package/dist/src/core/indexManagerQueries.d.ts +14 -0
- package/dist/src/core/indexManagerQueries.js +95 -0
- package/dist/src/core/indexManagerQueries.js.map +1 -0
- package/dist/src/core/sessionManager.d.ts +117 -0
- package/dist/src/core/sessionManager.js +231 -0
- package/dist/src/core/sessionManager.js.map +1 -0
- package/dist/src/core/validator.d.ts +1 -1
- package/dist/src/core/validator.js +18 -10
- package/dist/src/core/validator.js.map +1 -1
- package/dist/src/index.d.ts +1 -13
- package/dist/src/index.js +25 -999
- package/dist/src/index.js.map +1 -1
- package/dist/src/operations/astTransform.d.ts +38 -0
- package/dist/src/operations/astTransform.js +239 -0
- package/dist/src/operations/astTransform.js.map +1 -0
- package/dist/src/operations/compress.d.ts +5 -3
- package/dist/src/operations/compress.js +73 -7
- package/dist/src/operations/compress.js.map +1 -1
- package/dist/src/operations/confirmationStore.d.ts +35 -8
- package/dist/src/operations/confirmationStore.js +112 -14
- package/dist/src/operations/confirmationStore.js.map +1 -1
- package/dist/src/operations/impactAnalysis.d.ts +9 -0
- package/dist/src/operations/impactAnalysis.js +61 -0
- package/dist/src/operations/impactAnalysis.js.map +1 -0
- package/dist/src/operations/pendingStore.d.ts +51 -0
- package/dist/src/operations/pendingStore.js +201 -0
- package/dist/src/operations/pendingStore.js.map +1 -0
- package/dist/src/operations/pendingStoreInit.d.ts +6 -0
- package/dist/src/operations/pendingStoreInit.js +42 -0
- package/dist/src/operations/pendingStoreInit.js.map +1 -0
- package/dist/src/operations/read.d.ts +6 -92
- package/dist/src/operations/read.js +4 -445
- package/dist/src/operations/read.js.map +1 -1
- package/dist/src/operations/readCore.d.ts +33 -0
- package/dist/src/operations/readCore.js +142 -0
- package/dist/src/operations/readCore.js.map +1 -0
- package/dist/src/operations/rename.d.ts +13 -0
- package/dist/src/operations/rename.js +130 -0
- package/dist/src/operations/rename.js.map +1 -0
- package/dist/src/operations/searchOperation.d.ts +16 -0
- package/dist/src/operations/searchOperation.js +113 -0
- package/dist/src/operations/searchOperation.js.map +1 -0
- package/dist/src/operations/symbolQuery.d.ts +38 -0
- package/dist/src/operations/symbolQuery.js +194 -0
- package/dist/src/operations/symbolQuery.js.map +1 -0
- package/dist/src/operations/write.d.ts +11 -14
- package/dist/src/operations/write.js +6 -125
- package/dist/src/operations/write.js.map +1 -1
- package/dist/src/parsers/base.d.ts +1 -1
- package/dist/src/parsers/base.js +1 -1
- package/dist/src/parsers/csharp.d.ts +12 -0
- package/dist/src/parsers/csharp.js +67 -0
- package/dist/src/parsers/csharp.js.map +1 -0
- package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
- package/dist/src/parsers/dartTreeSitter.js +1 -1
- package/dist/src/parsers/go.d.ts +11 -0
- package/dist/src/parsers/go.js +74 -0
- package/dist/src/parsers/go.js.map +1 -0
- package/dist/src/parsers/java.d.ts +12 -0
- package/dist/src/parsers/java.js +62 -0
- package/dist/src/parsers/java.js.map +1 -0
- package/dist/src/parsers/kotlin.d.ts +12 -0
- package/dist/src/parsers/kotlin.js +75 -0
- package/dist/src/parsers/kotlin.js.map +1 -0
- 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 +63 -2
- package/dist/src/parsers/registry.js.map +1 -1
- package/dist/src/parsers/ruby.d.ts +12 -0
- package/dist/src/parsers/ruby.js +73 -0
- package/dist/src/parsers/ruby.js.map +1 -0
- package/dist/src/parsers/rust.d.ts +12 -0
- package/dist/src/parsers/rust.js +66 -0
- package/dist/src/parsers/rust.js.map +1 -0
- package/dist/src/parsers/typescript.d.ts +1 -1
- package/dist/src/parsers/typescript.js +28 -38
- package/dist/src/parsers/typescript.js.map +1 -1
- package/dist/src/tools/adminHandlers.d.ts +67 -0
- package/dist/src/tools/adminHandlers.js +129 -0
- package/dist/src/tools/adminHandlers.js.map +1 -0
- package/dist/src/tools/context.d.ts +9 -0
- package/dist/src/tools/context.js +21 -0
- package/dist/src/tools/context.js.map +1 -0
- package/dist/src/tools/handlers.d.ts +4 -0
- package/dist/src/tools/handlers.js +5 -0
- package/dist/src/tools/handlers.js.map +1 -0
- package/dist/src/tools/pipeline.d.ts +6 -0
- package/dist/src/tools/pipeline.js +100 -0
- package/dist/src/tools/pipeline.js.map +1 -0
- package/dist/src/tools/readHandlers.d.ts +55 -0
- package/dist/src/tools/readHandlers.js +220 -0
- package/dist/src/tools/readHandlers.js.map +1 -0
- package/dist/src/tools/toolDefinitions.d.ts +1037 -0
- package/dist/src/tools/toolDefinitions.js +13 -0
- package/dist/src/tools/toolDefinitions.js.map +1 -0
- package/dist/src/tools/toolDefinitionsAdmin.d.ts +89 -0
- package/dist/src/tools/toolDefinitionsAdmin.js +99 -0
- package/dist/src/tools/toolDefinitionsAdmin.js.map +1 -0
- package/dist/src/tools/toolDefinitionsCore.d.ts +949 -0
- package/dist/src/tools/toolDefinitionsCore.js +267 -0
- package/dist/src/tools/toolDefinitionsCore.js.map +1 -0
- package/dist/src/tools/writeHandlers.d.ts +37 -0
- package/dist/src/tools/writeHandlers.js +199 -0
- package/dist/src/tools/writeHandlers.js.map +1 -0
- package/dist/src/utils/appDir.d.ts +19 -0
- package/dist/src/utils/appDir.js +50 -0
- package/dist/src/utils/appDir.js.map +1 -0
- package/dist/src/utils/auditLogWriter.d.ts +9 -0
- package/dist/src/utils/auditLogWriter.js +49 -0
- package/dist/src/utils/auditLogWriter.js.map +1 -0
- package/dist/src/utils/auditLogger.d.ts +1 -10
- package/dist/src/utils/auditLogger.js +14 -109
- package/dist/src/utils/auditLogger.js.map +1 -1
- package/dist/src/utils/auditQuery.d.ts +23 -0
- package/dist/src/utils/auditQuery.js +67 -0
- package/dist/src/utils/auditQuery.js.map +1 -0
- package/dist/src/utils/backupManager.d.ts +2 -2
- package/dist/src/utils/backupManager.js +29 -12
- package/dist/src/utils/backupManager.js.map +1 -1
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +8 -1
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/diff.d.ts +12 -1
- package/dist/src/utils/diff.js +41 -1
- package/dist/src/utils/diff.js.map +1 -1
- package/dist/src/utils/fileLock.d.ts +7 -2
- package/dist/src/utils/fileLock.js +14 -11
- package/dist/src/utils/fileLock.js.map +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/logger.d.ts +1 -1
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/utils/logger.js.map +1 -1
- package/dist/src/utils/rateLimiter.d.ts +9 -1
- package/dist/src/utils/rateLimiter.js +12 -1
- package/dist/src/utils/rateLimiter.js.map +1 -1
- package/dist/src/utils/regexValidator.d.ts +12 -0
- package/dist/src/utils/regexValidator.js +48 -0
- package/dist/src/utils/regexValidator.js.map +1 -0
- package/dist/src/utils/safeRegex.d.ts +2 -92
- package/dist/src/utils/safeRegex.js +41 -222
- package/dist/src/utils/safeRegex.js.map +1 -1
- package/dist/src/utils/safeRegexApi.d.ts +56 -0
- package/dist/src/utils/safeRegexApi.js +99 -0
- package/dist/src/utils/safeRegexApi.js.map +1 -0
- package/dist/src/utils/safeRegexPool.d.ts +7 -0
- package/dist/src/utils/safeRegexPool.js +102 -0
- package/dist/src/utils/safeRegexPool.js.map +1 -0
- package/dist/src/utils/searchTools.js +6 -6
- package/dist/src/utils/searchTools.js.map +1 -1
- package/dist/src/utils/streaming.d.ts +4 -3
- package/dist/src/utils/streaming.js +1 -1
- package/dist/src/utils/streaming.js.map +1 -1
- package/dist/src/utils/telemetry.d.ts +1 -1
- package/dist/src/utils/telemetry.js +1 -1
- package/dist/src/utils/toctou.d.ts +7 -0
- package/dist/src/utils/toctou.js +24 -0
- package/dist/src/utils/toctou.js.map +1 -0
- package/llms.txt +199 -31
- package/package.json +2 -2
- package/scripts/replace-version.js +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -1,268 +1,140 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [3.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Fixed
|
|
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
|
-
- ✅ 47/47 WASM parser tests passing (100%)
|
|
142
|
-
- ✅ All security tests passing
|
|
143
|
-
- ✅ All rate limiter tests passing
|
|
144
|
-
- ✅ All file lock tests passing
|
|
145
|
-
- ✅ All v3.6.2 feature tests passing
|
|
146
|
-
- ✅ TypeScript: 0 compilation errors
|
|
147
|
-
- ✅ Build: Clean production dist
|
|
148
|
-
|
|
149
|
-
### Migration from v3.1.0
|
|
150
|
-
- Add `projectRoot` parameter to all tool calls
|
|
151
|
-
- Optional: Use `confirm: false` for dry-run, then `confirm: true` with token
|
|
152
|
-
- Optional: Call `get_server_stats` to monitor operations
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## [3.1.0] - 2026-04-24
|
|
157
|
-
|
|
158
|
-
### 🚀 FEATURE COMPLETE - All 11 Tools Implemented
|
|
159
|
-
|
|
160
|
-
**Major Update**: Added 7 missing tools from v2.6.0 to achieve feature parity
|
|
161
|
-
|
|
162
|
-
### Added
|
|
163
|
-
- **get_semantic_repo_map**: Compress entire repositories to structural signatures
|
|
164
|
-
- **read_file_surgical**: Extract specific symbols from files
|
|
165
|
-
- **analyze_impact**: Find all files that depend on a given file
|
|
166
|
-
- **read_file_lines**: Read specific line ranges from files
|
|
167
|
-
- **search_code_pattern**: Search for patterns across multiple files
|
|
168
|
-
- **rename_symbol**: Rename symbols across entire repository
|
|
169
|
-
|
|
170
|
-
### Summary
|
|
171
|
-
- ✅ 11/11 tools from v2.6.0 now implemented
|
|
172
|
-
- ✅ 100% WASM portability maintained
|
|
173
|
-
- ✅ Zero native dependencies
|
|
174
|
-
- ✅ Feature parity with v2.6.0 achieved
|
|
175
|
-
- ✅ Tree-sitter WASM for 100% AST accuracy
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## [3.0.6] - 2026-04-24
|
|
180
|
-
|
|
181
|
-
### 🚀 COMPLETE REWRITE - Tree-sitter WASM Edition
|
|
182
|
-
|
|
183
|
-
**Breaking Changes**: Complete architecture overhaul with 100% WASM portability
|
|
184
|
-
|
|
185
|
-
### Added
|
|
186
|
-
- **Tree-sitter WASM Parsers**: 100% AST accuracy for TypeScript/JavaScript/Python/PHP/Dart
|
|
187
|
-
- **Zero Native Dependencies**: No Visual Studio, node-gyp, or Python required
|
|
188
|
-
- **Cross-Platform Portability**: Works on Windows/Mac/Linux without compilation
|
|
189
|
-
- **Dart AST Support**: Full Tree-sitter parsing (no regex fallback)
|
|
190
|
-
- **Mandatory Security Boundaries**: projectRoot required for all operations
|
|
191
|
-
- **Async-First Architecture**: Zero blocking I/O
|
|
192
|
-
- **Simplified Core**: Engine + Registry + Validator pattern
|
|
193
|
-
- **Smart WASM Path Resolution**: Finds WASM files in installed module location (not CWD)
|
|
194
|
-
|
|
195
|
-
### Changed
|
|
196
|
-
- **CRITICAL**: Migrated from tree-sitter native to web-tree-sitter@0.25.1
|
|
197
|
-
- Uses tree-sitter-wasms@0.1.13 for language grammars (ABI v15)
|
|
198
|
-
- Parser API: `cursor.currentNode` is now getter (not function call)
|
|
199
|
-
- Language loading: `Language.load(buffer)` with fs.readFileSync
|
|
200
|
-
- WASM path resolution: Uses `import.meta.url` for module-relative paths
|
|
201
|
-
- Replaced ts-morph with tree-sitter WASM
|
|
202
|
-
- Replaced php-parser with tree-sitter-php WASM
|
|
203
|
-
- Simplified from 9,518 lines to ~600 lines of core code
|
|
204
|
-
|
|
205
|
-
### Removed
|
|
206
|
-
- Native tree-sitter bindings (node-gyp dependency)
|
|
207
|
-
- Legacy v2.x handlers (readHandlers, writeHandlers, utilHandlers)
|
|
208
|
-
- php-parser dependency
|
|
209
|
-
- ts-morph dependency
|
|
210
|
-
- Regex-based Dart parser fallback
|
|
211
|
-
|
|
212
|
-
### Fixed
|
|
213
|
-
- **npx compatibility**: Works with `npx -y mcp-code-context@3.1.0`
|
|
214
|
-
- **WASM loading**: Finds WASM files when installed globally or locally
|
|
215
|
-
- **Windows support**: Full compatibility with Claude Desktop on Windows
|
|
216
|
-
|
|
217
|
-
### Performance
|
|
218
|
-
- 100% accuracy on TypeScript/JavaScript/Python/PHP/Dart parsing
|
|
219
|
-
- Zero regex-based parsing
|
|
220
|
-
- Cursor-based tree traversal (efficient)
|
|
221
|
-
- WASM overhead: ~10-20% slower than native, but portable
|
|
222
|
-
|
|
223
|
-
### Security
|
|
224
|
-
- Mandatory project boundary enforcement
|
|
225
|
-
- Path traversal protection
|
|
226
|
-
- Async file validation
|
|
227
|
-
- No native code execution (WASM sandbox)
|
|
228
|
-
|
|
229
|
-
### Validation
|
|
230
|
-
- ✅ 47/47 unit tests passing (100%)
|
|
231
|
-
- ✅ Dart: 4 symbols detected (class, methods, functions)
|
|
232
|
-
- ✅ TypeScript: 4 symbols detected (class, constructor, methods, functions)
|
|
233
|
-
- ✅ Python: 12/12 tests passing
|
|
234
|
-
- ✅ PHP: 11/11 tests passing
|
|
235
|
-
- ✅ Build passes without TypeScript errors
|
|
236
|
-
- ✅ No native dependencies in package.json
|
|
237
|
-
|
|
238
|
-
### Migration Guide
|
|
239
|
-
v2.x users: This is a ground-up rewrite. v2.x tools are not compatible.
|
|
240
|
-
New API focuses on parse_file with Tree-sitter WASM accuracy.
|
|
241
|
-
|
|
242
|
-
**Installation**: Just `npm install` - no build tools required!
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## [2.6.0] - 2024-01-16
|
|
247
|
-
|
|
248
|
-
### 🚀 Performance & Scalability
|
|
249
|
-
|
|
250
|
-
- **Async I/O Migration**: Eliminated all synchronous file operations
|
|
251
|
-
- `ignoreManager.walkDirectory()` now fully async
|
|
252
|
-
- No event loop blocking on large repositories
|
|
253
|
-
- 3x faster on repos with 1000+ files
|
|
254
|
-
- Impact: Scalability 4.0 → 9.0 (+5.0)
|
|
255
|
-
|
|
256
|
-
- **Fuzzy Match Threshold**: Reduced noise in symbol suggestions
|
|
257
|
-
- Added `maxDistance` parameter (default: 3 edits)
|
|
258
|
-
- Filters out irrelevant suggestions
|
|
259
|
-
- Better UX when symbol not found
|
|
260
|
-
|
|
261
|
-
### 📊 Metrics Improvement
|
|
262
|
-
- Scalability: 4.0 → 9.0 (+5.0) ✅
|
|
263
|
-
- Overall: 8.1 → 9.3 (+1.2)
|
|
264
|
-
|
|
265
|
-
### Technical
|
|
266
|
-
- All 149 tests passing
|
|
267
|
-
- Zero breaking changes
|
|
268
|
-
- Backward compatible
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [3.7.0] - 2026-06-18
|
|
4
|
+
|
|
5
|
+
### 🚀 Production Readiness Release — Adversarial Audit Hardening
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
### Fixed — Critical (Production Blockers)
|
|
10
|
+
|
|
11
|
+
1. **Session State Leakage / Memory Leak**
|
|
12
|
+
- Global state (`globalLockManager`, `globalConfirmationStore`, `rateLimiter`) accumulated across client sessions with no cleanup.
|
|
13
|
+
- **Fix**: `SessionManager` per-client state isolation with LRU eviction and 30-min timeout cleanup.
|
|
14
|
+
|
|
15
|
+
2. **No Phase 1 Crash Recovery**
|
|
16
|
+
- Pending operations stored in memory only. Server crash between Phase 1 → Phase 2 lost all work.
|
|
17
|
+
- **Fix**: SQLite-backed `PendingOperationStore` — operations persist across restarts.
|
|
18
|
+
|
|
19
|
+
3. **TOCTOU in Multi-File Writes**
|
|
20
|
+
- Phase 2 only verified hash of the primary file, not dependent files in `pendingWrites`.
|
|
21
|
+
- **Fix**: Hash verified on all files in the write set before applying.
|
|
22
|
+
|
|
23
|
+
4. **Symlink Boundary Escape**
|
|
24
|
+
- `path.resolve()` used for boundary validation — does not follow symlinks.
|
|
25
|
+
- **Fix**: `fs.realpath()` in `SecurityValidator.validateFilePath()`.
|
|
26
|
+
|
|
27
|
+
5. **`new Promise(async ...)` Anti-pattern in Worker**
|
|
28
|
+
- `runInWorker` used `new Promise(async (resolve) => ...)` — swallowed async errors.
|
|
29
|
+
- **Fix**: Refactored to standard async/await pattern.
|
|
30
|
+
|
|
31
|
+
6. **`WORKER_FILE` Resolved at Import-Time**
|
|
32
|
+
- Worker path calculated before `dist/` exists — crashes on fresh install.
|
|
33
|
+
- **Fix**: Lazy `getWorkerFile()` evaluated at runtime.
|
|
34
|
+
|
|
35
|
+
7. **ReDoS in `impactAnalysis`, `rename`, `readCore`**
|
|
36
|
+
- Dynamic `new RegExp()` constructed in main thread without timeout.
|
|
37
|
+
- **Fix**: All operation-level regex routed through `safeRegex` worker pool.
|
|
38
|
+
|
|
39
|
+
8. **Rate Limiter Shared Globally**
|
|
40
|
+
- Single `'global'` bucket shared across all MCP clients.
|
|
41
|
+
- **Fix**: Per-session `SESSION_ID` (pid-based) rate limiting.
|
|
42
|
+
|
|
43
|
+
9. **`configure_file_watcher` Without `rootDir` Validation**
|
|
44
|
+
- Watcher path not validated through `SecurityValidator`.
|
|
45
|
+
- **Fix**: Watcher uses only validated `projectRoot`.
|
|
46
|
+
|
|
47
|
+
10. **Confirmation Token Leak Without Cleanup**
|
|
48
|
+
- Expired tokens accumulated in memory indefinitely.
|
|
49
|
+
- **Fix**: `setInterval` 60s cleanup in `ConfirmationStore`.
|
|
50
|
+
|
|
51
|
+
11. **Windows Path Case Sensitivity in Boundary Check**
|
|
52
|
+
- `fs.realpath()` returns `C:\` (uppercase), `path.resolve()` returns `c:\` (lowercase).
|
|
53
|
+
- **Fix**: `.toLowerCase()` normalization on both sides before comparison.
|
|
54
|
+
|
|
55
|
+
12. **`ast_transform` try/catch Indentation Bug**
|
|
56
|
+
- `applyWrapTryCatch` added extra indent on top of existing indentation.
|
|
57
|
+
- **Fix**: Correct base-indent detection using last line of rawBody as closing-indent anchor.
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
#### 25 Tools (up from 13 in v3.6.x)
|
|
62
|
+
|
|
63
|
+
New tools added in this release:
|
|
64
|
+
|
|
65
|
+
| Tool | Purpose |
|
|
66
|
+
|------|---------|
|
|
67
|
+
| `ast_transform` | Declarative AST transforms: add_parameter, wrap_with_try_catch, add_decorator, change_return_type, extract_variable |
|
|
68
|
+
| `search_symbols` | AST-aware symbol search by name (fuzzy-capable), not text grep |
|
|
69
|
+
| `explain_symbol` | Signature + location + callers in one call |
|
|
70
|
+
| `batch_read` | Read N symbols from N files in 1 round-trip |
|
|
71
|
+
| `get_rate_limit_status` | Token balance + `canAfford` map per operation |
|
|
72
|
+
| `get_session_stats` | Per-session diagnostics (pending ops, locks, tokens) |
|
|
73
|
+
| `clear_session_cache` | Invalidate cache for current session only |
|
|
74
|
+
| `list_pending_operations` | Recovery listing after crash |
|
|
75
|
+
|
|
76
|
+
#### Architecture Improvements
|
|
77
|
+
|
|
78
|
+
- `SessionManager`: Per-client isolated state (locks, confirmations, rate limiter, cache pool)
|
|
79
|
+
- `safeRegexPool.ts` + `safeRegexApi.ts`: Worker pool split from monolithic `safeRegex.ts`
|
|
80
|
+
- `toctou.ts`: TOCTOU hash helpers extracted to own module
|
|
81
|
+
- `pendingStore.ts` + `pendingStoreInit.ts`: SQLite crash-recovery layer
|
|
82
|
+
- `toolDefinitionsAdmin.ts` + `toolDefinitionsCore.ts`: Tool definitions split from 1000-line index
|
|
83
|
+
- All `src/` files under 300 lines (from 1000-line monolith)
|
|
84
|
+
|
|
85
|
+
#### DX / Ergonomics
|
|
86
|
+
|
|
87
|
+
- `diffFormat` param on all write tools: `unified` | `compact` | `summary` | `none`
|
|
88
|
+
- Phase 2 does NOT require re-sending `newContent`/`code` (server stores from Phase 1)
|
|
89
|
+
- `aroundPattern` output includes `"Match found at line N (showing lines X-Y):"`
|
|
90
|
+
- `get_cache_stats` includes `hits`, `misses`, `hitRate`
|
|
91
|
+
- `get_file_watcher_status` includes `paths[]` (capped at 50)
|
|
92
|
+
- `get_server_stats` includes `rateLimiter.tokensAvailable` and `operationCosts`
|
|
93
|
+
- `MAX_FILES_REPO_MAP` = 2000 (was 500)
|
|
94
|
+
|
|
95
|
+
### Test Results
|
|
96
|
+
|
|
97
|
+
- **83/83 tests passing** (100%)
|
|
98
|
+
- Security tests: ✅
|
|
99
|
+
- File lock tests: ✅
|
|
100
|
+
- Rate limiter tests: ✅
|
|
101
|
+
- WASM parser tests (TS/PHP/Python/Dart): ✅
|
|
102
|
+
- Backup manager, diff, TOCTOU, cache, confirmation store: ✅
|
|
103
|
+
- Multi-process concurrency tests: ✅
|
|
104
|
+
- Performance tests: ✅
|
|
105
|
+
|
|
106
|
+
### Migration from v3.6.x
|
|
107
|
+
|
|
108
|
+
- **Zero breaking changes** in the public tool API.
|
|
109
|
+
- `parse_file` now returns `startLine`/`endLine` per symbol — additive, no breakage.
|
|
110
|
+
- New tools are purely additive.
|
|
111
|
+
- Session isolation is automatic — no configuration needed.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## [3.6.4] - 2026-05-14
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
- Language parsers: C#, Go, Java, Kotlin, Ruby, Rust (Tree-sitter WASM)
|
|
119
|
+
- `parse_file` returns `startLine`/`endLine` per symbol
|
|
120
|
+
- Fuzzy search with `fuzzyMatch` + `fuzzyThreshold` parameters
|
|
121
|
+
- Pagination via `startIndex` on `search_code_pattern`
|
|
122
|
+
- `diffFormat` parameter on write tools
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
- `parse_file` symbols missing line numbers
|
|
126
|
+
- CVE in `@modelcontextprotocol/sdk` (updated to 1.29.0)
|
|
127
|
+
- Incorrect TypeScript version `5.7.0` → `5.7.2`
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## [3.6.1] - 2026-04-28
|
|
132
|
+
|
|
133
|
+
### Added
|
|
134
|
+
- Persistent WASM SQLite cache (`CacheManager`)
|
|
135
|
+
- Structured logging via pino (stderr-safe for MCP)
|
|
136
|
+
- File watcher via chokidar
|
|
137
|
+
- Multi-process file locking via proper-lockfile
|
|
138
|
+
- Rolling 5-version backup system
|
|
139
|
+
- `rollback_file` and `clean_backups` tools
|
|
140
|
+
- 74 tests (unit + integration + performance + stress)
|
package/INSTRUCTIONS.md
CHANGED
|
@@ -108,7 +108,7 @@ newContent: "return `Hello, ${name}`;"
|
|
|
108
108
|
maxResults: 10
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
### Fuzzy Search
|
|
111
|
+
### Fuzzy Search
|
|
112
112
|
```
|
|
113
113
|
@mcp-code-context/search_code_pattern
|
|
114
114
|
rootDir: /project/root
|
|
@@ -189,14 +189,14 @@ Rename across entire codebase in one operation:
|
|
|
189
189
|
## ⚠️ Common Mistakes
|
|
190
190
|
|
|
191
191
|
### ❌ Mistake 1: Forgetting projectRoot
|
|
192
|
-
```
|
|
192
|
+
```typescript
|
|
193
193
|
// WRONG
|
|
194
194
|
@mcp-code-context/read_file_surgical
|
|
195
195
|
filePath: /path/to/file.ts
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
### ❌ Mistake 2: Skipping Phase 1
|
|
199
|
-
```
|
|
199
|
+
```typescript
|
|
200
200
|
// WRONG - No preview
|
|
201
201
|
@mcp-code-context/write_file_surgical
|
|
202
202
|
confirm: true
|
|
@@ -204,13 +204,13 @@ Rename across entire codebase in one operation:
|
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
### ❌ Mistake 3: Incomplete Symbol Code
|
|
207
|
-
```
|
|
207
|
+
```typescript
|
|
208
208
|
// WRONG - Missing function signature
|
|
209
209
|
newContent: "{ return 42; }"
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
### ❌ Mistake 4: Not Checking Impact
|
|
213
|
-
```
|
|
213
|
+
```typescript
|
|
214
214
|
// WRONG - Removing without checking dependencies
|
|
215
215
|
@mcp-code-context/remove_symbol
|
|
216
216
|
symbolName: importantFunction
|
|
@@ -253,14 +253,32 @@ newContent: "{ return 42; }"
|
|
|
253
253
|
|
|
254
254
|
---
|
|
255
255
|
|
|
256
|
-
## 🚀 v3.
|
|
257
|
-
|
|
256
|
+
## 🚀 v3.7.0 Features
|
|
257
|
+
|
|
258
|
+
### New Tools
|
|
259
|
+
- **`get_session_stats`**: Session-scoped stats (pending ops, locks held, rate limiter tokens)
|
|
260
|
+
- **`clear_session_cache`**: Clear cache for current session only (no impact on other clients)
|
|
261
|
+
- **`list_pending_operations`**: List all pending operations (for recovery after crash)
|
|
262
|
+
|
|
263
|
+
### Improvements
|
|
264
|
+
- ✅ **Session-scoped state**: No state leakage between MCP clients
|
|
265
|
+
- ✅ **Crash recovery**: SQLite-backed pending operations store
|
|
266
|
+
- ✅ **Expanded ReDoS protection**: 15+ patterns (was 6)
|
|
267
|
+
- ✅ **Auto-persist before eviction**: Cache data preserved
|
|
268
|
+
- ✅ **Higher file limits**: MAX_FILES = 2000 (was 500)
|
|
269
|
+
|
|
270
|
+
### Previously Added in v3.7.0
|
|
271
|
+
- ✅ **4 New Tools**: `search_symbols`, `explain_symbol`, `batch_read`, `get_rate_limit_status`
|
|
272
|
+
- ✅ **`diffFormat`**: Control diff verbosity (`unified`, `compact`, `summary`, `none`)
|
|
273
|
+
- ✅ **Phase 2 optimized**: No need to resend `newContent`/`code` — server stores it from Phase 1
|
|
274
|
+
- ✅ **`aroundPattern` line number**: Output now shows `Match found at line N`
|
|
275
|
+
- ✅ **Rate limiter in stats**: `get_server_stats` includes token balance and operation costs
|
|
276
|
+
- ✅ **Cache hit rate**: `get_cache_stats` includes `hits`, `misses`, `hitRate`
|
|
277
|
+
- ✅ **Watcher paths**: `get_file_watcher_status` includes list of watched files
|
|
258
278
|
- ✅ **Fuzzy Search**: Find similar patterns with typo tolerance
|
|
259
279
|
- ✅ **Pagination**: Default 10 results, use `startIndex` for more
|
|
260
|
-
- ✅ **Token Optimization**: Phase 2 no longer repeats diff (97% savings)
|
|
261
|
-
- ✅ **Auto-Optimize**: Large repos automatically disable symbols
|
|
262
|
-
- ✅ **File Watcher**: Auto-invalidate cache on file changes
|
|
263
280
|
- ✅ **Persistent Cache**: 10x faster with sql.js WASM SQLite
|
|
281
|
+
- ✅ **File Watcher**: Auto-invalidate cache on file changes
|
|
264
282
|
|
|
265
283
|
---
|
|
266
284
|
|
|
@@ -270,5 +288,6 @@ See `llms.txt` for complete API reference and technical details.
|
|
|
270
288
|
|
|
271
289
|
---
|
|
272
290
|
|
|
273
|
-
**Version**: 3.
|
|
274
|
-
**Last Updated**:
|
|
291
|
+
**Version**: 3.7.0
|
|
292
|
+
**Last Updated**: June 8, 2026
|
|
293
|
+
**Status**: Production-ready with session-scoped state and crash recovery
|