codestrate 0.1.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/README.md +154 -0
- package/dist/constants.d.ts +40 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +145 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.d.ts +260 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +173 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/security/guard.d.ts +18 -0
- package/dist/security/guard.d.ts.map +1 -0
- package/dist/security/guard.js +39 -0
- package/dist/security/guard.js.map +1 -0
- package/dist/services/code-searcher.d.ts +22 -0
- package/dist/services/code-searcher.d.ts.map +1 -0
- package/dist/services/code-searcher.js +171 -0
- package/dist/services/code-searcher.js.map +1 -0
- package/dist/services/context-builder.d.ts +22 -0
- package/dist/services/context-builder.d.ts.map +1 -0
- package/dist/services/context-builder.js +232 -0
- package/dist/services/context-builder.js.map +1 -0
- package/dist/services/memory-store.d.ts +31 -0
- package/dist/services/memory-store.d.ts.map +1 -0
- package/dist/services/memory-store.js +27 -0
- package/dist/services/memory-store.js.map +1 -0
- package/dist/services/repository-parser.d.ts +8 -0
- package/dist/services/repository-parser.d.ts.map +1 -0
- package/dist/services/repository-parser.js +255 -0
- package/dist/services/repository-parser.js.map +1 -0
- package/dist/services/symbol-indexer.d.ts +16 -0
- package/dist/services/symbol-indexer.d.ts.map +1 -0
- package/dist/services/symbol-indexer.js +417 -0
- package/dist/services/symbol-indexer.js.map +1 -0
- package/dist/services/tree-sitter.d.ts +22 -0
- package/dist/services/tree-sitter.d.ts.map +1 -0
- package/dist/services/tree-sitter.js +269 -0
- package/dist/services/tree-sitter.js.map +1 -0
- package/dist/services/validation-runner.d.ts +30 -0
- package/dist/services/validation-runner.d.ts.map +1 -0
- package/dist/services/validation-runner.js +159 -0
- package/dist/services/validation-runner.js.map +1 -0
- package/dist/store/index.d.ts +23 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +93 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/interface.d.ts +73 -0
- package/dist/store/interface.d.ts.map +1 -0
- package/dist/store/interface.js +9 -0
- package/dist/store/interface.js.map +1 -0
- package/dist/store/memory.d.ts +21 -0
- package/dist/store/memory.d.ts.map +1 -0
- package/dist/store/memory.js +157 -0
- package/dist/store/memory.js.map +1 -0
- package/dist/store/sqlite.d.ts +95 -0
- package/dist/store/sqlite.d.ts.map +1 -0
- package/dist/store/sqlite.js +1018 -0
- package/dist/store/sqlite.js.map +1 -0
- package/dist/tools/analyze-impact.d.ts +3 -0
- package/dist/tools/analyze-impact.d.ts.map +1 -0
- package/dist/tools/analyze-impact.js +110 -0
- package/dist/tools/analyze-impact.js.map +1 -0
- package/dist/tools/explore.d.ts +3 -0
- package/dist/tools/explore.d.ts.map +1 -0
- package/dist/tools/explore.js +96 -0
- package/dist/tools/explore.js.map +1 -0
- package/dist/tools/get-context.d.ts +3 -0
- package/dist/tools/get-context.d.ts.map +1 -0
- package/dist/tools/get-context.js +82 -0
- package/dist/tools/get-context.js.map +1 -0
- package/dist/tools/inspect-symbol.d.ts +3 -0
- package/dist/tools/inspect-symbol.d.ts.map +1 -0
- package/dist/tools/inspect-symbol.js +146 -0
- package/dist/tools/inspect-symbol.js.map +1 -0
- package/dist/tools/recall-experience.d.ts +3 -0
- package/dist/tools/recall-experience.d.ts.map +1 -0
- package/dist/tools/recall-experience.js +141 -0
- package/dist/tools/recall-experience.js.map +1 -0
- package/dist/tools/record-experience.d.ts +6 -0
- package/dist/tools/record-experience.d.ts.map +1 -0
- package/dist/tools/record-experience.js +68 -0
- package/dist/tools/record-experience.js.map +1 -0
- package/dist/tools/reindex.d.ts +8 -0
- package/dist/tools/reindex.d.ts.map +1 -0
- package/dist/tools/reindex.js +74 -0
- package/dist/tools/reindex.js.map +1 -0
- package/dist/tools/repo-overview.d.ts +7 -0
- package/dist/tools/repo-overview.d.ts.map +1 -0
- package/dist/tools/repo-overview.js +102 -0
- package/dist/tools/repo-overview.js.map +1 -0
- package/dist/tools/run-validation.d.ts +6 -0
- package/dist/tools/run-validation.d.ts.map +1 -0
- package/dist/tools/run-validation.js +115 -0
- package/dist/tools/run-validation.js.map +1 -0
- package/dist/tools/search-code.d.ts +3 -0
- package/dist/tools/search-code.d.ts.map +1 -0
- package/dist/tools/search-code.js +98 -0
- package/dist/tools/search-code.js.map +1 -0
- package/dist/tools/search-history.d.ts +6 -0
- package/dist/tools/search-history.d.ts.map +1 -0
- package/dist/tools/search-history.js +69 -0
- package/dist/tools/search-history.js.map +1 -0
- package/dist/tools/status.d.ts +7 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js +98 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/trace-flow.d.ts +3 -0
- package/dist/tools/trace-flow.d.ts.map +1 -0
- package/dist/tools/trace-flow.js +155 -0
- package/dist/tools/trace-flow.js.map +1 -0
- package/dist/types.d.ts +182 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Coding Intelligence MCP Server
|
|
2
|
+
|
|
3
|
+
An "external fine-tuning" layer for cloud coding models (Claude Code, Codex, Gemini, OpenCode). Provides structural code retrieval via tree-sitter AST parsing, graph-based symbol navigation, project memory, and executable validation via the Model Context Protocol.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Model (Claude Code / Codex / OpenCode)
|
|
9
|
+
│
|
|
10
|
+
│ MCP (stdio / HTTP)
|
|
11
|
+
▼
|
|
12
|
+
┌──────────────────────────────────────────────────────┐
|
|
13
|
+
│ Coding Intelligence MCP Server │
|
|
14
|
+
├──────────────────────────────────────────────────────┤
|
|
15
|
+
│ Tools (13) │
|
|
16
|
+
│ ├─ ci_get_context — [Primary] Context bundle │
|
|
17
|
+
│ ├─ ci_repo_overview — Project structure │
|
|
18
|
+
│ ├─ ci_search_code — Hybrid code search │
|
|
19
|
+
│ ├─ ci_inspect_symbol — Symbol definition │
|
|
20
|
+
│ ├─ ci_search_history — Git history │
|
|
21
|
+
│ ├─ ci_recall_experience — Past solutions │
|
|
22
|
+
│ ├─ ci_run_validation — Build/test/lint │
|
|
23
|
+
│ ├─ ci_record_experience — Save knowledge │
|
|
24
|
+
│ ├─ ci_trace_flow — BFS call/import traversal │
|
|
25
|
+
│ ├─ ci_analyze_impact — Change impact analysis │
|
|
26
|
+
│ ├─ ci_status — Index state report │
|
|
27
|
+
│ ├─ ci_reindex — Rebuild symbol index │
|
|
28
|
+
│ └─ ci_explore — AST + graph unified query │
|
|
29
|
+
│ │
|
|
30
|
+
│ Prompts (3) │
|
|
31
|
+
│ ├─ debug-runtime-error — 10-step debug workflow │
|
|
32
|
+
│ ├─ implement-feature — 8-step impl workflow │
|
|
33
|
+
│ └─ review-code — 6-step review │
|
|
34
|
+
└──────────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx coding-intelligence-mcp-server
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or from source:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
git clone <repo> && cd coding-intelligence-mcp-server
|
|
47
|
+
npm install
|
|
48
|
+
npm run build
|
|
49
|
+
node dist/index.js
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Tools
|
|
53
|
+
|
|
54
|
+
### Primary Tool
|
|
55
|
+
- **`ci_get_context`** — Call FIRST for any task. Takes a natural language task description and returns relevant symbols, files, tests, git history, and past experiences within a token budget.
|
|
56
|
+
|
|
57
|
+
### AST & Graph Intelligence
|
|
58
|
+
- **`ci_explore`** — Unified code exploration: search by FTS5 full-text, camelCase segments, or symbol name across the graph index. Returns ranked nodes + edges with neighbor context.
|
|
59
|
+
- **`ci_trace_flow`** — BFS traversal of call/import graph. Given a symbol, find callers and callees up to configurable depth. Uses tree-sitter parsed AST relations.
|
|
60
|
+
- **`ci_inspect_symbol`** — Symbol definition with ±5 lines context, callers, callees, related tests, and graph neighbors.
|
|
61
|
+
|
|
62
|
+
### Code Intelligence
|
|
63
|
+
- **`ci_repo_overview`** — Scan repository to infer structure, build system, frameworks, entry points, and commands.
|
|
64
|
+
- **`ci_search_code`** — Hybrid search (ripgrep + symbol matching) with BM25 scoring, language/scope filters.
|
|
65
|
+
|
|
66
|
+
### Change Analysis
|
|
67
|
+
- **`ci_analyze_impact`** — Given file changes, find dependents, imports, exports, and related tests using the graph index.
|
|
68
|
+
- **`ci_status`** — Report index state: repo fingerprint, commit, indexed age, symbol/relation counts, staleness detection.
|
|
69
|
+
- **`ci_reindex`** — Rebuild the symbol index from scratch (full) or via git diff (incremental).
|
|
70
|
+
|
|
71
|
+
### Memory & Learning
|
|
72
|
+
- **`ci_recall_experience`** — Retrieve past verified fixes and knowledge (hybrid: experiences + semantic memories).
|
|
73
|
+
- **`ci_record_experience`** — Save a verified bug-fix with validation evidence (commit SHA, changed files, build/test pass).
|
|
74
|
+
|
|
75
|
+
### Validation
|
|
76
|
+
- **`ci_run_validation`** — Execute build/test/lint from config allowlist (permission-gated).
|
|
77
|
+
|
|
78
|
+
### Git
|
|
79
|
+
- **`ci_search_history`** — Search git commit history by message query.
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
Create `.ci-mcp.json` in your project root:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"commands": {
|
|
88
|
+
"build": "npm run build",
|
|
89
|
+
"test": "npm test",
|
|
90
|
+
"lint": "npm run lint"
|
|
91
|
+
},
|
|
92
|
+
"timeout": 300,
|
|
93
|
+
"storePath": "~/.ci-mcp/store"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Transport modes:
|
|
98
|
+
- `stdio` (default) — for local use with Claude Code, OpenCode
|
|
99
|
+
- `TRANSPORT=http PORT=3000` — for remote/HTTP access
|
|
100
|
+
|
|
101
|
+
## Features
|
|
102
|
+
|
|
103
|
+
### Tree-Sitter AST Parsing
|
|
104
|
+
TypeScript and Python files are parsed via WASM-compiled tree-sitter grammars. The parser extracts:
|
|
105
|
+
- Symbol definitions (class, interface, function, method, type, enum, variable)
|
|
106
|
+
- Call relationships (who calls whom)
|
|
107
|
+
- Import statements (dependency edges)
|
|
108
|
+
- Export declarations
|
|
109
|
+
|
|
110
|
+
Two WASM grammars (~1.8 MB total) ship with the npm package and load lazily.
|
|
111
|
+
|
|
112
|
+
### Graph Model
|
|
113
|
+
A directed graph of symbol dependencies is stored in SQLite with FTS5 full-text search:
|
|
114
|
+
- **Nodes**: each symbol (class, function, method, etc.) is a node
|
|
115
|
+
- **Edges**: calls, extends, implements, imports, composes — all stored as typed edges
|
|
116
|
+
- **Search**: FTS5 (BM25-ranked), LIKE fallback, and **camelCase-aware** matching (`getUserData` → matches `%get%User%Data%`)
|
|
117
|
+
- **Traversal**: BFS shortest-path search on the edge graph
|
|
118
|
+
|
|
119
|
+
### SQLite Store (Production)
|
|
120
|
+
The default persistence backend uses `better-sqlite3` with:
|
|
121
|
+
- Schema migrations (5 current — initial, experiences, memories, FTS5, graph)
|
|
122
|
+
- WAL journal for concurrent reads
|
|
123
|
+
- Foreign key cascading for graph edge cleanup
|
|
124
|
+
- In-memory mode available for tests
|
|
125
|
+
|
|
126
|
+
## Comparison to Xanther
|
|
127
|
+
|
|
128
|
+
| Feature | Xanther XCE | This Server |
|
|
129
|
+
|---------|-------------|-------------|
|
|
130
|
+
| Backend | Hosted | **Local/self-host** |
|
|
131
|
+
| Symbol index | ✅ PRAT | **✅ Tree-sitter AST** |
|
|
132
|
+
| Symbol graph | ❌ | **✅ BFS + FTS5 + camelCase** |
|
|
133
|
+
| Code search | ✅ Semantic | ✅ Hybrid (rg + symbol) |
|
|
134
|
+
| Context bundle | ✅ xce_get_context | ✅ ci_get_context |
|
|
135
|
+
| Execution | ❌ | **✅ Build/test/lint** |
|
|
136
|
+
| Verified memory | ❌ (XME Coming Soon) | **✅ Quality-scored** |
|
|
137
|
+
| Steering files | ✅ | ✅ Prompts included |
|
|
138
|
+
| Open source | Integration only | **Full code** |
|
|
139
|
+
|
|
140
|
+
## Prompts
|
|
141
|
+
|
|
142
|
+
Accessible as MCP Prompt resources:
|
|
143
|
+
- `ci://prompts/debug-runtime-error`
|
|
144
|
+
- `ci://prompts/implement-feature`
|
|
145
|
+
- `ci://prompts/review-code`
|
|
146
|
+
|
|
147
|
+
## Limitations
|
|
148
|
+
- C++/Rust/Go/PHP AST parsing not yet available (only tree-sitter typescript + python WASM grammars are bundled)
|
|
149
|
+
- JSON store (default) doesn't support FTS5 — SQLite mode required for full-text search
|
|
150
|
+
- Incremental reindex (`ci_reindex --mode incremental`) uses git diff but only covers changed files, not cascading dependents
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CIConfig } from "./types.js";
|
|
2
|
+
export declare const SERVER_NAME = "coding-intelligence-mcp-server";
|
|
3
|
+
export declare const SERVER_VERSION = "0.1.0";
|
|
4
|
+
export declare const DEFAULT_STORE_PATH: string;
|
|
5
|
+
export declare const INDEX_FILE = "index.json";
|
|
6
|
+
export declare const MEMORY_FILE = "memory.json";
|
|
7
|
+
export declare const MAX_RESPONSE_CHARS = 25000;
|
|
8
|
+
export declare const MAX_SEARCH_RESULTS = 50;
|
|
9
|
+
export declare const DEFAULT_SEARCH_LIMIT = 20;
|
|
10
|
+
export declare const DEFAULT_CONTEXT_TOKEN_BUDGET = 12000;
|
|
11
|
+
export declare const MIN_CONTEXT_TOKEN_BUDGET = 1000;
|
|
12
|
+
export declare const MAX_CONTEXT_TOKEN_BUDGET = 16000;
|
|
13
|
+
export declare const MAX_VALIDATION_TIMEOUT = 600;
|
|
14
|
+
export declare const DEFAULT_VALIDATION_TIMEOUT = 300;
|
|
15
|
+
export declare const MAX_VALIDATION_OUTPUT = 50000;
|
|
16
|
+
export declare const MAX_RECALL_RESULTS = 10;
|
|
17
|
+
/**
|
|
18
|
+
* Recommended number of primary-tool calls based on project size.
|
|
19
|
+
* Larger codebases need more exploration calls; smaller ones use
|
|
20
|
+
* fewer to avoid overhead.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getExploreBudget(fileCount: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* Output character budget scaled to project size.
|
|
25
|
+
* User's explicit `maxResponseChars` in config wins unconditionally.
|
|
26
|
+
* Falls back to MAX_RESPONSE_CHARS when file count is unknown.
|
|
27
|
+
* Invariant: a larger tier must never get a smaller budget than a smaller one.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getOutputBudget(configOverride: number | null | undefined, fileCount: number | null): number;
|
|
30
|
+
export declare const CONTEXT_BUDGET_BREAKDOWN: {
|
|
31
|
+
readonly repoMap: 1000;
|
|
32
|
+
readonly primaryCode: 6000;
|
|
33
|
+
readonly dependencies: 3000;
|
|
34
|
+
readonly tests: 3000;
|
|
35
|
+
readonly memory: 2000;
|
|
36
|
+
readonly rules: 1000;
|
|
37
|
+
};
|
|
38
|
+
export declare const LANGUAGE_EXTENSIONS: Record<string, string[]>;
|
|
39
|
+
export declare function loadConfig(repoPath?: string): CIConfig;
|
|
40
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C,eAAO,MAAM,WAAW,mCAAmC,CAAC;AAC5D,eAAO,MAAM,cAAc,UAAU,CAAC;AAItC,eAAO,MAAM,kBAAkB,QAAsC,CAAC;AACtE,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAIzC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,4BAA4B,QAAS,CAAC;AACnD,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAC9C,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAgBrC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,MAAM,CAOR;AAED,eAAO,MAAM,wBAAwB;;;;;;;CAO3B,CAAC;AAIX,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAmBxD,CAAC;AAUF,wBAAgB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CA0CtD"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { homedir } from "os";
|
|
2
|
+
import { join, resolve } from "path";
|
|
3
|
+
import { existsSync, readFileSync } from "fs";
|
|
4
|
+
// ─── Server identity ──────────────────────────────────────
|
|
5
|
+
export const SERVER_NAME = "coding-intelligence-mcp-server";
|
|
6
|
+
export const SERVER_VERSION = "0.1.0";
|
|
7
|
+
// ─── Default paths ────────────────────────────────────────
|
|
8
|
+
export const DEFAULT_STORE_PATH = join(homedir(), ".ci-mcp", "store");
|
|
9
|
+
export const INDEX_FILE = "index.json";
|
|
10
|
+
export const MEMORY_FILE = "memory.json";
|
|
11
|
+
// ─── Limits ───────────────────────────────────────────────
|
|
12
|
+
export const MAX_RESPONSE_CHARS = 25_000;
|
|
13
|
+
export const MAX_SEARCH_RESULTS = 50;
|
|
14
|
+
export const DEFAULT_SEARCH_LIMIT = 20;
|
|
15
|
+
export const DEFAULT_CONTEXT_TOKEN_BUDGET = 12_000;
|
|
16
|
+
export const MIN_CONTEXT_TOKEN_BUDGET = 1_000;
|
|
17
|
+
export const MAX_CONTEXT_TOKEN_BUDGET = 16_000;
|
|
18
|
+
export const MAX_VALIDATION_TIMEOUT = 600;
|
|
19
|
+
export const DEFAULT_VALIDATION_TIMEOUT = 300;
|
|
20
|
+
export const MAX_VALIDATION_OUTPUT = 50_000;
|
|
21
|
+
export const MAX_RECALL_RESULTS = 10;
|
|
22
|
+
// ─── Adaptive output budget ────────────────────────────
|
|
23
|
+
// Scale response size by project file count. Small repos don't
|
|
24
|
+
// need the same ceiling as large ones — tighter budgets prevent
|
|
25
|
+
// context bloat and force tools to prioritize relevance.
|
|
26
|
+
// Invariant: a larger tier must never get a smaller per-call budget
|
|
27
|
+
// than a smaller tier.
|
|
28
|
+
const FILE_TIERS = [
|
|
29
|
+
{ max: 150, budget: 13_000 },
|
|
30
|
+
{ max: 500, budget: 18_000 },
|
|
31
|
+
{ max: 5_000, budget: 24_000 },
|
|
32
|
+
{ max: Infinity, budget: 24_000 },
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Recommended number of primary-tool calls based on project size.
|
|
36
|
+
* Larger codebases need more exploration calls; smaller ones use
|
|
37
|
+
* fewer to avoid overhead.
|
|
38
|
+
*/
|
|
39
|
+
export function getExploreBudget(fileCount) {
|
|
40
|
+
if (fileCount < 500)
|
|
41
|
+
return 1;
|
|
42
|
+
else if (fileCount < 5_000)
|
|
43
|
+
return 2;
|
|
44
|
+
else if (fileCount < 15_000)
|
|
45
|
+
return 3;
|
|
46
|
+
else if (fileCount < 25_000)
|
|
47
|
+
return 4;
|
|
48
|
+
else
|
|
49
|
+
return 5;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Output character budget scaled to project size.
|
|
53
|
+
* User's explicit `maxResponseChars` in config wins unconditionally.
|
|
54
|
+
* Falls back to MAX_RESPONSE_CHARS when file count is unknown.
|
|
55
|
+
* Invariant: a larger tier must never get a smaller budget than a smaller one.
|
|
56
|
+
*/
|
|
57
|
+
export function getOutputBudget(configOverride, fileCount) {
|
|
58
|
+
if (configOverride && configOverride > 0)
|
|
59
|
+
return configOverride;
|
|
60
|
+
if (!fileCount || fileCount <= 0)
|
|
61
|
+
return MAX_RESPONSE_CHARS;
|
|
62
|
+
for (const { max, budget } of FILE_TIERS) {
|
|
63
|
+
if (fileCount <= max)
|
|
64
|
+
return budget;
|
|
65
|
+
}
|
|
66
|
+
return MAX_RESPONSE_CHARS;
|
|
67
|
+
}
|
|
68
|
+
export const CONTEXT_BUDGET_BREAKDOWN = {
|
|
69
|
+
repoMap: 1_000,
|
|
70
|
+
primaryCode: 6_000,
|
|
71
|
+
dependencies: 3_000,
|
|
72
|
+
tests: 3_000,
|
|
73
|
+
memory: 2_000,
|
|
74
|
+
rules: 1_000,
|
|
75
|
+
};
|
|
76
|
+
// ─── File extensions by language ──────────────────────────
|
|
77
|
+
export const LANGUAGE_EXTENSIONS = {
|
|
78
|
+
typescript: [".ts", ".tsx", ".mts", ".cts"],
|
|
79
|
+
javascript: [".js", ".jsx", ".mjs", ".cjs"],
|
|
80
|
+
python: [".py", ".pyi", ".pyx"],
|
|
81
|
+
java: [".java", ".kt", ".kts"],
|
|
82
|
+
kotlin: [".kt", ".kts"],
|
|
83
|
+
rust: [".rs", ".rlib"],
|
|
84
|
+
go: [".go"],
|
|
85
|
+
csharp: [".cs", ".csx"],
|
|
86
|
+
cpp: [".cpp", ".cc", ".cxx", ".hpp", ".h"],
|
|
87
|
+
c: [".c", ".h"],
|
|
88
|
+
ruby: [".rb"],
|
|
89
|
+
php: [".php"],
|
|
90
|
+
swift: [".swift"],
|
|
91
|
+
dart: [".dart"],
|
|
92
|
+
scala: [".scala"],
|
|
93
|
+
haskell: [".hs"],
|
|
94
|
+
elixir: [".ex", ".exs"],
|
|
95
|
+
clojure: [".clj", ".cljs", ".cljc"],
|
|
96
|
+
};
|
|
97
|
+
// ─── Config loader ────────────────────────────────────────
|
|
98
|
+
const CONFIG_FILES = [
|
|
99
|
+
".ci-mcp.json",
|
|
100
|
+
"ci-mcp.config.json",
|
|
101
|
+
".coding-intelligence.json",
|
|
102
|
+
];
|
|
103
|
+
export function loadConfig(repoPath) {
|
|
104
|
+
const basePath = repoPath || process.cwd();
|
|
105
|
+
for (const file of CONFIG_FILES) {
|
|
106
|
+
const path = resolve(basePath, file);
|
|
107
|
+
if (existsSync(path)) {
|
|
108
|
+
try {
|
|
109
|
+
const raw = readFileSync(path, "utf-8");
|
|
110
|
+
const cfg = JSON.parse(raw);
|
|
111
|
+
return {
|
|
112
|
+
repoPath: basePath,
|
|
113
|
+
storePath: cfg.storePath || DEFAULT_STORE_PATH,
|
|
114
|
+
maxResponseChars: cfg.maxResponseChars || MAX_RESPONSE_CHARS,
|
|
115
|
+
validation: {
|
|
116
|
+
commands: {
|
|
117
|
+
build: cfg.commands?.build ?? null,
|
|
118
|
+
test: cfg.commands?.test ?? null,
|
|
119
|
+
lint: cfg.commands?.lint ?? null,
|
|
120
|
+
},
|
|
121
|
+
timeout: cfg.timeout ?? DEFAULT_VALIDATION_TIMEOUT,
|
|
122
|
+
maxOutput: cfg.maxOutput ?? MAX_VALIDATION_OUTPUT,
|
|
123
|
+
},
|
|
124
|
+
embeddingMode: cfg.embeddingMode || "none",
|
|
125
|
+
embeddingApi: cfg.embeddingApi,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// fall through
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
repoPath: basePath,
|
|
135
|
+
storePath: DEFAULT_STORE_PATH,
|
|
136
|
+
maxResponseChars: MAX_RESPONSE_CHARS,
|
|
137
|
+
validation: {
|
|
138
|
+
commands: { build: undefined, test: undefined, lint: undefined },
|
|
139
|
+
timeout: DEFAULT_VALIDATION_TIMEOUT,
|
|
140
|
+
maxOutput: MAX_VALIDATION_OUTPUT,
|
|
141
|
+
},
|
|
142
|
+
embeddingMode: "none",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAE9C,6DAA6D;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,6DAA6D;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,6DAA6D;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CA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jB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,kBAAkB;QAC7B,gBAAgB,EAAE,kBAAkB;QACpC,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAChE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,qBAAqB;SACjC;QACD,aAAa,EAAE,MAAM;KACtB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Coding Intelligence MCP Server
|
|
4
|
+
*
|
|
5
|
+
* An "external fine-tuning" layer for cloud coding models.
|
|
6
|
+
* Provides structural code retrieval, project memory, and executable validation.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* ci_repo_overview — Project structure, build system, frameworks
|
|
10
|
+
* ci_search_code — Hybrid code search (ripgrep + symbol matching)
|
|
11
|
+
* ci_inspect_symbol — Symbol definition, callers, callees, tests
|
|
12
|
+
* ci_get_context — [Primary] Context bundle for a task
|
|
13
|
+
* ci_search_history — Git commit history search
|
|
14
|
+
* ci_recall_experience — Retrieve past verified solutions
|
|
15
|
+
* ci_trace_flow — Call/import flow graph traversal
|
|
16
|
+
* ci_status — Index health and staleness check
|
|
17
|
+
* ci_run_validation — Execute build/test/lint (allowlist-gated)
|
|
18
|
+
* ci_analyze_impact — Multi-file change impact analysis
|
|
19
|
+
* ci_reindex — Full or incremental re-indexing
|
|
20
|
+
* ci_record_experience — Save verified experience to memory
|
|
21
|
+
*
|
|
22
|
+
* Resources (prompts):
|
|
23
|
+
* ci://prompts/debug-runtime-error
|
|
24
|
+
* ci://prompts/implement-feature
|
|
25
|
+
* ci://prompts/review-code
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* node dist/index.js # stdio mode (default for local use)
|
|
29
|
+
*/
|
|
30
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
31
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
32
|
+
import { readFileSync, existsSync } from "fs";
|
|
33
|
+
import { join, resolve } from "path";
|
|
34
|
+
import { SERVER_NAME, SERVER_VERSION } from "./constants.js";
|
|
35
|
+
import { loadIndex } from "./store/index.js";
|
|
36
|
+
import { loadMemoryStore } from "./store/memory.js";
|
|
37
|
+
import { loadConfig } from "./constants.js";
|
|
38
|
+
// ─── Import tool registrations ────────────────────────────
|
|
39
|
+
import { registerRepoOverview } from "./tools/repo-overview.js";
|
|
40
|
+
import { registerSearchCode } from "./tools/search-code.js";
|
|
41
|
+
import { registerInspectSymbol } from "./tools/inspect-symbol.js";
|
|
42
|
+
import { registerGetContext } from "./tools/get-context.js";
|
|
43
|
+
import { registerSearchHistory } from "./tools/search-history.js";
|
|
44
|
+
import { registerRecallExperience } from "./tools/recall-experience.js";
|
|
45
|
+
import { registerRunValidation } from "./tools/run-validation.js";
|
|
46
|
+
import { registerRecordExperience } from "./tools/record-experience.js";
|
|
47
|
+
import { registerTraceFlow } from "./tools/trace-flow.js";
|
|
48
|
+
import { registerStatus } from "./tools/status.js";
|
|
49
|
+
import { registerReindex } from "./tools/reindex.js";
|
|
50
|
+
import { registerAnalyzeImpact } from "./tools/analyze-impact.js";
|
|
51
|
+
import { registerExplore } from "./tools/explore.js";
|
|
52
|
+
// ─── Initialize server ────────────────────────────────────
|
|
53
|
+
const server = new McpServer({
|
|
54
|
+
name: SERVER_NAME,
|
|
55
|
+
version: SERVER_VERSION,
|
|
56
|
+
});
|
|
57
|
+
// ─── Load persisted state ─────────────────────────────────
|
|
58
|
+
const config = loadConfig();
|
|
59
|
+
if (config.repoPath) {
|
|
60
|
+
loadIndex(config.storePath);
|
|
61
|
+
loadMemoryStore(config.storePath);
|
|
62
|
+
}
|
|
63
|
+
// ─── Register tools ───────────────────────────────────────
|
|
64
|
+
registerRepoOverview(server);
|
|
65
|
+
registerSearchCode(server);
|
|
66
|
+
registerInspectSymbol(server);
|
|
67
|
+
registerGetContext(server);
|
|
68
|
+
registerSearchHistory(server);
|
|
69
|
+
registerRecallExperience(server);
|
|
70
|
+
registerTraceFlow(server);
|
|
71
|
+
registerStatus(server);
|
|
72
|
+
registerRunValidation(server);
|
|
73
|
+
registerAnalyzeImpact(server);
|
|
74
|
+
registerReindex(server);
|
|
75
|
+
registerRecordExperience(server);
|
|
76
|
+
registerExplore(server);
|
|
77
|
+
// ─── Register prompt resources ────────────────────────────
|
|
78
|
+
const PROMPTS_DIR = resolve(import.meta.dirname, "../prompts");
|
|
79
|
+
function registerPromptResource(name, description) {
|
|
80
|
+
const label = name.replace(/-/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
81
|
+
const filePath = join(PROMPTS_DIR, `${name}.md`);
|
|
82
|
+
// Register as a resource
|
|
83
|
+
server.registerResource(label, `ci://prompts/${name}`, { mimeType: "text/markdown", description }, async (uri) => {
|
|
84
|
+
if (!existsSync(filePath)) {
|
|
85
|
+
throw new Error(`Prompt not found: ${name}`);
|
|
86
|
+
}
|
|
87
|
+
const content = readFileSync(filePath, "utf-8");
|
|
88
|
+
return {
|
|
89
|
+
contents: [{
|
|
90
|
+
uri: uri.toString(),
|
|
91
|
+
mimeType: "text/markdown",
|
|
92
|
+
text: content,
|
|
93
|
+
}],
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
// Register as a prompt template
|
|
97
|
+
server.registerPrompt(name, { description, argsSchema: undefined }, async (args) => {
|
|
98
|
+
if (!existsSync(filePath)) {
|
|
99
|
+
throw new Error(`Prompt not found: ${name}`);
|
|
100
|
+
}
|
|
101
|
+
let content = readFileSync(filePath, "utf-8");
|
|
102
|
+
if (args.task) {
|
|
103
|
+
content = content.replace(/\{\{task\}\}/g, args.task);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
messages: [
|
|
107
|
+
{
|
|
108
|
+
role: "user",
|
|
109
|
+
content: {
|
|
110
|
+
type: "text",
|
|
111
|
+
text: content,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
registerPromptResource("debug-runtime-error", "10-step workflow for debugging runtime errors");
|
|
119
|
+
registerPromptResource("implement-feature", "8-step workflow for implementing new features");
|
|
120
|
+
registerPromptResource("review-code", "6-step code review checklist with security and testing concerns");
|
|
121
|
+
// ─── Transport setup ──────────────────────────────────────
|
|
122
|
+
async function runStdio() {
|
|
123
|
+
const transport = new StdioServerTransport();
|
|
124
|
+
await server.connect(transport);
|
|
125
|
+
console.error(`${SERVER_NAME} v${SERVER_VERSION} running via stdio`);
|
|
126
|
+
console.error(`Tools: repo_overview, search_code, inspect_symbol, get_context, search_history, recall_experience, trace_flow, status, run_validation, analyze_impact, reindex, record_experience`);
|
|
127
|
+
console.error(`Prompts: debug-runtime-error, implement-feature, review-code`);
|
|
128
|
+
}
|
|
129
|
+
// ─── Entry point ──────────────────────────────────────────
|
|
130
|
+
runStdio().catch(error => {
|
|
131
|
+
console.error("Server error:", error);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,C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