kiri-mcp-server 0.6.0 → 0.8.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 +27 -17
- package/config/scoring-profiles.yml +15 -0
- package/dist/config/scoring-profiles.yml +15 -0
- package/dist/package.json +1 -1
- package/dist/src/server/context.d.ts +2 -0
- package/dist/src/server/context.d.ts.map +1 -1
- package/dist/src/server/handlers.d.ts +1 -0
- package/dist/src/server/handlers.d.ts.map +1 -1
- package/dist/src/server/handlers.js +327 -93
- package/dist/src/server/handlers.js.map +1 -1
- package/dist/src/server/rpc.d.ts +34 -0
- package/dist/src/server/rpc.d.ts.map +1 -1
- package/dist/src/server/rpc.js +76 -4
- package/dist/src/server/rpc.js.map +1 -1
- package/dist/src/server/runtime.d.ts.map +1 -1
- package/dist/src/server/runtime.js +2 -0
- package/dist/src/server/runtime.js.map +1 -1
- package/dist/src/server/scoring.d.ts +6 -0
- package/dist/src/server/scoring.d.ts.map +1 -1
- package/dist/src/server/scoring.js +22 -4
- package/dist/src/server/scoring.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Intelligent code context extraction for LLMs via Model Context Protocol
|
|
4
4
|
|
|
5
|
-
[](package.json)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://modelcontextprotocol.io/)
|
|
@@ -157,11 +157,19 @@ KIRI provides 5 MCP tools for intelligent code exploration:
|
|
|
157
157
|
|
|
158
158
|
The most powerful tool for getting started with unfamiliar code. Provide a task description, and KIRI returns the most relevant code snippets using phrase-aware tokenization and path-based scoring.
|
|
159
159
|
|
|
160
|
-
**v0.
|
|
160
|
+
**v0.8.0 improvements:**
|
|
161
161
|
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
162
|
+
- **⚡ Compact mode default (BREAKING)**: `compact: true` is now default, reducing token usage by ~95% (55K → 2.5K tokens). Set `compact: false` to restore full preview mode.
|
|
163
|
+
- **🔧 Separated config penalties**: Configuration files (`.json`, `.yaml`, `.env`) now have independent 95% penalty (×0.05), separate from documentation penalty (×0.5)
|
|
164
|
+
- **🌐 Multi-language config support**: Recognizes config files across all languages (`package.json`, `tsconfig.json`, `composer.json`, `Gemfile`, etc.)
|
|
165
|
+
- **🛡️ Production hardening**: Memory leak prevention in WarningManager, configurable warning limits, improved path matching
|
|
166
|
+
|
|
167
|
+
**v0.7.0 improvements:**
|
|
168
|
+
|
|
169
|
+
- **Multiplicative penalties**: Documentation files now penalized by ×0.5 (50% reduction) instead of additive -2.0
|
|
170
|
+
- **Implementation prioritization**: Implementation files rank 3-5× higher than documentation
|
|
171
|
+
- **Unified boosting logic**: Consistent file ranking across `files_search` and `context_bundle`
|
|
172
|
+
- **Configurable profiles**: `boost_profile` parameter supports "default" (implementation-first), "docs" (documentation-first), or "none" (natural BM25)
|
|
165
173
|
|
|
166
174
|
**When to use:**
|
|
167
175
|
|
|
@@ -184,12 +192,12 @@ The most powerful tool for getting started with unfamiliar code. Provide a task
|
|
|
184
192
|
|
|
185
193
|
**Parameters:**
|
|
186
194
|
|
|
187
|
-
| Parameter | Type | Required | Description
|
|
188
|
-
| --------------- | ------- | -------- |
|
|
189
|
-
| `goal` | string | Yes | Task description or question about the code
|
|
190
|
-
| `limit` | number | No | Max snippets to return (default: 12, max: 20)
|
|
191
|
-
| `compact` | boolean | No | Return only metadata without preview (default: false) |
|
|
192
|
-
| `boost_profile` | string | No | File type boosting: "default", "docs", "none"
|
|
195
|
+
| Parameter | Type | Required | Description |
|
|
196
|
+
| --------------- | ------- | -------- | ---------------------------------------------------------------------------------- |
|
|
197
|
+
| `goal` | string | Yes | Task description or question about the code |
|
|
198
|
+
| `limit` | number | No | Max snippets to return (default: 12, max: 20) |
|
|
199
|
+
| `compact` | boolean | No | Return only metadata without preview (default: **true** in v0.8.0+, false in v0.7) |
|
|
200
|
+
| `boost_profile` | string | No | File type boosting: "default", "docs", "none" |
|
|
193
201
|
|
|
194
202
|
### 2. files_search
|
|
195
203
|
|
|
@@ -650,11 +658,11 @@ See [docs/architecture.md](docs/architecture.md) for detailed technical informat
|
|
|
650
658
|
|
|
651
659
|
### Performance
|
|
652
660
|
|
|
653
|
-
| Metric
|
|
654
|
-
|
|
|
655
|
-
| **Time to First Result**
|
|
656
|
-
| **Precision @ 10**
|
|
657
|
-
| **Token Reduction**
|
|
661
|
+
| Metric | Target | Current |
|
|
662
|
+
| ----------------------------- | ------ | ------------- |
|
|
663
|
+
| **Time to First Result** | ≤ 1.0s | ✅ 0.8s |
|
|
664
|
+
| **Precision @ 10** | ≥ 0.7 | ✅ 0.75 |
|
|
665
|
+
| **Token Reduction (compact)** | ≥ 90% | ✅ 95% (v0.8) |
|
|
658
666
|
|
|
659
667
|
### Community
|
|
660
668
|
|
|
@@ -733,6 +741,8 @@ Built with:
|
|
|
733
741
|
|
|
734
742
|
---
|
|
735
743
|
|
|
736
|
-
**Status**: v0.
|
|
744
|
+
**Status**: v0.8.0 (Beta) - Production-ready for MCP clients
|
|
745
|
+
|
|
746
|
+
**Breaking Changes in v0.8.0**: `compact` mode is now default. Existing integrations should set `compact: false` explicitly if full preview content is required. See [CHANGELOG.md](CHANGELOG.md) for migration guide.
|
|
737
747
|
|
|
738
748
|
For questions or support, please open a [GitHub issue](https://github.com/CAPHTECH/kiri/issues).
|
|
@@ -8,6 +8,9 @@ default:
|
|
|
8
8
|
dependency: 0.6 # Dependency relationship weight (increased to prioritize connected implementation files)
|
|
9
9
|
proximity: 0.25 # Same directory weight
|
|
10
10
|
structural: 0.6 # Structural similarity weight (reduced to prevent false positives from similar structure)
|
|
11
|
+
docPenaltyMultiplier: 0.5 # Multiplicative penalty for docs (0.5 = 50% reduction)
|
|
12
|
+
configPenaltyMultiplier: 0.05 # Multiplicative penalty for config files (0.05 = 95% reduction)
|
|
13
|
+
implBoostMultiplier: 1.3 # Multiplicative boost for implementation files (1.3 = 30% boost)
|
|
11
14
|
|
|
12
15
|
bugfix:
|
|
13
16
|
textMatch: 1.0
|
|
@@ -16,6 +19,9 @@ bugfix:
|
|
|
16
19
|
dependency: 0.7 # Higher: bugs often in dependencies
|
|
17
20
|
proximity: 0.35
|
|
18
21
|
structural: 0.7 # Reduced: prevent canvas-agent matching when searching page-agent
|
|
22
|
+
docPenaltyMultiplier: 0.5
|
|
23
|
+
configPenaltyMultiplier: 0.05
|
|
24
|
+
implBoostMultiplier: 1.3
|
|
19
25
|
|
|
20
26
|
testfail:
|
|
21
27
|
textMatch: 1.0
|
|
@@ -24,6 +30,9 @@ testfail:
|
|
|
24
30
|
dependency: 0.85 # Very high: failed tests reveal dependencies
|
|
25
31
|
proximity: 0.3
|
|
26
32
|
structural: 0.7 # Reduced: focus on actual test dependencies
|
|
33
|
+
docPenaltyMultiplier: 0.5
|
|
34
|
+
configPenaltyMultiplier: 0.05
|
|
35
|
+
implBoostMultiplier: 1.3
|
|
27
36
|
|
|
28
37
|
typeerror:
|
|
29
38
|
textMatch: 1.0
|
|
@@ -32,6 +41,9 @@ typeerror:
|
|
|
32
41
|
dependency: 0.6
|
|
33
42
|
proximity: 0.4 # Higher: type errors cluster in modules
|
|
34
43
|
structural: 0.6 # Already balanced for type analysis
|
|
44
|
+
docPenaltyMultiplier: 0.5
|
|
45
|
+
configPenaltyMultiplier: 0.05
|
|
46
|
+
implBoostMultiplier: 1.3
|
|
35
47
|
|
|
36
48
|
feature:
|
|
37
49
|
textMatch: 1.0
|
|
@@ -40,3 +52,6 @@ feature:
|
|
|
40
52
|
dependency: 0.45 # Lower: new features less dependent
|
|
41
53
|
proximity: 0.5 # Higher: features cluster spatially
|
|
42
54
|
structural: 0.6 # Reduced: focus on actual feature files
|
|
55
|
+
docPenaltyMultiplier: 0.5
|
|
56
|
+
configPenaltyMultiplier: 0.05
|
|
57
|
+
implBoostMultiplier: 1.3
|
|
@@ -8,6 +8,9 @@ default:
|
|
|
8
8
|
dependency: 0.6 # Dependency relationship weight (increased to prioritize connected implementation files)
|
|
9
9
|
proximity: 0.25 # Same directory weight
|
|
10
10
|
structural: 0.6 # Structural similarity weight (reduced to prevent false positives from similar structure)
|
|
11
|
+
docPenaltyMultiplier: 0.5 # Multiplicative penalty for docs (0.5 = 50% reduction)
|
|
12
|
+
configPenaltyMultiplier: 0.05 # Multiplicative penalty for config files (0.05 = 95% reduction)
|
|
13
|
+
implBoostMultiplier: 1.3 # Multiplicative boost for implementation files (1.3 = 30% boost)
|
|
11
14
|
|
|
12
15
|
bugfix:
|
|
13
16
|
textMatch: 1.0
|
|
@@ -16,6 +19,9 @@ bugfix:
|
|
|
16
19
|
dependency: 0.7 # Higher: bugs often in dependencies
|
|
17
20
|
proximity: 0.35
|
|
18
21
|
structural: 0.7 # Reduced: prevent canvas-agent matching when searching page-agent
|
|
22
|
+
docPenaltyMultiplier: 0.5
|
|
23
|
+
configPenaltyMultiplier: 0.05
|
|
24
|
+
implBoostMultiplier: 1.3
|
|
19
25
|
|
|
20
26
|
testfail:
|
|
21
27
|
textMatch: 1.0
|
|
@@ -24,6 +30,9 @@ testfail:
|
|
|
24
30
|
dependency: 0.85 # Very high: failed tests reveal dependencies
|
|
25
31
|
proximity: 0.3
|
|
26
32
|
structural: 0.7 # Reduced: focus on actual test dependencies
|
|
33
|
+
docPenaltyMultiplier: 0.5
|
|
34
|
+
configPenaltyMultiplier: 0.05
|
|
35
|
+
implBoostMultiplier: 1.3
|
|
27
36
|
|
|
28
37
|
typeerror:
|
|
29
38
|
textMatch: 1.0
|
|
@@ -32,6 +41,9 @@ typeerror:
|
|
|
32
41
|
dependency: 0.6
|
|
33
42
|
proximity: 0.4 # Higher: type errors cluster in modules
|
|
34
43
|
structural: 0.6 # Already balanced for type analysis
|
|
44
|
+
docPenaltyMultiplier: 0.5
|
|
45
|
+
configPenaltyMultiplier: 0.05
|
|
46
|
+
implBoostMultiplier: 1.3
|
|
35
47
|
|
|
36
48
|
feature:
|
|
37
49
|
textMatch: 1.0
|
|
@@ -40,3 +52,6 @@ feature:
|
|
|
40
52
|
dependency: 0.45 # Lower: new features less dependent
|
|
41
53
|
proximity: 0.5 # Higher: features cluster spatially
|
|
42
54
|
structural: 0.6 # Reduced: focus on actual feature files
|
|
55
|
+
docPenaltyMultiplier: 0.5
|
|
56
|
+
configPenaltyMultiplier: 0.05
|
|
57
|
+
implBoostMultiplier: 1.3
|
package/dist/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { DuckDBClient } from "../shared/duckdb.js";
|
|
2
|
+
import { WarningManager } from "./rpc.js";
|
|
2
3
|
export interface ServerContext {
|
|
3
4
|
db: DuckDBClient;
|
|
4
5
|
repoId: number;
|
|
5
6
|
features?: {
|
|
6
7
|
fts?: boolean;
|
|
7
8
|
};
|
|
9
|
+
warningManager: WarningManager;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/server/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/server/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,YAAY,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;IACF,cAAc,EAAE,cAAc,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/server/handlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,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