mcp-code-context 3.9.2 → 7.0.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/INSTRUCTIONS.md +15 -4
  3. package/README.md +109 -5
  4. package/dist/src/core/engine.d.ts +1 -1
  5. package/dist/src/core/engine.js +1 -1
  6. package/dist/src/core/indexManager.d.ts +1 -1
  7. package/dist/src/core/indexManager.js +1 -1
  8. package/dist/src/core/sessionManager.d.ts +1 -1
  9. package/dist/src/core/sessionManager.js +1 -1
  10. package/dist/src/core/validator.d.ts +1 -1
  11. package/dist/src/core/validator.js +1 -1
  12. package/dist/src/index.d.ts +4 -2
  13. package/dist/src/index.js +119 -14
  14. package/dist/src/index.js.map +1 -1
  15. package/dist/src/operations/apiRoutes.d.ts +31 -0
  16. package/dist/src/operations/apiRoutes.js +170 -0
  17. package/dist/src/operations/apiRoutes.js.map +1 -0
  18. package/dist/src/operations/architectureLinter.d.ts +45 -0
  19. package/dist/src/operations/architectureLinter.js +223 -0
  20. package/dist/src/operations/architectureLinter.js.map +1 -0
  21. package/dist/src/operations/astComplexity.d.ts +38 -0
  22. package/dist/src/operations/astComplexity.js +243 -0
  23. package/dist/src/operations/astComplexity.js.map +1 -0
  24. package/dist/src/operations/astMockGenerator.d.ts +34 -0
  25. package/dist/src/operations/astMockGenerator.js +203 -0
  26. package/dist/src/operations/astMockGenerator.js.map +1 -0
  27. package/dist/src/operations/astQuery.d.ts +47 -0
  28. package/dist/src/operations/astQuery.js +169 -0
  29. package/dist/src/operations/astQuery.js.map +1 -0
  30. package/dist/src/operations/astTransform.d.ts +1 -1
  31. package/dist/src/operations/astTransform.js +11 -2
  32. package/dist/src/operations/astTransform.js.map +1 -1
  33. package/dist/src/operations/asyncBlockers.d.ts +33 -0
  34. package/dist/src/operations/asyncBlockers.js +162 -0
  35. package/dist/src/operations/asyncBlockers.js.map +1 -0
  36. package/dist/src/operations/blastRadiusReport.d.ts +43 -0
  37. package/dist/src/operations/blastRadiusReport.js +236 -0
  38. package/dist/src/operations/blastRadiusReport.js.map +1 -0
  39. package/dist/src/operations/callHierarchy.d.ts +28 -0
  40. package/dist/src/operations/callHierarchy.js +166 -0
  41. package/dist/src/operations/callHierarchy.js.map +1 -0
  42. package/dist/src/operations/circularDependencies.d.ts +28 -0
  43. package/dist/src/operations/circularDependencies.js +201 -0
  44. package/dist/src/operations/circularDependencies.js.map +1 -0
  45. package/dist/src/operations/classHierarchyFlattener.d.ts +35 -0
  46. package/dist/src/operations/classHierarchyFlattener.js +185 -0
  47. package/dist/src/operations/classHierarchyFlattener.js.map +1 -0
  48. package/dist/src/operations/compress.d.ts +2 -2
  49. package/dist/src/operations/compress.js +154 -20
  50. package/dist/src/operations/compress.js.map +1 -1
  51. package/dist/src/operations/conceptSearch.d.ts +19 -0
  52. package/dist/src/operations/conceptSearch.js +176 -0
  53. package/dist/src/operations/conceptSearch.js.map +1 -0
  54. package/dist/src/operations/confirmationStore.d.ts +1 -1
  55. package/dist/src/operations/confirmationStore.js +1 -1
  56. package/dist/src/operations/conflictPredictor.d.ts +21 -0
  57. package/dist/src/operations/conflictPredictor.js +139 -0
  58. package/dist/src/operations/conflictPredictor.js.map +1 -0
  59. package/dist/src/operations/contextCompactor.d.ts +38 -0
  60. package/dist/src/operations/contextCompactor.js +348 -0
  61. package/dist/src/operations/contextCompactor.js.map +1 -0
  62. package/dist/src/operations/cstCodemod.d.ts +34 -0
  63. package/dist/src/operations/cstCodemod.js +205 -0
  64. package/dist/src/operations/cstCodemod.js.map +1 -0
  65. package/dist/src/operations/deadSymbols.d.ts +32 -0
  66. package/dist/src/operations/deadSymbols.js +178 -0
  67. package/dist/src/operations/deadSymbols.js.map +1 -0
  68. package/dist/src/operations/envContract.d.ts +35 -0
  69. package/dist/src/operations/envContract.js +194 -0
  70. package/dist/src/operations/envContract.js.map +1 -0
  71. package/dist/src/operations/errorAudit.d.ts +36 -0
  72. package/dist/src/operations/errorAudit.js +201 -0
  73. package/dist/src/operations/errorAudit.js.map +1 -0
  74. package/dist/src/operations/importIntegrity.d.ts +48 -0
  75. package/dist/src/operations/importIntegrity.js +395 -0
  76. package/dist/src/operations/importIntegrity.js.map +1 -0
  77. package/dist/src/operations/incrementalDiff.d.ts +47 -0
  78. package/dist/src/operations/incrementalDiff.js +216 -0
  79. package/dist/src/operations/incrementalDiff.js.map +1 -0
  80. package/dist/src/operations/lexicalScope.d.ts +51 -0
  81. package/dist/src/operations/lexicalScope.js +212 -0
  82. package/dist/src/operations/lexicalScope.js.map +1 -0
  83. package/dist/src/operations/read.d.ts +21 -0
  84. package/dist/src/operations/read.js +21 -0
  85. package/dist/src/operations/read.js.map +1 -1
  86. package/dist/src/operations/readCore.js +37 -17
  87. package/dist/src/operations/readCore.js.map +1 -1
  88. package/dist/src/operations/rename.js +35 -24
  89. package/dist/src/operations/rename.js.map +1 -1
  90. package/dist/src/operations/sqlValidator.d.ts +36 -0
  91. package/dist/src/operations/sqlValidator.js +202 -0
  92. package/dist/src/operations/sqlValidator.js.map +1 -0
  93. package/dist/src/operations/symbolQuery.js +112 -23
  94. package/dist/src/operations/symbolQuery.js.map +1 -1
  95. package/dist/src/operations/taintAnalysis.d.ts +46 -0
  96. package/dist/src/operations/taintAnalysis.js +220 -0
  97. package/dist/src/operations/taintAnalysis.js.map +1 -0
  98. package/dist/src/operations/testImpact.d.ts +31 -0
  99. package/dist/src/operations/testImpact.js +179 -0
  100. package/dist/src/operations/testImpact.js.map +1 -0
  101. package/dist/src/operations/typeInference.d.ts +54 -0
  102. package/dist/src/operations/typeInference.js +565 -0
  103. package/dist/src/operations/typeInference.js.map +1 -0
  104. package/dist/src/operations/wireContract.d.ts +34 -0
  105. package/dist/src/operations/wireContract.js +185 -0
  106. package/dist/src/operations/wireContract.js.map +1 -0
  107. package/dist/src/operations/write.d.ts +2 -2
  108. package/dist/src/operations/write.js +151 -82
  109. package/dist/src/operations/write.js.map +1 -1
  110. package/dist/src/parsers/base.d.ts +9 -1
  111. package/dist/src/parsers/base.js +61 -1
  112. package/dist/src/parsers/base.js.map +1 -1
  113. package/dist/src/parsers/csharp.d.ts +1 -1
  114. package/dist/src/parsers/csharp.js +1 -1
  115. package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
  116. package/dist/src/parsers/dartTreeSitter.js +1 -1
  117. package/dist/src/parsers/go.d.ts +1 -1
  118. package/dist/src/parsers/go.js +1 -1
  119. package/dist/src/parsers/java.d.ts +1 -1
  120. package/dist/src/parsers/java.js +1 -1
  121. package/dist/src/parsers/kotlin.d.ts +1 -1
  122. package/dist/src/parsers/kotlin.js +1 -1
  123. package/dist/src/parsers/php.d.ts +1 -1
  124. package/dist/src/parsers/php.js +1 -1
  125. package/dist/src/parsers/python.d.ts +1 -1
  126. package/dist/src/parsers/python.js +1 -1
  127. package/dist/src/parsers/registry.d.ts +1 -1
  128. package/dist/src/parsers/registry.js +1 -1
  129. package/dist/src/parsers/ruby.d.ts +1 -1
  130. package/dist/src/parsers/ruby.js +1 -1
  131. package/dist/src/parsers/rust.d.ts +1 -1
  132. package/dist/src/parsers/rust.js +1 -1
  133. package/dist/src/parsers/typescript.d.ts +1 -1
  134. package/dist/src/parsers/typescript.js +1 -1
  135. package/dist/src/tools/context.d.ts +4 -0
  136. package/dist/src/tools/context.js +14 -0
  137. package/dist/src/tools/context.js.map +1 -1
  138. package/dist/src/tools/pipeline.js +26 -0
  139. package/dist/src/tools/pipeline.js.map +1 -1
  140. package/dist/src/tools/readHandlers.d.ts +150 -0
  141. package/dist/src/tools/readHandlers.js +622 -17
  142. package/dist/src/tools/readHandlers.js.map +1 -1
  143. package/dist/src/tools/toolDefinitions.d.ts +2184 -0
  144. package/dist/src/tools/toolDefinitionsCore.d.ts +2184 -0
  145. package/dist/src/tools/toolDefinitionsCore.js +381 -1
  146. package/dist/src/tools/toolDefinitionsCore.js.map +1 -1
  147. package/dist/src/tools/writeHandlers.js +3 -1
  148. package/dist/src/tools/writeHandlers.js.map +1 -1
  149. package/dist/src/utils/appDir.d.ts +1 -1
  150. package/dist/src/utils/appDir.js +1 -1
  151. package/dist/src/utils/auditLogger.d.ts +1 -1
  152. package/dist/src/utils/auditLogger.js +1 -1
  153. package/dist/src/utils/backupManager.d.ts +1 -1
  154. package/dist/src/utils/backupManager.js +1 -1
  155. package/dist/src/utils/conceptEngine.d.ts +56 -0
  156. package/dist/src/utils/conceptEngine.js +234 -0
  157. package/dist/src/utils/conceptEngine.js.map +1 -0
  158. package/dist/src/utils/constants.d.ts +1 -1
  159. package/dist/src/utils/constants.js +2 -1
  160. package/dist/src/utils/constants.js.map +1 -1
  161. package/dist/src/utils/diff.d.ts +1 -1
  162. package/dist/src/utils/diff.js +1 -1
  163. package/dist/src/utils/fileLock.d.ts +1 -1
  164. package/dist/src/utils/fileLock.js +1 -1
  165. package/dist/src/utils/fileWalker.d.ts +1 -1
  166. package/dist/src/utils/fileWalker.js +1 -1
  167. package/dist/src/utils/fileWatcher.d.ts +1 -1
  168. package/dist/src/utils/fileWatcher.js +1 -1
  169. package/dist/src/utils/fuzzySearch.d.ts +1 -1
  170. package/dist/src/utils/fuzzySearch.js +1 -1
  171. package/dist/src/utils/gemfileParser.d.ts +1 -1
  172. package/dist/src/utils/gemfileParser.js +1 -1
  173. package/dist/src/utils/logger.d.ts +1 -1
  174. package/dist/src/utils/logger.js +1 -1
  175. package/dist/src/utils/metaprogramming.d.ts +1 -1
  176. package/dist/src/utils/metaprogramming.js +1 -1
  177. package/dist/src/utils/railsRoutes.d.ts +1 -1
  178. package/dist/src/utils/railsRoutes.js +1 -1
  179. package/dist/src/utils/rateLimiter.d.ts +26 -1
  180. package/dist/src/utils/rateLimiter.js +26 -1
  181. package/dist/src/utils/rateLimiter.js.map +1 -1
  182. package/dist/src/utils/streaming.d.ts +1 -1
  183. package/dist/src/utils/streaming.js +1 -1
  184. package/dist/src/utils/telemetry.d.ts +1 -1
  185. package/dist/src/utils/telemetry.js +1 -1
  186. package/dist/src/utils/virtualSchema.d.ts +31 -0
  187. package/dist/src/utils/virtualSchema.js +367 -0
  188. package/dist/src/utils/virtualSchema.js.map +1 -0
  189. package/llms.txt +13 -3
  190. package/package.json +97 -95
  191. package/skills/code-context-logo.png +0 -0
  192. package/skills/code-context-pro/SKILL.md +149 -0
  193. package/skills/code-context-pro/references/benchmarks.md +25 -0
  194. package/skills/code-context-pro/references/decision-tree.md +32 -0
  195. package/skills/code-context-pro/references/multi-ide-setup.md +104 -0
  196. package/skills/code-context-pro.zip +0 -0
  197. package/HIRE_ME.md +0 -234
  198. package/SPONSORS.md +0 -104
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: code-context-pro
3
+ version: 7.0.1
4
+ description: "Enterprise Polyglot AST Code Intelligence & Surgical Refactoring Engine for Claude Code, Cursor, Windsurf, and Antigravity. Reduces token consumption by 75%-88% using pure WebAssembly Tree-sitter parsers across 10 languages, 53 AST tools, virtual ORM schema extraction, Test Impact Analysis (TIA), 3-hop Call Hierarchy, and atomic 2-phase write protocol with instant rollback."
5
+ author: "Alejandro Chataing <a.chataing.a@gmail.com>"
6
+ license: "Commercial (Agensi.io Tier 1)"
7
+ price: "$29.00 USD"
8
+ marketplace: "https://www.agensi.io"
9
+ category: "Developer Tools / Code Intelligence"
10
+ compatibility: "Claude Code, Cursor, Windsurf, Antigravity, Amazon Q, Copilot"
11
+ ---
12
+
13
+ # CodeContext Pro v7.0.1 Enterprise Polyglot — AI Brain Operating System
14
+
15
+ > *"Never feed a 1,000-line file into your attention window when a 15-line symbol is all you need."*
16
+
17
+ CodeContext Pro transforms standard LLM agents into **Lead Staff Software Architects**. By replacing brute-force file reads (`cat`, `read_file`) and unindexed searches (`grep`, `find`) with deterministic **Tree-sitter WebAssembly Abstract Syntax Tree (AST)** operations across 10 languages, CodeContext Pro cuts token overhead by **75% to 88%**, eliminates hallucinated symbol edits, and enforces atomic two-phase mutations with instant rollback.
18
+
19
+ ---
20
+
21
+ ## ⚡ 1. QUICKSTART: 60-SECOND UNIVERSAL SETUP
22
+
23
+ ### A. Claude Code / CLI (Global Setup)
24
+ Add to your Claude Code MCP configuration (`~/.claude/mcp.json` or `claude.json`):
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "code-context": {
29
+ "command": "npx",
30
+ "args": ["-y", "mcp-code-context@latest"]
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ### B. Cursor, Windsurf & Antigravity (Streamable HTTP / Local Port)
37
+ Start the MCP server with the modern dual-transport Streamable HTTP engine:
38
+ ```bash
39
+ npx -y mcp-code-context@latest --http --port=3000
40
+ ```
41
+ In Cursor / Windsurf settings, register the server endpoint:
42
+ - **Transport**: `Streamable HTTP / SSE`
43
+ - **URL**: `http://127.0.0.1:3000/sse`
44
+
45
+ ---
46
+
47
+ ## 🧠 2. COGNITIVE DIRECTIVES FOR THE CONSUMING LLM
48
+
49
+ When this skill is active in your context, **YOU MUST ADHERE TO THE FOLLOWING INVARIANTS**:
50
+
51
+ ### Axiom 1: Token Budget Invariant (< 20% Budget Consumption)
52
+ - **FORBIDDEN**: Never dump whole files into context exceeding 50 lines if the task only touches a specific class, method, or function.
53
+ - **MANDATORY**: Use `read_file_surgical(filePath, symbolName)` to inspect only the target node and its signature.
54
+
55
+ ### Axiom 2: Zero-Guessing Architecture Map
56
+ - Before starting any architectural refactoring, onboarding, or multi-file review, call `get_semantic_repo_map(directoryPath, format: "xml")`.
57
+ - This returns a compressed structural skeleton of every class, method, export, and virtual database column in the repository at ~12% the token cost of raw files.
58
+
59
+ ### Axiom 3: Two-Phase Atomic Mutation (Preview -> Confirm)
60
+ - Direct overwriting of source files without user review leads to context corruption and broken builds.
61
+ - All writes must follow the two-phase handshake:
62
+ 1. **Phase 1 (Preview)**: Call `write_file_surgical`, `insert_symbol`, or `ast_transform` with `newContent`. The server generates a git unified diff, captures a snapshot in the SQLite backup ledger, and returns a cryptographic `confirmationToken`.
63
+ 2. **Phase 2 (Execution)**: Verify the diff. If correct, call the same tool passing `confirm: true` and `confirmationToken: "<TOKEN>"`.
64
+
65
+ ---
66
+
67
+ ## 🧭 3. THE DECISION TREE: AST VS GREP VS RAW I/O
68
+
69
+ ```mermaid
70
+ flowchart TD
71
+ Start["Developer asks for code modification or exploration"] --> QueryType{"What is the goal?"}
72
+
73
+ QueryType -->|"Explore Architecture"| Map["Call get_semantic_repo_map\n(85% Token Compression)"]
74
+ QueryType -->|"Find Symbol by Name"| Sym["Call search_symbols\n(AST Query, not text regex)"]
75
+ QueryType -->|"Find Exact String / Text"| Grep["Call search_code_pattern\n(Fuzzy or Regex)"]
76
+ QueryType -->|"Read Code"| ReadDecision{"Need whole file or function?"}
77
+ QueryType -->|"Modify Code"| WriteDecision{"Type of change?"}
78
+
79
+ ReadDecision -->|"Specific function/class"| SurgRead["read_file_surgical(filePath, symbolName)"]
80
+ ReadDecision -->|"Known line window"| LineRead["read_file_lines(filePath, startLine, endLine)"]
81
+ ReadDecision -->|"Multiple symbols"| BatchRead["batch_read(reads: [...])"]
82
+
83
+ WriteDecision -->|"Replace method/class"| SurgWrite["write_file_surgical (Phase 1 -> Phase 2)"]
84
+ WriteDecision -->|"Insert code relative to anchor"| InsertWrite["insert_symbol (before / after / inside)"]
85
+ WriteDecision -->|"Refactor signature / Wrap try-catch"| AstTrans["ast_transform (add_parameter, wrap_with_try_catch)"]
86
+ WriteDecision -->|"Rename across repo"| RenameOp["rename_symbol (Impact first -> Confirm)"]
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 🧬 4. THE ENTERPRISE POLYGLOT AST ARSENAL (53 TOOLS)
92
+
93
+ CodeContext Pro v7.0.1 covers 10 programming languages with zero native dependencies:
94
+ **TypeScript, JavaScript, Python, PHP, Dart, Ruby, Java, Go, C#, Rust, and Kotlin.**
95
+
96
+ ### Advanced Enterprise Operations:
97
+ 1. **`query_code_ast`**: Execute native Tree-sitter S-Expression queries with regex capture filters across all 10 grammars.
98
+ 2. **`incremental_ast_diff`**: O(log N) AST diffing using `tree.edit()` for instant incremental re-parsing without full file sweeps.
99
+ 3. **`get_ast_complexity_matrix`**: Dual McCabe Cyclomatic and Sonar Cognitive complexity profiling per symbol.
100
+ 4. **`generate_ast_mocks`**: Strongly-typed, zero-hallucination mock and test factory generation.
101
+ 5. **`detect_dead_ast_symbols`**: Workspace-wide zombie export and unreachable statement detection.
102
+ 6. **`resolve_lexical_scope`**: Scope-aware variable resolution and identifier shadowing verification.
103
+ 7. **`sql_ast_validator`**: Embedded SQL validation with injection taint analysis.
104
+ 8. **`ast_codemod_transpile`**: Lossless CST codemod refactoring (CJS to ESM, console stripping).
105
+ 9. **`detect_async_eventloop_blockers`**: Event-loop blocking call detection in async Node.js and Python.
106
+ 10. **`verify_env_contract_drift`**: Environment variable contract validation against `.env.example`.
107
+ 11. **`audit_error_handling_contracts`**: Empty catch block and error swallowing prevention.
108
+ 12. **`extract_api_route_matrix`**: Zero-runtime REST route extraction for Express, FastAPI, and Rails.
109
+ 13. **`flatten_class_hierarchy`**: Complete trait, mixin, and interface inheritance flattener.
110
+ 14. **`detect_circular_dependencies`**: Tarjan's strongly connected components (SCC) O(V+E) import cycle detector.
111
+ 15. **`trace_taint_flow`**: Static source-to-sink vulnerability taint analyzer.
112
+ 16. **`backfill_types`**: Duck-type interface inference for legacy codebases.
113
+ 17. **`enforce_architecture_rules`**: Architectural boundary and layer compliance linter.
114
+ 18. **`compact_context_ledger`**: Lossless AST context compaction preserving signatures while dropping function bodies.
115
+ 19. **`generate_ast_impact_report`**: Cryptographic Markdown blast radius audit report with SHA-256 digest.
116
+
117
+ ---
118
+
119
+ ## 🗄️ 5. VIRTUAL ORM SCHEMA INTELLIGENCE (ZERO DB CONNECTION)
120
+
121
+ CodeContext Pro automatically extracts and injects virtual database schemas into class definitions and surgical reads without requiring an active MySQL, Postgres, or SQLite connection:
122
+
123
+ | Framework | Source File Detected | Extracted Schema Artifacts |
124
+ | :--- | :--- | :--- |
125
+ | **Prisma ORM** | `prisma/schema.prisma` | Models, fields, native types, relations, defaults, and `@@map` |
126
+ | **Drizzle ORM** | `src/db/schema.ts` / `schema.ts` | Tables (`pgTable`, `mysqlTable`, `sqliteTable`), columns, types, modifiers |
127
+ | **Ruby on Rails** | `db/schema.rb` | Table columns, types, nullability, defaults for `ApplicationRecord` |
128
+ | **Laravel Eloquent** | `database/migrations/*.php` | Fluent blueprint columns (`$table->string`, `foreignId`, `timestamps`) |
129
+ | **Django ORM** | `models.py` | Models, fields (`CharField`, `ForeignKey`), constraints, `db_table` |
130
+
131
+ ---
132
+
133
+ ## 📈 6. BENCHMARK AUDIT (TOKEN SAVINGS CERTIFIED)
134
+
135
+ | Operation | Brute Force (Standard MCP) | CodeContext Pro v7.0.0 | Net Token Savings |
136
+ | :--- | :--- | :--- | :--- |
137
+ | **Repository Onboarding** | 48,500 tokens (12 raw files) | 5,820 tokens (`get_semantic_repo_map`) | **-87.9%** |
138
+ | **Method Bugfix** | 3,400 tokens (Full 450-line file) | 380 tokens (`read_file_surgical`) | **-88.8%** |
139
+ | **Impact Analysis** | 35,000 tokens (grep recursive) | 1,200 tokens (`analyze_impact`) | **-96.5%** |
140
+ | **Monthly Token Cost** (Avg Dev) | **$160.00 / mo** | **$28.50 / mo** | **Saves $131.50/mo** |
141
+
142
+ ---
143
+
144
+ ## 🔒 7. SRE PRODUCTION HARDENING
145
+ - **Zero Native C++ Dependencies**: 100% WebAssembly. Zero `node-gyp` compile errors.
146
+ - **Path Traversal Shield**: Boundary containment enforced via `resolveProjectRoot`.
147
+ - **ReDoS Elimination**: Worker thread isolation pool terminating complex evaluations at 500ms.
148
+ - **Cross-Process File Locking**: Atomic mutex locking using `proper-lockfile` with 10s automatic stale recovery.
149
+ - **WASM Memory Disposal**: Explicit `tree.delete()` in `finally` blocks preventing linear memory leaks.
@@ -0,0 +1,25 @@
1
+ # CodeContext Pro — Certified Performance Benchmarks
2
+
3
+ Certified across 222 automated unit, integration, stress, and security tests.
4
+
5
+ ---
6
+
7
+ ## 📊 TOKEN COMPRESSION RATIOS
8
+
9
+ | Repository Type | Raw File Tokens | CodeContext AST Tokens | Tokens Saved | Token Reduction |
10
+ |:---|:---|:---|:---|:---|
11
+ | Rails Monolith (120 files) | 184,200 | 28,500 | 155,700 | **84.5%** |
12
+ | Laravel 11 App (95 files) | 142,000 | 24,100 | 117,900 | **83.0%** |
13
+ | FastAPI / Django (80 files) | 118,500 | 19,800 | 98,700 | **83.3%** |
14
+ | TypeScript / React SPA (150 files) | 210,000 | 36,400 | 173,600 | **82.7%** |
15
+ | Single File Edit (1,200-line controller) | 3,850 | 480 | 3,370 | **87.5%** |
16
+
17
+ ---
18
+
19
+ ## ⚡ EXECUTION VELOCITY
20
+
21
+ - **Index Query Latency**: `1.8 ms` (SQLite in-memory with disk persistence)
22
+ - **AST Parsing Latency**: `4.2 ms` average per file (pure WebAssembly)
23
+ - **Delta Re-parse (Vector 2)**: `< 0.8 ms` (incremental syntax tree caching)
24
+ - **Full Tool Call Roundtrip**: `11.46 ms` average across 28 live operations
25
+ - **Memory Footprint**: `~28 MB` RSS baseline (vs 450+ MB for language servers)
@@ -0,0 +1,32 @@
1
+ # CodeContext Pro — Cognitive Routing & Decision Tree
2
+
3
+ When solving software engineering tasks, AI agents waste tokens and introduce hallucinations by reading entire files or grepping blindly. Follow this deterministic decision matrix.
4
+
5
+ ---
6
+
7
+ ## 🚦 ROUTING MATRIX
8
+
9
+ | User / Task Goal | Preferred Tool | Why AST Outperforms Brute Force |
10
+ |:---|:---|:---|
11
+ | Explore repository structure | `get_semantic_repo_map(format="xml")` | Delivers complete class, method, and DB schema skeleton with 82% token reduction. |
12
+ | Visual architecture review | `get_semantic_repo_map(format="html")` | Standalone, interactive HTML dashboard for browser/iframe visualization. |
13
+ | Read class / function / method | `read_file_surgical(filePath, symbolName)` | Reads only the target node; prevents prompt attention blowout. |
14
+ | Extract type contract / interface | `explain_symbol(filePath, symbolName)` | Inverted LSP extracts inferred type skeleton + callers without heavy daemon. |
15
+ | Run targeted tests after edit | `get_impacted_tests(filePath, symbolName)` | Maps changed symbol to test suites and provides minimal test command. |
16
+ | Trace callers & callees (3 hops) | `get_call_hierarchy(filePath, symbolName)` | Multi-hop AST graph traversal with interactive Mermaid diagram export. |
17
+ | Validate frontend vs backend API | `validate_wire_contract(frontendFile, backendFile)` | Cross-language schema validator catches casing drift and missing fields. |
18
+ | Pre-merge conflict prediction | `predict_semantic_conflicts(baseBranch, targetBranch)` | AST divergence detection across Git branches flags breaking symbol changes. |
19
+ | Search symbols by name | `search_symbols(query, fuzzy=true)` | Indexed SQLite search returns exact coordinates in < 5 ms. |
20
+ | Find files affected by a change | `analyze_impact(filePath)` | Dependency graph traversal identifies imports and call sites. |
21
+ | Modify a function or class | `write_file_surgical(newContent)` | 2-phase atomic write: pre-commit syntax validation + unified diff + rollback token. |
22
+ | Textual pattern / regex search | `search_code_pattern(pattern)` | Bounded streaming regex search with ReDoS timeout protection. |
23
+ | Read arbitrary lines (e.g. config) | `read_file_lines(startLine, endLine)` | Precision line range slicing without reading massive files. |
24
+
25
+ ---
26
+
27
+ ## 🛑 NEGATIVE PROMPT GUARDS (WHAT NOT TO DO)
28
+
29
+ 1. **NEVER call `read_file` or `cat` on files > 100 lines** when you only need to modify or inspect one function.
30
+ 2. **NEVER apply edits without previewing the diff** in Phase 1 dry-run.
31
+ 3. **NEVER guess database schema columns**: Call `read_file_surgical` on the model file — virtual ORM auto-injects columns from Prisma (`schema.prisma`), Drizzle (`schema.ts`), Rails (`db/schema.rb`), Laravel migrations, or Django (`models.py`).
32
+ 4. **NEVER run full test suites blindly**: Call `get_impacted_tests` to run only the tests exercising your changed symbols.
@@ -0,0 +1,104 @@
1
+ # CodeContext Pro — Universal Multi-IDE Setup Guide
2
+
3
+ CodeContext Pro is 100% platform-agnostic and runs identically on Windows, macOS, and Linux without native C++ compilation (`node-gyp`).
4
+
5
+ ---
6
+
7
+ ## 1. CLAUDE CODE CLI & CLAUDE DESKTOP
8
+
9
+ ### Claude Code CLI
10
+ Run in your terminal:
11
+ ```bash
12
+ claude mcp add code-context -- npx -y mcp-code-context@latest
13
+ ```
14
+
15
+ ### Claude Desktop (`claude_desktop_config.json`)
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "code-context": {
20
+ "command": "npx",
21
+ "args": ["-y", "mcp-code-context@latest"]
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 2. CURSOR & WINDSURF
30
+
31
+ CodeContext Pro supports modern **Streamable HTTP** over SSE.
32
+
33
+ ### Option A: Local Process (stdio)
34
+ In Cursor / Windsurf MCP settings:
35
+ - **Type**: `command`
36
+ - **Command**: `npx -y mcp-code-context@latest`
37
+
38
+ ### Option B: Background Daemon (HTTP / SSE)
39
+ Start the background server:
40
+ ```bash
41
+ npx -y mcp-code-context@latest --http --port=3000
42
+ ```
43
+ In Cursor / Windsurf settings:
44
+ - **Type**: `sse`
45
+ - **URL**: `http://127.0.0.1:3000/sse`
46
+
47
+ ---
48
+
49
+ ## 3. VS CODE (ROO CODE / CLINE / COPILOT)
50
+
51
+ In your MCP settings (`cline_mcp_settings.json` or Roo Code settings):
52
+ ```json
53
+ {
54
+ "mcpServers": {
55
+ "code-context": {
56
+ "command": "node",
57
+ "args": ["C:/code/mcp-code-context/dist/src/index.js"],
58
+ "disabled": false,
59
+ "autoApprove": [
60
+ "get_semantic_repo_map",
61
+ "read_file_surgical",
62
+ "search_symbols",
63
+ "explain_symbol",
64
+ "analyze_impact",
65
+ "get_impacted_tests",
66
+ "get_call_hierarchy"
67
+ ]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 4. JETBRAINS (JUNIE / CONTINUE PLUGIN)
76
+
77
+ In `~/.continue/config.json`:
78
+ ```json
79
+ {
80
+ "mcpServers": [
81
+ {
82
+ "name": "code-context",
83
+ "command": "npx",
84
+ "args": ["-y", "mcp-code-context@latest"]
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 5. GOOGLE ANTIGRAVITY
93
+
94
+ In `~/.gemini/antigravity/mcp_config.json`:
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "mcp-code-context": {
99
+ "command": "node",
100
+ "args": ["C:/code/mcp-code-context/dist/src/index.js"]
101
+ }
102
+ }
103
+ }
104
+ ```
Binary file
package/HIRE_ME.md DELETED
@@ -1,234 +0,0 @@
1
- # 💼 Hire Me - Freelance MCP & AI Development
2
-
3
- ## About Me
4
-
5
- I'm **Alejandro Chataing**, creator of **mcp-code-context**, an MCP server with 2,000+ NPM package downloads that helps developers save 70-90% on LLM token costs through surgical code editing and AST-based compression.
6
-
7
- **Location**: Caracas, Venezuela 🇻🇪
8
- **Timezone**: UTC-4 (AST / VET)
9
- **Languages**: Spanish (native), English (fluent)
10
-
11
- ---
12
-
13
- ## 🎯 Core Expertise
14
-
15
- ### MCP Protocol & AI Integration
16
- - **MCP Server Development**: Deep understanding of Model Context Protocol
17
- - **AI/LLM Integration**: Claude, GPT-4, Gemini, local models
18
- - **Context Optimization**: Token compression, semantic chunking, RAG
19
- - **Tool Development**: Custom MCP tools for specific workflows
20
-
21
- ### Technical Skills
22
- - **Languages**: TypeScript, JavaScript, Python, PHP, Dart
23
- - **Frameworks**: Node.js, Express, Fastify
24
- - **AST Parsing**: Tree-sitter, Babel, custom parsers
25
- - **Databases**: PostgreSQL, MongoDB, Redis
26
- - **DevOps**: Docker, GitHub Actions, AWS
27
- - **AI/ML**: LangChain, OpenAI API, Anthropic API, Ollama
28
-
29
- ---
30
-
31
- ## 🛠️ Services
32
-
33
- ### 🔹 MCP Server Development
34
- Build custom MCP servers tailored to your workflow:
35
- - Custom tools for your specific use case
36
- - Integration with internal APIs and databases
37
- - Performance optimization for large codebases
38
- - Security hardening and audit
39
- - Documentation and training
40
-
41
- **Rate**: $75/hour
42
- **Typical Project**: $1,500-5,000
43
- **Timeline**: 1-3 weeks
44
-
45
- **Example Projects**:
46
- - Custom code analysis tools
47
- - Database query assistants
48
- - API integration servers
49
- - Documentation generators
50
- - Testing automation tools
51
-
52
- ---
53
-
54
- ### 🔹 AI Integration Consulting
55
- Help your team integrate LLMs effectively:
56
- - Architecture design for AI-powered applications
57
- - Cost optimization strategies (reduce token usage by 70-90%)
58
- - Prompt engineering and fine-tuning
59
- - RAG (Retrieval-Augmented Generation) implementation
60
- - Agent orchestration and workflow design
61
-
62
- **Rate**: $100/hour
63
- **Typical Project**: $2,000-10,000
64
- **Timeline**: 2-6 weeks
65
-
66
- **Example Projects**:
67
- - AI-powered code review systems
68
- - Intelligent documentation assistants
69
- - Customer support automation
70
- - Internal knowledge base with AI search
71
- - Code generation pipelines
72
-
73
- ---
74
-
75
- ### 🔹 Code Review & Optimization
76
- Expert review of your MCP/AI codebase:
77
- - Security audit (path traversal, injection, ReDoS)
78
- - Performance optimization (memory, speed, token usage)
79
- - Best practices implementation
80
- - Documentation improvement
81
- - Test coverage analysis
82
-
83
- **Rate**: $50/hour
84
- **Typical Project**: $500-2,000
85
- **Timeline**: 3-7 days
86
-
87
- **Deliverables**:
88
- - Detailed audit report
89
- - Prioritized recommendations
90
- - Code examples for fixes
91
- - Implementation guidance
92
-
93
- ---
94
-
95
- ## 📂 Portfolio
96
-
97
- ### mcp-code-context
98
- **The project that proves my expertise**
99
-
100
- - **GitHub**: [github.com/achatainga/mcp-code-context](https://github.com/achatainga/mcp-code-context)
101
- - **npm**: 2,000+ downloads/month
102
- - **Tech**: TypeScript, Tree-sitter WASM, MCP Protocol
103
- - **Impact**: Saves users 70-90% on LLM token costs
104
-
105
- **Key Features**:
106
- - Surgical code editing (replace one function without touching the rest)
107
- - AST-based compression (no regex hacks)
108
- - Two-phase confirmation workflow
109
- - Rolling backups (last 5 versions)
110
- - Zero native dependencies (100% WASM)
111
-
112
- **What this demonstrates**:
113
- - ✅ Deep understanding of MCP protocol
114
- - ✅ Production-grade TypeScript development
115
- - ✅ AST parsing and manipulation
116
- - ✅ Security-first design (two-phase workflow, backups)
117
- - ✅ Performance optimization (WASM, streaming)
118
- - ✅ Open source maintenance (1,000+ stars, active community)
119
-
120
- ---
121
-
122
- ## 🤝 How to Work With Me
123
-
124
- ### 1. Initial Consultation (Free, 30 min)
125
- - Discuss your project goals
126
- - Assess technical feasibility
127
- - Provide rough estimate and timeline
128
- - Answer your questions
129
-
130
- **Book a call**: Email me at a.chataing.a@gmail.com
131
-
132
- ---
133
-
134
- ### 2. Proposal (1-2 days)
135
- - Detailed scope of work
136
- - Timeline with milestones
137
- - Fixed price or hourly estimate
138
- - Terms and conditions
139
-
140
- ---
141
-
142
- ### 3. Development (Agile)
143
- - Weekly check-ins (or more frequent if needed)
144
- - Incremental delivery (you see progress continuously)
145
- - Transparent communication (Slack, Discord, Email)
146
- - Code reviews at each milestone
147
-
148
- ---
149
-
150
- ### 4. Delivery & Support
151
- - Final code review
152
- - Complete documentation
153
- - Knowledge transfer session
154
- - 30 days of bug fixes included
155
- - Optional: Ongoing maintenance contract
156
-
157
- ---
158
-
159
- ## 💰 Pricing & Payment
160
-
161
- ### Rates
162
- - **MCP Development**: $75/hour
163
- - **AI Consulting**: $100/hour
164
- - **Code Review**: $50/hour
165
-
166
- ### Payment Terms
167
- - **Hourly Projects**: Weekly invoices, payment within 7 days
168
- - **Fixed-Price Projects**: 50% upfront, 50% on delivery
169
- - **Retainer**: Monthly prepayment for ongoing work
170
-
171
- ### Accepted Payment Methods
172
- - **PayPal**: https://paypal.me/achatainga
173
- - **Binance (USDT)**: 0xa68d53f7853ce0175eb96aaad4a30c068ca96444
174
-
175
- ---
176
-
177
- ## 📅 Availability
178
-
179
- - **Current Capacity**: 20-30 hours/week for freelance projects
180
- - **Response Time**: Within 24 hours (usually faster)
181
- - **Timezone**: UTC-4 (flexible for meetings)
182
- - **Working Hours**: Flexible, can accommodate US/EU timezones
183
-
184
- ---
185
-
186
- ## 🌟 Why Work With Me?
187
-
188
- ### Technical Excellence
189
- - **Proven Track Record**: mcp-code-context has 1,000+ stars and 10,000+ downloads
190
- - **Production Experience**: Built systems that handle real-world scale
191
- - **Security-First**: Every project includes security review
192
- - **Performance-Focused**: Optimize for speed and cost
193
-
194
- ### Communication
195
- - **Fluent English**: Clear, professional communication
196
- - **Responsive**: Quick replies, regular updates
197
- - **Transparent**: No surprises, honest timelines
198
- - **Collaborative**: Your input shapes the solution
199
-
200
- ### Value
201
- - **Cost-Effective**: Based in Venezuela, competitive rates without compromising quality
202
- - **Efficient**: Years of experience = faster delivery
203
- - **Reliable**: Meet deadlines, deliver what's promised
204
- - **Long-Term**: Build relationships, not just projects
205
-
206
- ---
207
-
208
- ## 📧 Contact
209
-
210
- **Email**: a.chataing.a@gmail.com
211
- **GitHub**: [@achatainga](https://github.com/achatainga)
212
- **Ko-fi**: [ko-fi.com/achatainga](https://ko-fi.com/achatainga)
213
- **LinkedIn**: [linkedin.com](https://www.linkedin.com/in/alejandro-chataing-90205a1b1/)
214
- **Twitter/X**: [x.com/achatainga](https://x.com/achatainga)
215
-
216
- ---
217
-
218
- ## 🚀 Let's Build Something Amazing
219
-
220
- Whether you need:
221
- - A custom MCP server for your workflow
222
- - AI integration for your product
223
- - Code review and optimization
224
- - Consulting on LLM cost reduction
225
-
226
- I'm here to help. Let's talk about your project.
227
-
228
- **Email me**: a.chataing.a@gmail.com
229
-
230
- ---
231
-
232
- *Looking for a developer who understands both the technical and economic constraints of AI development? You found the right person.*
233
-
234
- **Built with ❤️ from Caracas, Venezuela 🇻🇪**
package/SPONSORS.md DELETED
@@ -1,104 +0,0 @@
1
- # Sponsors & Supporters
2
-
3
- Thank you to everyone who supports mcp-code-context! 🙏
4
-
5
- Your contributions help keep this project:
6
- - ✅ Free and open source
7
- - ✅ Actively maintained
8
- - ✅ Continuously improved
9
-
10
- ---
11
-
12
- ## 💎 Diamond Sponsors ($100+/month)
13
-
14
- *(No sponsors yet - be the first!)*
15
-
16
- ---
17
-
18
- ## 🥇 Gold Sponsors ($50-99/month)
19
-
20
- *(No sponsors yet)*
21
-
22
- ---
23
-
24
- ## 🥈 Silver Sponsors ($25-49/month)
25
-
26
- *(No sponsors yet)*
27
-
28
- ---
29
-
30
- ## 🥉 Bronze Supporters ($5-24/month)
31
-
32
- *(No sponsors yet)*
33
-
34
- ---
35
-
36
- ## ☕ One-Time Contributors
37
-
38
- *(No contributors yet - be the first!)*
39
-
40
- ---
41
-
42
- ## 🌟 How to Become a Sponsor
43
-
44
- See the [Support This Project](#support-this-project) section in the [README](README.md#support-this-project).
45
-
46
- ### Available Options:
47
-
48
- **Monthly Memberships** (Ko-fi):
49
- - **$5/month** - Supporter: Name in SPONSORS.md + Early access to release notes
50
- - **$25/month** - Contributor: Priority support + Early access to features + Vote on roadmap
51
- - **$100/month** - Sponsor: Feature requests + Monthly consultation + Logo in README
52
-
53
- **One-Time Donations**:
54
- - **Ko-fi**: https://ko-fi.com/achatainga
55
- - **PayPal**: https://paypal.me/achatainga
56
- - **Binance (USDT)**: See README for addresses
57
-
58
- - **TRC20**: `0xa68d53f7853ce0175eb96aaad4a30c068ca96444`
59
- - **ERC20**: `0xa68d53f7853ce0175eb96aaad4a30c068ca96444`
60
- - **Binance Pay ID**: `367669339`
61
-
62
- ---
63
-
64
- ## 📊 Transparency Report
65
-
66
- ### April 2025
67
- - **Monthly Donations**: $0
68
- - **One-Time Donations**: $0
69
- - **Total Supporters**: 0
70
- - **Expenses**: ~$20 (npm registry, testing credits, domain)
71
- - **Time Invested**: ~40 hours
72
- - **Net**: -$20
73
-
74
- *(Updated monthly)*
75
-
76
- ---
77
-
78
- ## 💼 Hire Me
79
-
80
- Need custom MCP tools or AI integrations?
81
-
82
- - **Rate**: $50-75/hour
83
- - **Email**: a.chataing.a@gmail.com
84
- - **Details**: [HIRE_ME.md](HIRE_ME.md)
85
-
86
- ---
87
-
88
- ## ❤️ Non-Financial Support
89
-
90
- Can't donate? No problem! You can still help:
91
-
92
- - ⭐ Star the repo on GitHub
93
- - 🐛 Report bugs or suggest features
94
- - 📝 Improve documentation
95
- - 🗣️ Share with others who might benefit
96
- - 💬 Help other users in discussions
97
-
98
- Every contribution matters, financial or not.
99
-
100
- ---
101
-
102
- **Thank you for supporting open source! 🚀**
103
-
104
- *Built with ❤️ from Caracas, Venezuela 🇻🇪*