ctxjev-mcp 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -5
- package/dist/tools.d.ts +8 -3
- package/dist/tools.js +4 -4
- package/dist/tools.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ config shape differs.
|
|
|
27
27
|
|
|
28
28
|
## Setup
|
|
29
29
|
|
|
30
|
-
Every example below pins the version (`ctxjev-mcp@0.
|
|
30
|
+
Every example below pins the version (`ctxjev-mcp@0.7.0`, the latest on npm), so your host runs the
|
|
31
31
|
release you chose rather than whatever npm has at the time; change the pin to upgrade.
|
|
32
32
|
|
|
33
33
|
Get a key at [console.typesafe.ai/settings/keys](https://console.typesafe.ai/settings/keys) (no
|
|
@@ -37,7 +37,7 @@ returns an error saying `TYPESAFE_API_KEY` isn't set.
|
|
|
37
37
|
**Claude Code:**
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
claude mcp add ctxjev --env TYPESAFE_API_KEY=... -- npx ctxjev-mcp@0.
|
|
40
|
+
claude mcp add ctxjev --env TYPESAFE_API_KEY=... -- npx ctxjev-mcp@0.7.0
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
The ctxjev repo also carries a project-level `.mcp.json`, which runs the server from
|
|
@@ -51,11 +51,11 @@ a local stdio server doesn't use, so it's safe to ignore (or `claude mcp remove
|
|
|
51
51
|
**Codex CLI** (verified against `codex-cli` v0.155.1):
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
codex mcp add ctxjev --env TYPESAFE_API_KEY=... -- npx ctxjev-mcp@0.
|
|
54
|
+
codex mcp add ctxjev --env TYPESAFE_API_KEY=... -- npx ctxjev-mcp@0.7.0
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Or through the [Agent Plugins](https://agent-plugins.org) bundle in the ctxjev repo
|
|
58
|
-
(`.agents/plugins/marketplace.json`), which registers the same `npx ctxjev-mcp@0.
|
|
58
|
+
(`.agents/plugins/marketplace.json`), which registers the same `npx ctxjev-mcp@0.7.0` command:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
codex plugin marketplace add x96x64/ctxjev
|
|
@@ -71,7 +71,7 @@ codex plugin add ctxjev@ctxjev-plugins
|
|
|
71
71
|
"ctxjev": {
|
|
72
72
|
"type": "stdio",
|
|
73
73
|
"command": "npx",
|
|
74
|
-
"args": ["ctxjev-mcp@0.
|
|
74
|
+
"args": ["ctxjev-mcp@0.7.0"],
|
|
75
75
|
"env": { "TYPESAFE_API_KEY": "..." }
|
|
76
76
|
}
|
|
77
77
|
}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Entry, type ScoreCache } from 'ctxjev-core';
|
|
1
|
+
import { type Entry, type JevClient, type ScoreCache } from 'ctxjev-core';
|
|
2
2
|
/**
|
|
3
3
|
* Plain functions wrapping ctxjev-core, kept independent of the MCP framework so they're
|
|
4
4
|
* testable without spinning up a server. src/server.ts adapts these into MCP tool handlers.
|
|
@@ -7,12 +7,17 @@ export declare const SCORE_CACHE_LIMIT = 5000;
|
|
|
7
7
|
export declare function createBoundedScoreCache(limit?: number): ScoreCache & {
|
|
8
8
|
readonly size: number;
|
|
9
9
|
};
|
|
10
|
+
/** What a tool talks to: the server's shared cache and the default Jev client, unless a test passes its own. */
|
|
11
|
+
export type ToolDeps = {
|
|
12
|
+
jevClient?: JevClient;
|
|
13
|
+
cache?: ScoreCache;
|
|
14
|
+
};
|
|
10
15
|
export type ScoreRelevanceArgs = {
|
|
11
16
|
goal: string;
|
|
12
17
|
entries: Entry[];
|
|
13
18
|
recencyWeight?: number;
|
|
14
19
|
};
|
|
15
|
-
export declare function scoreRelevanceTool({ goal, entries, recencyWeight }: ScoreRelevanceArgs): Promise<{
|
|
20
|
+
export declare function scoreRelevanceTool({ goal, entries, recencyWeight }: ScoreRelevanceArgs, { jevClient, cache }?: ToolDeps): Promise<{
|
|
16
21
|
scored: import("ctxjev-core").ScoredEntry[];
|
|
17
22
|
usage: import("ctxjev-core").JevUsage;
|
|
18
23
|
}>;
|
|
@@ -20,7 +25,7 @@ export type PruneHistoryArgs = ScoreRelevanceArgs & {
|
|
|
20
25
|
dropBelow?: number;
|
|
21
26
|
summarizeBelow?: number;
|
|
22
27
|
};
|
|
23
|
-
export declare function pruneHistoryTool({ goal, entries, recencyWeight, dropBelow, summarizeBelow }: PruneHistoryArgs): Promise<{
|
|
28
|
+
export declare function pruneHistoryTool({ goal, entries, recencyWeight, dropBelow, summarizeBelow }: PruneHistoryArgs, { jevClient, cache }?: ToolDeps): Promise<{
|
|
24
29
|
decisions: import("ctxjev-core").PruneDecision[];
|
|
25
30
|
savings: import("ctxjev-core").SavingsReport;
|
|
26
31
|
usage: import("ctxjev-core").JevUsage;
|
package/dist/tools.js
CHANGED
|
@@ -30,15 +30,15 @@ export function createBoundedScoreCache(limit = SCORE_CACHE_LIMIT) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
const scoreCache = createBoundedScoreCache();
|
|
33
|
-
export async function scoreRelevanceTool({ goal, entries, recencyWeight }) {
|
|
33
|
+
export async function scoreRelevanceTool({ goal, entries, recencyWeight }, { jevClient, cache = scoreCache } = {}) {
|
|
34
34
|
const { usage, onUsage } = createUsageAccumulator();
|
|
35
35
|
// core's own default scorer is 'recency' as of 0.6.0 (see prune.ts), since the holdout eval tied
|
|
36
36
|
// Jev on task success. This tool's whole purpose is exposing Jev scoring, so it keeps asking for
|
|
37
37
|
// it explicitly rather than silently inheriting that default.
|
|
38
|
-
const scored = await scoreEntries(entries, goal, recencyWeight ?? DEFAULT_POLICY.recencyWeight, { onUsage, cache
|
|
38
|
+
const scored = await scoreEntries(entries, goal, recencyWeight ?? DEFAULT_POLICY.recencyWeight, { onUsage, cache, jevClient, scorer: 'jev' });
|
|
39
39
|
return { scored, usage };
|
|
40
40
|
}
|
|
41
|
-
export async function pruneHistoryTool({ goal, entries, recencyWeight, dropBelow, summarizeBelow }) {
|
|
41
|
+
export async function pruneHistoryTool({ goal, entries, recencyWeight, dropBelow, summarizeBelow }, { jevClient, cache = scoreCache } = {}) {
|
|
42
42
|
const policy = {
|
|
43
43
|
dropBelow: dropBelow ?? DEFAULT_POLICY.dropBelow,
|
|
44
44
|
summarizeBelow: summarizeBelow ?? DEFAULT_POLICY.summarizeBelow,
|
|
@@ -46,7 +46,7 @@ export async function pruneHistoryTool({ goal, entries, recencyWeight, dropBelow
|
|
|
46
46
|
};
|
|
47
47
|
validatePolicyOrdering(policy.dropBelow, policy.summarizeBelow);
|
|
48
48
|
const { usage, onUsage } = createUsageAccumulator();
|
|
49
|
-
const decisions = await pruneContext(entries, goal, policy, { onUsage, cache
|
|
49
|
+
const decisions = await pruneContext(entries, goal, policy, { onUsage, cache, jevClient, scorer: 'jev' });
|
|
50
50
|
const savings = summarizeSavings(entries, decisions);
|
|
51
51
|
return { decisions, savings, usage };
|
|
52
52
|
}
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAmE,MAAM,aAAa,CAAA;AACnL,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AAEH,6FAA6F;AAC7F,+FAA+F;AAC/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAEtC,MAAM,UAAU,uBAAuB,CAAC,KAAK,GAAG,iBAAiB;IAC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,EAAE,KAAK,EAAE,CAAA;AAC1B,CAAC;AAOD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAoB,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,UAAU,KAAe,EAAE;IACpK,MAAM,MAAM,GAAkB;QAC5B,SAAS,EAAE,SAAS,IAAI,cAAc,CAAC,SAAS;QAChD,cAAc,EAAE,cAAc,IAAI,cAAc,CAAC,cAAc;QAC/D,aAAa,EAAE,aAAa,IAAI,cAAc,CAAC,aAAa;KAC7D,CAAA;IACD,sBAAsB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IAE/D,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,sBAAsB,EAAE,CAAA;IACnD,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IACzG,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctxjev-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "MCP server exposing ctxjev's Jev-based context scoring/pruning as tools for any MCP-capable agent host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": {
|
|
17
|
-
"name": "
|
|
17
|
+
"name": "Re:COO",
|
|
18
18
|
"url": "https://github.com/x96x64"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
42
42
|
"zod": "^4.6.5",
|
|
43
|
-
"ctxjev-core": "0.
|
|
43
|
+
"ctxjev-core": "0.7.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22",
|