mcp-code-context 3.9.0 → 3.9.1
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 +10 -0
- package/INSTRUCTIONS.md +2 -2
- package/README.md +23 -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 +1 -1
- package/dist/src/core/sessionManager.d.ts +1 -1
- package/dist/src/core/sessionManager.js +1 -1
- package/dist/src/core/validator.d.ts +1 -1
- package/dist/src/core/validator.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/operations/astTransform.d.ts +1 -1
- package/dist/src/operations/astTransform.js +1 -1
- package/dist/src/operations/compress.d.ts +1 -1
- package/dist/src/operations/compress.js +1 -1
- package/dist/src/operations/confirmationStore.d.ts +1 -1
- package/dist/src/operations/confirmationStore.js +1 -1
- package/dist/src/operations/write.d.ts +1 -1
- package/dist/src/operations/write.js +1 -1
- package/dist/src/parsers/base.d.ts +2 -2
- package/dist/src/parsers/base.js +2 -2
- 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 +2 -2
- package/dist/src/parsers/python.js +2 -2
- package/dist/src/parsers/registry.d.ts +1 -1
- package/dist/src/parsers/registry.js +1 -1
- package/dist/src/parsers/ruby.d.ts +2 -2
- package/dist/src/parsers/ruby.js +2 -2
- 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/pipeline.js +1 -1
- package/dist/src/tools/toolDefinitionsCore.js +3 -3
- 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/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +1 -1
- package/dist/src/utils/diff.d.ts +2 -2
- package/dist/src/utils/diff.js +2 -2
- 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/railsRoutes.d.ts +4 -3
- package/dist/src/utils/railsRoutes.js +62 -67
- package/dist/src/utils/railsRoutes.js.map +1 -1
- package/dist/src/utils/rateLimiter.d.ts +1 -1
- package/dist/src/utils/rateLimiter.js +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/llms.txt +52 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.9.1] - 2026-07-17
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`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.
|
|
8
|
+
- **`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.
|
|
9
|
+
- **`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.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
3
13
|
## [3.9.0] - 2026-07-17
|
|
4
14
|
|
|
5
15
|
### Added
|
package/INSTRUCTIONS.md
CHANGED
|
@@ -253,7 +253,7 @@ newContent: "{ return 42; }"
|
|
|
253
253
|
|
|
254
254
|
---
|
|
255
255
|
|
|
256
|
-
## 🚀 v3.9.
|
|
256
|
+
## 🚀 v3.9.1 Features
|
|
257
257
|
|
|
258
258
|
### New Tools
|
|
259
259
|
- **`get_session_stats`**: Session-scoped stats (pending ops, locks held, rate limiter tokens)
|
|
@@ -288,6 +288,6 @@ See `llms.txt` for complete API reference and technical details.
|
|
|
288
288
|
|
|
289
289
|
---
|
|
290
290
|
|
|
291
|
-
**Version**: 3.9.
|
|
291
|
+
**Version**: 3.9.1
|
|
292
292
|
**Last Updated**: June 8, 2026
|
|
293
293
|
**Status**: Production-ready with session-scoped state and crash recovery
|
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
75
75
|
|
|
76
76
|
### Production-Ready Features
|
|
77
77
|
|
|
78
|
-
| Feature | v3.6.x | v3.9.
|
|
78
|
+
| Feature | v3.6.x | v3.9.1 | Benefit |
|
|
79
79
|
|---------|--------|--------|---------|
|
|
80
80
|
| Multi-process safety | ✅ | ✅ | No file corruption |
|
|
81
81
|
| Persistent cache | ✅ | ✅ | <100ms cache hits |
|
|
@@ -88,13 +88,22 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
88
88
|
|
|
89
89
|
## Features
|
|
90
90
|
|
|
91
|
-
### What's New in v3.9.
|
|
91
|
+
### What's New in v3.9.1
|
|
92
92
|
|
|
93
93
|
| Feature | Description |
|
|
94
94
|
|---------|-------------|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
95
|
+
| 🐛 **`get_rails_routes` namespace fix** | Routes inside `namespace :admin do` now correctly produce `/admin/users` paths and `admin/users` controllers. Rewrote parser with indentation-based stack (was fragile do/end counter). |
|
|
96
|
+
| 🗺️ **Repo map: Gems + Concerns** | `get_semantic_repo_map` now appends `<gem>` behavior blocks and `<concern>` entries when Gemfile and concerns directories are present. |
|
|
97
|
+
| 🔧 **`get_rails_routes` nested scopes** | Supports `namespace :api do / namespace :v1 do` double-nesting, `member do` blocks, and `scope` (URL-only prefix). |
|
|
98
|
+
|
|
99
|
+
### Previous: v3.9.0
|
|
100
|
+
|
|
101
|
+
| Feature | Description |
|
|
102
|
+
|---------|-------------|
|
|
103
|
+
| 💎 **`get_gemfile_context`** | Parses Gemfile and returns implicit gem behaviors (devise adds `current_user`, sidekiq adds `perform_async`, etc.) |
|
|
104
|
+
| 🔍 **`find_metaprogramming`** | Scans Ruby files for `define_method`, `method_missing`, `class_eval`, `ActiveSupport::Concern`, `delegate`, `has_many :through` etc. |
|
|
105
|
+
| 🗺️ **`get_rails_routes`** | Parses `config/routes.rb` into structured route map (method, path, controller, action) |
|
|
106
|
+
| 🔗 **Concern resolution in `analyze_impact`** | `rubyModuleResolvesToFile()` checks concerns directories — no more false positives from `include Comparable` |
|
|
98
107
|
|
|
99
108
|
### Previous: v3.8.0
|
|
100
109
|
|
|
@@ -172,7 +181,7 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
172
181
|
|
|
173
182
|
### `get_semantic_repo_map` Tool
|
|
174
183
|
|
|
175
|
-
- **Max files**: Limited to 2000 files to prevent timeouts (increased from 500 in v3.9.
|
|
184
|
+
- **Max files**: Limited to 2000 files to prevent timeouts (increased from 500 in v3.9.1)
|
|
176
185
|
- **Performance**: Synchronous I/O may take 10-30 seconds on large repositories
|
|
177
186
|
- **Recommendation**: Use `@folder` syntax to target specific directories
|
|
178
187
|
|
|
@@ -199,13 +208,13 @@ npx -y mcp-code-context
|
|
|
199
208
|
|
|
200
209
|
---
|
|
201
210
|
|
|
202
|
-
## Session State (v3.9.
|
|
211
|
+
## Session State (v3.9.1+)
|
|
203
212
|
|
|
204
|
-
**Important**: v3.9.
|
|
213
|
+
**Important**: v3.9.1 introduces **session-scoped state** for each MCP client connection. This prevents state leakage when multiple agents (Amazon Q, Kiro, Cursor, etc.) use the same server instance.
|
|
205
214
|
|
|
206
215
|
### What Changed
|
|
207
216
|
|
|
208
|
-
| Before (v3.6.x) | After (v3.9.
|
|
217
|
+
| Before (v3.6.x) | After (v3.9.1) |
|
|
209
218
|
|----------------|----------------|
|
|
210
219
|
| Global `LockManager` (shared by all clients) | Session-scoped `sessionStates` Map |
|
|
211
220
|
| Global `ConfirmationStore` (in-memory Map) | Session-scoped confirmation store + SQLite persistence |
|
|
@@ -233,8 +242,11 @@ npx -y mcp-code-context
|
|
|
233
242
|
}
|
|
234
243
|
```
|
|
235
244
|
|
|
236
|
-
###
|
|
245
|
+
### Ruby Intelligence Tools (v3.9.x)
|
|
237
246
|
|
|
247
|
+
- `get_gemfile_context` — Parse Gemfile, get implicit gem behaviors (devise, sidekiq, pundit, etc.)
|
|
248
|
+
- `find_metaprogramming` — Scan for `define_method`, `method_missing`, `class_eval`, concerns, `has_many :through`
|
|
249
|
+
- `get_rails_routes` — Parse `config/routes.rb` into structured route map with namespace support
|
|
238
250
|
- `get_session_stats` — Get stats for current session only
|
|
239
251
|
- `clear_session_cache` — Clear cache for current session only
|
|
240
252
|
- `list_pending_operations` — List pending operations for recovery
|
|
@@ -537,7 +549,7 @@ npm run dev
|
|
|
537
549
|
- **Portability:** 100% WASM - no native dependencies, works on all platforms
|
|
538
550
|
- **Tests:** 83 passing (unit + integration + performance + stress)
|
|
539
551
|
|
|
540
|
-
### v3.9.
|
|
552
|
+
### v3.9.1 Key Changes
|
|
541
553
|
|
|
542
554
|
| Component | Change | Benefit |
|
|
543
555
|
|-----------|--------|---------|
|
package/dist/src/core/engine.js
CHANGED
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* mcp-code-context v3.9.
|
|
3
|
+
* mcp-code-context v3.9.1 - Tree-sitter WASM Edition (thin bootstrap)
|
|
4
4
|
*/
|
|
5
5
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -13,7 +13,7 @@ import { TOOLS } from "./tools/toolDefinitions.js";
|
|
|
13
13
|
import { setServerInstances } from "./tools/context.js";
|
|
14
14
|
import { registerPipeline } from "./tools/pipeline.js";
|
|
15
15
|
const SERVER_NAME = "mcp-code-context";
|
|
16
|
-
const SERVER_VERSION = "3.9.
|
|
16
|
+
const SERVER_VERSION = "3.9.1";
|
|
17
17
|
const server = new Server({ name: SERVER_NAME, version: SERVER_VERSION }, { capabilities: { tools: {} } });
|
|
18
18
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
19
19
|
registerPipeline(server);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Base Parser - v3.9.
|
|
2
|
+
* Base Parser - v3.9.1
|
|
3
3
|
* Abstract base for all language parsers
|
|
4
4
|
* IMPROVEMENT: replaceSymbol moved here using AST indices (eliminates indexOf fragility)
|
|
5
|
-
* v3.9.
|
|
5
|
+
* v3.9.1: getInsideStartIndex/getInsideEndIndex overridable for brace-less languages
|
|
6
6
|
*/
|
|
7
7
|
import { Parser, Tree, Language } from "web-tree-sitter";
|
|
8
8
|
export interface ParseResult {
|
package/dist/src/parsers/base.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Base Parser - v3.9.
|
|
2
|
+
* Base Parser - v3.9.1
|
|
3
3
|
* Abstract base for all language parsers
|
|
4
4
|
* IMPROVEMENT: replaceSymbol moved here using AST indices (eliminates indexOf fragility)
|
|
5
|
-
* v3.9.
|
|
5
|
+
* v3.9.1: getInsideStartIndex/getInsideEndIndex overridable for brace-less languages
|
|
6
6
|
*/
|
|
7
7
|
export class BaseParser {
|
|
8
8
|
parser;
|
package/dist/src/parsers/go.d.ts
CHANGED
package/dist/src/parsers/go.js
CHANGED
package/dist/src/parsers/java.js
CHANGED
package/dist/src/parsers/php.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Python Parser - v3.9.
|
|
2
|
+
* Python Parser - v3.9.1
|
|
3
3
|
* CLEANUP: replaceSymbol removed (inherited from BaseParser)
|
|
4
|
-
* v3.9.
|
|
4
|
+
* v3.9.1: override getInsideStartIndex/getInsideEndIndex for indentation-based syntax
|
|
5
5
|
*/
|
|
6
6
|
import { Tree } from "web-tree-sitter";
|
|
7
7
|
import { BaseParser, SymbolInfo } from "./base.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Python Parser - v3.9.
|
|
2
|
+
* Python Parser - v3.9.1
|
|
3
3
|
* CLEANUP: replaceSymbol removed (inherited from BaseParser)
|
|
4
|
-
* v3.9.
|
|
4
|
+
* v3.9.1: override getInsideStartIndex/getInsideEndIndex for indentation-based syntax
|
|
5
5
|
*/
|
|
6
6
|
import { BaseParser } from "./base.js";
|
|
7
7
|
export class PythonParser extends BaseParser {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ruby Parser - v3.9.
|
|
2
|
+
* Ruby Parser - v3.9.1
|
|
3
3
|
* Tree-sitter based Ruby parser
|
|
4
|
-
* v3.9.
|
|
4
|
+
* v3.9.1: override getInsideStartIndex/getInsideEndIndex for end-based syntax
|
|
5
5
|
*/
|
|
6
6
|
import { Tree } from "web-tree-sitter";
|
|
7
7
|
import { BaseParser, SymbolInfo } from "./base.js";
|
package/dist/src/parsers/ruby.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ruby Parser - v3.9.
|
|
2
|
+
* Ruby Parser - v3.9.1
|
|
3
3
|
* Tree-sitter based Ruby parser
|
|
4
|
-
* v3.9.
|
|
4
|
+
* v3.9.1: override getInsideStartIndex/getInsideEndIndex for end-based syntax
|
|
5
5
|
*/
|
|
6
6
|
import { BaseParser } from "./base.js";
|
|
7
7
|
export class RubyParser extends BaseParser {
|
package/dist/src/parsers/rust.js
CHANGED
|
@@ -17,7 +17,7 @@ const TOOL_REGISTRY = new Map([
|
|
|
17
17
|
["search_symbols", handlers.handleSearchSymbols],
|
|
18
18
|
["explain_symbol", handlers.handleExplainSymbol],
|
|
19
19
|
["batch_read", handlers.handleBatchRead],
|
|
20
|
-
// Ruby Intelligence tools (v3.9.
|
|
20
|
+
// Ruby Intelligence tools (v3.9.1)
|
|
21
21
|
["get_gemfile_context", handlers.handleGetGemfileContext],
|
|
22
22
|
["find_metaprogramming", handlers.handleFindMetaprogramming],
|
|
23
23
|
["get_rails_routes", handlers.handleGetRailsRoutes],
|
|
@@ -158,7 +158,7 @@ export const CORE_TOOLS = [
|
|
|
158
158
|
required: ["filePath", "projectRoot", "oldName", "newName"],
|
|
159
159
|
},
|
|
160
160
|
},
|
|
161
|
-
// ── AST Transform (v3.9.
|
|
161
|
+
// ── AST Transform (v3.9.1) ──────────────────────────────────────────────
|
|
162
162
|
{
|
|
163
163
|
name: "ast_transform",
|
|
164
164
|
description: "Apply a declarative AST transformation to a symbol. Supports: add_parameter, wrap_with_try_catch, add_decorator, change_return_type, extract_variable. Uses two-phase write (Phase 1: preview diff, Phase 2: confirm with token).",
|
|
@@ -195,7 +195,7 @@ export const CORE_TOOLS = [
|
|
|
195
195
|
required: ["filePath", "projectRoot", "symbolName", "transform"],
|
|
196
196
|
},
|
|
197
197
|
},
|
|
198
|
-
// ── NEW TOOLS v3.9.
|
|
198
|
+
// ── NEW TOOLS v3.9.1 ──────────────────────────────────────────────────────ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
|
|
199
199
|
{
|
|
200
200
|
name: "search_symbols",
|
|
201
201
|
description: "Search symbols by name across the repo using AST (not text search). Finds classes, functions, methods by approximate name.",
|
|
@@ -262,7 +262,7 @@ export const CORE_TOOLS = [
|
|
|
262
262
|
required: [],
|
|
263
263
|
},
|
|
264
264
|
},
|
|
265
|
-
// ── NEW TOOLS v3.9.
|
|
265
|
+
// ── NEW TOOLS v3.9.1 — Ruby Intelligence ─────────────────────────────────
|
|
266
266
|
{
|
|
267
267
|
name: "get_gemfile_context",
|
|
268
268
|
description: "Parse Gemfile and return known gem behaviors with implicit Rails conventions. Useful for understanding what capabilities are active in a Ruby project without running the app.",
|
package/dist/src/utils/appDir.js
CHANGED
package/dist/src/utils/diff.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Diff Utilities - v3.9.
|
|
2
|
+
* Diff Utilities - v3.9.1
|
|
3
3
|
* Uses diff-match-patch for efficient diffing
|
|
4
4
|
*/
|
|
5
5
|
export interface DiffLine {
|
|
@@ -10,7 +10,7 @@ export interface DiffLine {
|
|
|
10
10
|
/**
|
|
11
11
|
* Generates an early fallback diff for large files with many changes.
|
|
12
12
|
* Avoids O(n+d²) degradation from Myers algorithm.
|
|
13
|
-
* FIX-07: Added in v3.9.
|
|
13
|
+
* FIX-07: Added in v3.9.1.
|
|
14
14
|
*
|
|
15
15
|
* @param oldText - Original file content
|
|
16
16
|
* @param newText - Modified file content
|
package/dist/src/utils/diff.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Diff Utilities - v3.9.
|
|
2
|
+
* Diff Utilities - v3.9.1
|
|
3
3
|
* Uses diff-match-patch for efficient diffing
|
|
4
4
|
*/
|
|
5
5
|
import DiffMatchPatch from 'diff-match-patch';
|
|
@@ -22,7 +22,7 @@ function estimateChangeRatio(oldText, newText) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Generates an early fallback diff for large files with many changes.
|
|
24
24
|
* Avoids O(n+d²) degradation from Myers algorithm.
|
|
25
|
-
* FIX-07: Added in v3.9.
|
|
25
|
+
* FIX-07: Added in v3.9.1.
|
|
26
26
|
*
|
|
27
27
|
* @param oldText - Original file content
|
|
28
28
|
* @param newText - Modified file content
|