@praxis-ai/mcp-plus 1.0.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 +96 -0
- package/dist/index.d.mts +149 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +209 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @praxis-ai/mcp-plus
|
|
2
|
+
|
|
3
|
+
MCP+ is a wrapper-mode exposure and authoring layer for Model Context Protocol servers.
|
|
4
|
+
|
|
5
|
+
It is not a new protocol and it is not an MCP replacement. MCP+ keeps native MCP server, client, and tool-call shapes intact while helping hosts expose large MCP tool surfaces more efficiently.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @praxis-ai/mcp-plus
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Write A Manifest
|
|
14
|
+
|
|
15
|
+
TypeScript projects can use `mcp-plus.config.ts`:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { defineMcpPlusManifest } from '@praxis-ai/mcp-plus';
|
|
19
|
+
|
|
20
|
+
export default defineMcpPlusManifest({
|
|
21
|
+
server: {
|
|
22
|
+
id: 'browser-plus',
|
|
23
|
+
title: 'Browser MCP+',
|
|
24
|
+
summary: 'Browser automation with folded low-frequency diagnostics.'
|
|
25
|
+
},
|
|
26
|
+
exposure: {
|
|
27
|
+
pinnedTools: ['browser.open', 'page.snapshot'],
|
|
28
|
+
indexedTools: ['network.status'],
|
|
29
|
+
toolCards: {
|
|
30
|
+
'network.status': {
|
|
31
|
+
title: 'Network status',
|
|
32
|
+
summary: 'Inspect network requests only when diagnostics are needed.',
|
|
33
|
+
keywords: ['network', 'requests']
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
warmAfterConsecutiveCalls: 2,
|
|
37
|
+
demoteAfterUnusedTurns: 2,
|
|
38
|
+
freezeAfterUnusedTurns: 5
|
|
39
|
+
},
|
|
40
|
+
skills: {
|
|
41
|
+
chapters: [
|
|
42
|
+
{
|
|
43
|
+
id: 'page-inspection',
|
|
44
|
+
title: 'Page inspection',
|
|
45
|
+
summary: 'Open the page, snapshot it, then expand diagnostics only when needed.'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Other languages can use `mcp-plus.json` with the same manifest shape:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"server": {
|
|
57
|
+
"id": "browser-plus",
|
|
58
|
+
"title": "Browser MCP+",
|
|
59
|
+
"summary": "Browser automation with folded low-frequency diagnostics."
|
|
60
|
+
},
|
|
61
|
+
"exposure": {
|
|
62
|
+
"pinnedTools": ["browser.open", "page.snapshot"],
|
|
63
|
+
"indexedTools": ["network.status"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Compile A Native MCP Tool List
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { compileMcpPlusManifest, lowerExposurePlanToMcpSurface, planExposure } from '@praxis-ai/mcp-plus';
|
|
72
|
+
import manifest from './mcp-plus.config.js';
|
|
73
|
+
|
|
74
|
+
const graph = compileMcpPlusManifest(manifest, nativeToolsFromMcpToolsList);
|
|
75
|
+
const plan = planExposure(graph, {
|
|
76
|
+
serverId: manifest.server.id,
|
|
77
|
+
mode: 'expanded',
|
|
78
|
+
activeTools: []
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const surface = lowerExposurePlanToMcpSurface(plan);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`surface.tools` is still MCP-compatible. `surface.sidecar` contains compact server, tool, and skill index metadata for MCP+-aware wrappers or host adapters.
|
|
85
|
+
|
|
86
|
+
## Core Ideas
|
|
87
|
+
|
|
88
|
+
- pinned tools keep full native MCP schemas visible;
|
|
89
|
+
- indexed tools fold into compact capability cards;
|
|
90
|
+
- `mcp_plus.expand` can activate folded tools in wrapper mode;
|
|
91
|
+
- skill indexes stay compact while full skill notes live in a server-bound skill store;
|
|
92
|
+
- `mcp_plus.finish` lets a wrapper ask the model to preserve reusable workflow experience.
|
|
93
|
+
|
|
94
|
+
## Compatibility
|
|
95
|
+
|
|
96
|
+
MCP+ metadata is additive. Standard MCP clients should still be able to interact with the underlying MCP server through standard MCP primitives.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
type JsonSchema = {
|
|
3
|
+
type?: string;
|
|
4
|
+
properties?: Record<string, JsonSchema>;
|
|
5
|
+
required?: string[];
|
|
6
|
+
additionalProperties?: boolean;
|
|
7
|
+
description?: string;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
items?: JsonSchema;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
type NativeToolDeclaration = {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema: JsonSchema;
|
|
16
|
+
};
|
|
17
|
+
type McpPlusServerManifest = {
|
|
18
|
+
id: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
summary: string;
|
|
21
|
+
};
|
|
22
|
+
type McpPlusExposurePolicy = {
|
|
23
|
+
pinnedTools?: string[];
|
|
24
|
+
warmTools?: string[];
|
|
25
|
+
indexedTools?: string[];
|
|
26
|
+
alwaysIndexTools?: string[];
|
|
27
|
+
toolCards?: Record<string, ToolCardPolicy>;
|
|
28
|
+
freezeAfterUnusedTurns?: number;
|
|
29
|
+
warmAfterConsecutiveCalls?: number;
|
|
30
|
+
demoteAfterUnusedTurns?: number;
|
|
31
|
+
};
|
|
32
|
+
type ToolCardPolicy = {
|
|
33
|
+
title?: string;
|
|
34
|
+
summary?: string;
|
|
35
|
+
keywords?: string[];
|
|
36
|
+
};
|
|
37
|
+
type McpPlusSkillChapter = {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
summary: string;
|
|
41
|
+
};
|
|
42
|
+
type McpPlusSkillPolicy = {
|
|
43
|
+
storage?: string;
|
|
44
|
+
chapters?: McpPlusSkillChapter[];
|
|
45
|
+
};
|
|
46
|
+
type McpPlusManifest = {
|
|
47
|
+
server: McpPlusServerManifest;
|
|
48
|
+
exposure?: McpPlusExposurePolicy;
|
|
49
|
+
skills?: McpPlusSkillPolicy;
|
|
50
|
+
};
|
|
51
|
+
declare function defineMcpPlusManifest<const TManifest extends McpPlusManifest>(manifest: TManifest): TManifest;
|
|
52
|
+
type CapabilityActivation = {
|
|
53
|
+
serverId: string;
|
|
54
|
+
toolName: string;
|
|
55
|
+
};
|
|
56
|
+
type ToolIndexEntry = {
|
|
57
|
+
id: string;
|
|
58
|
+
title: string;
|
|
59
|
+
summary: string;
|
|
60
|
+
activation: CapabilityActivation;
|
|
61
|
+
pinned: boolean;
|
|
62
|
+
};
|
|
63
|
+
type SkillIndexEntry = {
|
|
64
|
+
id: string;
|
|
65
|
+
title: string;
|
|
66
|
+
summary: string;
|
|
67
|
+
serverId: string;
|
|
68
|
+
whenToUse?: string;
|
|
69
|
+
why?: string;
|
|
70
|
+
pitfallsPreview?: string[];
|
|
71
|
+
};
|
|
72
|
+
type ServerCard = {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
summary: string;
|
|
76
|
+
mode: ExposureMode;
|
|
77
|
+
};
|
|
78
|
+
type ExposureMode = 'expanded' | 'indexed' | 'frozen';
|
|
79
|
+
type ExposureGraph = {
|
|
80
|
+
server: McpPlusServerManifest;
|
|
81
|
+
tools: NativeToolDeclaration[];
|
|
82
|
+
pinnedToolNames: Set<string>;
|
|
83
|
+
warmToolNames: Set<string>;
|
|
84
|
+
indexedToolNames: Set<string>;
|
|
85
|
+
alwaysIndexToolNames: Set<string>;
|
|
86
|
+
toolCards: Record<string, ToolCardPolicy>;
|
|
87
|
+
skillIndex: SkillIndexEntry[];
|
|
88
|
+
policy: Required<Pick<McpPlusExposurePolicy, 'freezeAfterUnusedTurns' | 'warmAfterConsecutiveCalls' | 'demoteAfterUnusedTurns'>>;
|
|
89
|
+
};
|
|
90
|
+
type ExposureState = {
|
|
91
|
+
serverId: string;
|
|
92
|
+
mode: ExposureMode;
|
|
93
|
+
activeTools?: string[];
|
|
94
|
+
};
|
|
95
|
+
type ExposurePlan = {
|
|
96
|
+
serverCard: ServerCard;
|
|
97
|
+
visibleTools: NativeToolDeclaration[];
|
|
98
|
+
toolIndex: ToolIndexEntry[];
|
|
99
|
+
skillIndex: SkillIndexEntry[];
|
|
100
|
+
};
|
|
101
|
+
type McpPlusSidecar = {
|
|
102
|
+
serverCard: ServerCard;
|
|
103
|
+
toolIndex: ToolIndexEntry[];
|
|
104
|
+
skillIndex: SkillIndexEntry[];
|
|
105
|
+
};
|
|
106
|
+
type McpCompatibleSurface = {
|
|
107
|
+
tools: NativeToolDeclaration[];
|
|
108
|
+
sidecar: McpPlusSidecar;
|
|
109
|
+
};
|
|
110
|
+
type ExposureImpactEstimate = {
|
|
111
|
+
nativeToolCount: number;
|
|
112
|
+
visibleToolCount: number;
|
|
113
|
+
indexedToolCount: number;
|
|
114
|
+
fullSchemaCharacters: number;
|
|
115
|
+
visibleSchemaCharacters: number;
|
|
116
|
+
foldedContextCharacters: number;
|
|
117
|
+
schemaCharacterSavings: number;
|
|
118
|
+
indexedActivationTurns: number;
|
|
119
|
+
stableIndexCharacters: number;
|
|
120
|
+
};
|
|
121
|
+
type ExpandRequest = {
|
|
122
|
+
server?: string;
|
|
123
|
+
request: string;
|
|
124
|
+
};
|
|
125
|
+
type ExpandResult = {
|
|
126
|
+
serverId: string;
|
|
127
|
+
activatedTools: string[];
|
|
128
|
+
mode: ExposureMode;
|
|
129
|
+
};
|
|
130
|
+
declare function compileMcpPlusManifest(manifest: McpPlusManifest, nativeTools: NativeToolDeclaration[]): ExposureGraph;
|
|
131
|
+
declare function planExposure(graph: ExposureGraph, state: ExposureState): ExposurePlan;
|
|
132
|
+
declare function createExpandToolDeclaration(): NativeToolDeclaration;
|
|
133
|
+
declare function lowerExposurePlanToMcpSurface(plan: ExposurePlan): McpCompatibleSurface;
|
|
134
|
+
declare function estimateExposurePlanImpact(graph: ExposureGraph, plan: ExposurePlan): ExposureImpactEstimate;
|
|
135
|
+
declare class ExposurePlanner {
|
|
136
|
+
private readonly graph;
|
|
137
|
+
constructor(graph: ExposureGraph);
|
|
138
|
+
plan(state: ExposureState): ExposurePlan;
|
|
139
|
+
}
|
|
140
|
+
declare class McpPlusWrapperRuntime {
|
|
141
|
+
#private;
|
|
142
|
+
private readonly graph;
|
|
143
|
+
constructor(graph: ExposureGraph, initialState?: Partial<ExposureState>);
|
|
144
|
+
getSurface(): McpCompatibleSurface;
|
|
145
|
+
expand(request: ExpandRequest): ExpandResult;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { CapabilityActivation, ExpandRequest, ExpandResult, ExposureGraph, ExposureImpactEstimate, ExposureMode, ExposurePlan, ExposurePlanner, ExposureState, JsonSchema, McpCompatibleSurface, McpPlusExposurePolicy, McpPlusManifest, McpPlusServerManifest, McpPlusSidecar, McpPlusSkillChapter, McpPlusSkillPolicy, McpPlusWrapperRuntime, NativeToolDeclaration, ServerCard, SkillIndexEntry, ToolCardPolicy, ToolIndexEntry, compileMcpPlusManifest, createExpandToolDeclaration, defineMcpPlusManifest, estimateExposurePlanImpact, lowerExposurePlanToMcpSurface, planExposure };
|
|
149
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";KAAY,UAAA;EAAA,IAAA,CAAA,EAAA,MAAU;EAEU,UAAA,CAAA,EAAf,MAAe,CAAA,MAAA,EAAA,UAAA,CAAA;EAAf,QAAA,CAAA,EAAA,MAAA,EAAA;E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AAA,GAAA,wBAAA,CAAA,CAAA;;KAhN3C,aAAA;;QAEF;;;KAIE,YAAA;cACI;gBACE;aACH;cACC;;KAGJ,cAAA;cACI;aACD;cACC;;KAGJ,oBAAA;SACD;WACE;;KAGD,sBAAA;;;;;;;;;;;KAYA,aAAA;;;;KAKA,YAAA;;;QAGF;;iBAOM,sBAAA,WAAiC,8BAA8B,0BAA0B;iBAkCzF,YAAA,QAAoB,sBAAsB,gBAAgB;iBA6C1D,2BAAA,CAAA,GAA+B;iBAsB/B,6BAAA,OAAoC,eAAe;iBAWnD,0BAAA,QAAkC,qBAAqB,eAAe;cAmBzE,eAAA;;qBACkC;cAExB,gBAAgB;;cAK1B,qBAAA;;;qBAImB,8BACT,QAAQ;gBASN;kBAIE,gBAAgB"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
function defineMcpPlusManifest(manifest) {
|
|
3
|
+
return manifest;
|
|
4
|
+
}
|
|
5
|
+
const DEFAULT_FREEZE_AFTER_UNUSED_TURNS = 5;
|
|
6
|
+
const DEFAULT_WARM_AFTER_CONSECUTIVE_CALLS = 2;
|
|
7
|
+
const DEFAULT_DEMOTE_AFTER_UNUSED_TURNS = 2;
|
|
8
|
+
function compileMcpPlusManifest(manifest, nativeTools) {
|
|
9
|
+
const pinnedToolNames = new Set(manifest.exposure?.pinnedTools);
|
|
10
|
+
const warmToolNames = new Set(manifest.exposure?.warmTools);
|
|
11
|
+
const alwaysIndexToolNames = new Set(manifest.exposure?.alwaysIndexTools);
|
|
12
|
+
const indexedToolNames = new Set([...manifest.exposure?.indexedTools ?? [], ...alwaysIndexToolNames]);
|
|
13
|
+
for (const tool of nativeTools) if (!pinnedToolNames.has(tool.name) && !warmToolNames.has(tool.name)) indexedToolNames.add(tool.name);
|
|
14
|
+
return {
|
|
15
|
+
server: manifest.server,
|
|
16
|
+
tools: nativeTools.toSorted(compareByName),
|
|
17
|
+
pinnedToolNames,
|
|
18
|
+
warmToolNames,
|
|
19
|
+
indexedToolNames,
|
|
20
|
+
alwaysIndexToolNames,
|
|
21
|
+
toolCards: manifest.exposure?.toolCards ?? {},
|
|
22
|
+
skillIndex: (manifest.skills?.chapters ?? []).map((chapter) => ({
|
|
23
|
+
id: chapter.id,
|
|
24
|
+
title: chapter.title,
|
|
25
|
+
summary: chapter.summary,
|
|
26
|
+
serverId: manifest.server.id
|
|
27
|
+
})),
|
|
28
|
+
policy: {
|
|
29
|
+
freezeAfterUnusedTurns: manifest.exposure?.freezeAfterUnusedTurns ?? DEFAULT_FREEZE_AFTER_UNUSED_TURNS,
|
|
30
|
+
warmAfterConsecutiveCalls: manifest.exposure?.warmAfterConsecutiveCalls ?? DEFAULT_WARM_AFTER_CONSECUTIVE_CALLS,
|
|
31
|
+
demoteAfterUnusedTurns: manifest.exposure?.demoteAfterUnusedTurns ?? DEFAULT_DEMOTE_AFTER_UNUSED_TURNS
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function planExposure(graph, state) {
|
|
36
|
+
if (state.serverId !== graph.server.id) throw new Error(`Exposure state server ${state.serverId} does not match graph server ${graph.server.id}`);
|
|
37
|
+
const serverCard = createServerCard(graph, state.mode);
|
|
38
|
+
const expandTool = createExpandToolDeclaration();
|
|
39
|
+
if (state.mode === "frozen") return {
|
|
40
|
+
serverCard,
|
|
41
|
+
visibleTools: [expandTool],
|
|
42
|
+
toolIndex: [],
|
|
43
|
+
skillIndex: []
|
|
44
|
+
};
|
|
45
|
+
if (state.mode === "indexed") return {
|
|
46
|
+
serverCard,
|
|
47
|
+
visibleTools: [expandTool],
|
|
48
|
+
toolIndex: graph.tools.map((tool) => createToolIndexEntry(graph.server.id, graph.pinnedToolNames, graph.toolCards, tool)),
|
|
49
|
+
skillIndex: graph.skillIndex
|
|
50
|
+
};
|
|
51
|
+
const activeToolNames = new Set(state.activeTools);
|
|
52
|
+
const visibleToolNames = new Set([
|
|
53
|
+
...graph.pinnedToolNames,
|
|
54
|
+
...graph.warmToolNames,
|
|
55
|
+
...activeToolNames
|
|
56
|
+
]);
|
|
57
|
+
for (const toolName of graph.alwaysIndexToolNames) visibleToolNames.delete(toolName);
|
|
58
|
+
return {
|
|
59
|
+
serverCard,
|
|
60
|
+
visibleTools: [...graph.tools.filter((tool) => visibleToolNames.has(tool.name)), expandTool],
|
|
61
|
+
toolIndex: graph.tools.filter((tool) => !visibleToolNames.has(tool.name)).map((tool) => createToolIndexEntry(graph.server.id, graph.pinnedToolNames, graph.toolCards, tool)),
|
|
62
|
+
skillIndex: graph.skillIndex
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function createExpandToolDeclaration() {
|
|
66
|
+
return {
|
|
67
|
+
name: "mcp_plus.expand",
|
|
68
|
+
description: "Ask MCP+ to activate folded MCP tools or skill guidance for a server.",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
server: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Optional MCP server id to expand."
|
|
75
|
+
},
|
|
76
|
+
request: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Natural-language capability request to match against the MCP+ index."
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
required: ["request"],
|
|
82
|
+
additionalProperties: false
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function lowerExposurePlanToMcpSurface(plan) {
|
|
87
|
+
return {
|
|
88
|
+
tools: plan.visibleTools,
|
|
89
|
+
sidecar: {
|
|
90
|
+
serverCard: plan.serverCard,
|
|
91
|
+
toolIndex: plan.toolIndex,
|
|
92
|
+
skillIndex: plan.skillIndex
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function estimateExposurePlanImpact(graph, plan) {
|
|
97
|
+
const fullSchemaCharacters = JSON.stringify(graph.tools).length;
|
|
98
|
+
const visibleSchemaCharacters = JSON.stringify(plan.visibleTools).length;
|
|
99
|
+
const stableIndexCharacters = JSON.stringify(plan.toolIndex).length;
|
|
100
|
+
const foldedContextCharacters = visibleSchemaCharacters + stableIndexCharacters;
|
|
101
|
+
return {
|
|
102
|
+
nativeToolCount: graph.tools.length,
|
|
103
|
+
visibleToolCount: plan.visibleTools.length,
|
|
104
|
+
indexedToolCount: plan.toolIndex.length,
|
|
105
|
+
fullSchemaCharacters,
|
|
106
|
+
visibleSchemaCharacters,
|
|
107
|
+
foldedContextCharacters,
|
|
108
|
+
schemaCharacterSavings: fullSchemaCharacters - foldedContextCharacters,
|
|
109
|
+
indexedActivationTurns: plan.toolIndex.length > 0 ? 2 : 1,
|
|
110
|
+
stableIndexCharacters
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
var ExposurePlanner = class {
|
|
114
|
+
constructor(graph) {
|
|
115
|
+
this.graph = graph;
|
|
116
|
+
}
|
|
117
|
+
plan(state) {
|
|
118
|
+
return planExposure(this.graph, state);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var McpPlusWrapperRuntime = class {
|
|
122
|
+
#state;
|
|
123
|
+
constructor(graph, initialState) {
|
|
124
|
+
this.graph = graph;
|
|
125
|
+
this.#state = {
|
|
126
|
+
serverId: graph.server.id,
|
|
127
|
+
mode: initialState?.mode ?? "expanded",
|
|
128
|
+
activeTools: initialState?.activeTools ?? []
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
getSurface() {
|
|
132
|
+
return lowerExposurePlanToMcpSurface(planExposure(this.graph, this.#state));
|
|
133
|
+
}
|
|
134
|
+
expand(request) {
|
|
135
|
+
if (request.server !== void 0 && request.server !== this.graph.server.id) return {
|
|
136
|
+
serverId: this.graph.server.id,
|
|
137
|
+
activatedTools: [],
|
|
138
|
+
mode: this.#state.mode
|
|
139
|
+
};
|
|
140
|
+
const thawableTools = this.#matchTools(request).filter((toolName) => !this.graph.alwaysIndexToolNames.has(toolName));
|
|
141
|
+
const activatedTools = thawableTools.filter((toolName) => !this.graph.pinnedToolNames.has(toolName));
|
|
142
|
+
if (thawableTools.length === 0 && request.server === void 0) return {
|
|
143
|
+
serverId: this.graph.server.id,
|
|
144
|
+
activatedTools,
|
|
145
|
+
mode: this.#state.mode
|
|
146
|
+
};
|
|
147
|
+
this.#state = {
|
|
148
|
+
serverId: this.graph.server.id,
|
|
149
|
+
mode: "expanded",
|
|
150
|
+
activeTools: mergeToolNames(this.#state.activeTools, activatedTools)
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
serverId: this.graph.server.id,
|
|
154
|
+
activatedTools,
|
|
155
|
+
mode: this.#state.mode
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
#matchTools(request) {
|
|
159
|
+
if (request.server !== void 0 && request.server !== this.graph.server.id) return [];
|
|
160
|
+
const normalizedRequest = normalizeSearchText(request.request);
|
|
161
|
+
return this.graph.tools.filter((tool) => {
|
|
162
|
+
const card = this.graph.toolCards[tool.name];
|
|
163
|
+
return hasSearchOverlap(normalizedRequest, normalizeSearchText(`${tool.name} ${tool.description} ${card?.title ?? ""} ${card?.summary ?? ""} ${(card?.keywords ?? []).join(" ")}`));
|
|
164
|
+
}).map((tool) => tool.name);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
function createServerCard(graph, mode) {
|
|
168
|
+
return {
|
|
169
|
+
id: graph.server.id,
|
|
170
|
+
title: graph.server.title ?? graph.server.id,
|
|
171
|
+
summary: graph.server.summary,
|
|
172
|
+
mode
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function createToolIndexEntry(serverId, pinnedToolNames, toolCards, tool) {
|
|
176
|
+
const card = toolCards[tool.name];
|
|
177
|
+
return {
|
|
178
|
+
id: tool.name,
|
|
179
|
+
title: card?.title ?? tool.name,
|
|
180
|
+
summary: card?.summary ?? tool.description,
|
|
181
|
+
activation: {
|
|
182
|
+
serverId,
|
|
183
|
+
toolName: tool.name
|
|
184
|
+
},
|
|
185
|
+
pinned: pinnedToolNames.has(tool.name)
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function compareByName(left, right) {
|
|
189
|
+
return left.name < right.name ? -1 : left.name > right.name ? 1 : 0;
|
|
190
|
+
}
|
|
191
|
+
function mergeToolNames(current, next) {
|
|
192
|
+
return [...new Set([...current ?? [], ...next])].toSorted();
|
|
193
|
+
}
|
|
194
|
+
function normalizeSearchText(value) {
|
|
195
|
+
return value.toLowerCase().replaceAll(/[^\p{L}\p{N}.]+/gu, " ");
|
|
196
|
+
}
|
|
197
|
+
function hasSearchOverlap(request, haystack) {
|
|
198
|
+
const requestTerms = request.split(" ").filter((term) => isMeaningfulSearchTerm(term));
|
|
199
|
+
const haystackTerms = haystack.split(" ").filter((term) => isMeaningfulSearchTerm(term));
|
|
200
|
+
return requestTerms.some((requestTerm) => haystackTerms.some((haystackTerm) => requestTerm.includes(haystackTerm) || haystackTerm.includes(requestTerm)));
|
|
201
|
+
}
|
|
202
|
+
function isMeaningfulSearchTerm(term) {
|
|
203
|
+
if (term === "") return false;
|
|
204
|
+
return [...term].some((character) => (character.codePointAt(0) ?? 0) > 127) || term.length >= 3;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
//#endregion
|
|
208
|
+
export { ExposurePlanner, McpPlusWrapperRuntime, compileMcpPlusManifest, createExpandToolDeclaration, defineMcpPlusManifest, estimateExposurePlanImpact, lowerExposurePlanToMcpSurface, planExposure };
|
|
209
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["graph: ExposureGraph","#state","#matchTools"],"sources":["../src/index.ts"],"sourcesContent":["export type JsonSchema = {\n type?: string;\n properties?: Record<string, JsonSchema>;\n required?: string[];\n additionalProperties?: boolean;\n description?: string;\n enum?: string[];\n items?: JsonSchema;\n [key: string]: unknown;\n};\n\nexport type NativeToolDeclaration = {\n name: string;\n description: string;\n inputSchema: JsonSchema;\n};\n\nexport type McpPlusServerManifest = {\n id: string;\n title?: string;\n summary: string;\n};\n\nexport type McpPlusExposurePolicy = {\n pinnedTools?: string[];\n warmTools?: string[];\n indexedTools?: string[];\n alwaysIndexTools?: string[];\n toolCards?: Record<string, ToolCardPolicy>;\n freezeAfterUnusedTurns?: number;\n warmAfterConsecutiveCalls?: number;\n demoteAfterUnusedTurns?: number;\n};\n\nexport type ToolCardPolicy = {\n title?: string;\n summary?: string;\n keywords?: string[];\n};\n\nexport type McpPlusSkillChapter = {\n id: string;\n title: string;\n summary: string;\n};\n\nexport type McpPlusSkillPolicy = {\n storage?: string;\n chapters?: McpPlusSkillChapter[];\n};\n\nexport type McpPlusManifest = {\n server: McpPlusServerManifest;\n exposure?: McpPlusExposurePolicy;\n skills?: McpPlusSkillPolicy;\n};\n\nexport function defineMcpPlusManifest<const TManifest extends McpPlusManifest>(manifest: TManifest): TManifest {\n return manifest;\n}\n\nexport type CapabilityActivation = {\n serverId: string;\n toolName: string;\n};\n\nexport type ToolIndexEntry = {\n id: string;\n title: string;\n summary: string;\n activation: CapabilityActivation;\n pinned: boolean;\n};\n\nexport type SkillIndexEntry = {\n id: string;\n title: string;\n summary: string;\n serverId: string;\n whenToUse?: string;\n why?: string;\n pitfallsPreview?: string[];\n};\n\nexport type ServerCard = {\n id: string;\n title: string;\n summary: string;\n mode: ExposureMode;\n};\n\nexport type ExposureMode = 'expanded' | 'indexed' | 'frozen';\n\nexport type ExposureGraph = {\n server: McpPlusServerManifest;\n tools: NativeToolDeclaration[];\n pinnedToolNames: Set<string>;\n warmToolNames: Set<string>;\n indexedToolNames: Set<string>;\n alwaysIndexToolNames: Set<string>;\n toolCards: Record<string, ToolCardPolicy>;\n skillIndex: SkillIndexEntry[];\n policy: Required<Pick<McpPlusExposurePolicy, 'freezeAfterUnusedTurns' | 'warmAfterConsecutiveCalls' | 'demoteAfterUnusedTurns'>>;\n};\n\nexport type ExposureState = {\n serverId: string;\n mode: ExposureMode;\n activeTools?: string[];\n};\n\nexport type ExposurePlan = {\n serverCard: ServerCard;\n visibleTools: NativeToolDeclaration[];\n toolIndex: ToolIndexEntry[];\n skillIndex: SkillIndexEntry[];\n};\n\nexport type McpPlusSidecar = {\n serverCard: ServerCard;\n toolIndex: ToolIndexEntry[];\n skillIndex: SkillIndexEntry[];\n};\n\nexport type McpCompatibleSurface = {\n tools: NativeToolDeclaration[];\n sidecar: McpPlusSidecar;\n};\n\nexport type ExposureImpactEstimate = {\n nativeToolCount: number;\n visibleToolCount: number;\n indexedToolCount: number;\n fullSchemaCharacters: number;\n visibleSchemaCharacters: number;\n foldedContextCharacters: number;\n schemaCharacterSavings: number;\n indexedActivationTurns: number;\n stableIndexCharacters: number;\n};\n\nexport type ExpandRequest = {\n server?: string;\n request: string;\n};\n\nexport type ExpandResult = {\n serverId: string;\n activatedTools: string[];\n mode: ExposureMode;\n};\n\nconst DEFAULT_FREEZE_AFTER_UNUSED_TURNS = 5;\nconst DEFAULT_WARM_AFTER_CONSECUTIVE_CALLS = 2;\nconst DEFAULT_DEMOTE_AFTER_UNUSED_TURNS = 2;\n\nexport function compileMcpPlusManifest(manifest: McpPlusManifest, nativeTools: NativeToolDeclaration[]): ExposureGraph {\n const pinnedToolNames = new Set(manifest.exposure?.pinnedTools);\n const warmToolNames = new Set(manifest.exposure?.warmTools);\n const alwaysIndexToolNames = new Set(manifest.exposure?.alwaysIndexTools);\n const indexedToolNames = new Set([...(manifest.exposure?.indexedTools ?? []), ...alwaysIndexToolNames]);\n\n for (const tool of nativeTools) {\n if (!pinnedToolNames.has(tool.name) && !warmToolNames.has(tool.name)) {\n indexedToolNames.add(tool.name);\n }\n }\n\n return {\n server: manifest.server,\n tools: nativeTools.toSorted(compareByName),\n pinnedToolNames,\n warmToolNames,\n indexedToolNames,\n alwaysIndexToolNames,\n toolCards: manifest.exposure?.toolCards ?? {},\n skillIndex: (manifest.skills?.chapters ?? []).map(chapter => ({\n id: chapter.id,\n title: chapter.title,\n summary: chapter.summary,\n serverId: manifest.server.id\n })),\n policy: {\n freezeAfterUnusedTurns: manifest.exposure?.freezeAfterUnusedTurns ?? DEFAULT_FREEZE_AFTER_UNUSED_TURNS,\n warmAfterConsecutiveCalls: manifest.exposure?.warmAfterConsecutiveCalls ?? DEFAULT_WARM_AFTER_CONSECUTIVE_CALLS,\n demoteAfterUnusedTurns: manifest.exposure?.demoteAfterUnusedTurns ?? DEFAULT_DEMOTE_AFTER_UNUSED_TURNS\n }\n };\n}\n\nexport function planExposure(graph: ExposureGraph, state: ExposureState): ExposurePlan {\n if (state.serverId !== graph.server.id) {\n throw new Error(`Exposure state server ${state.serverId} does not match graph server ${graph.server.id}`);\n }\n\n const serverCard = createServerCard(graph, state.mode);\n const expandTool = createExpandToolDeclaration();\n\n if (state.mode === 'frozen') {\n return {\n serverCard,\n visibleTools: [expandTool],\n toolIndex: [],\n skillIndex: []\n };\n }\n\n if (state.mode === 'indexed') {\n return {\n serverCard,\n visibleTools: [expandTool],\n toolIndex: graph.tools.map(tool => createToolIndexEntry(graph.server.id, graph.pinnedToolNames, graph.toolCards, tool)),\n skillIndex: graph.skillIndex\n };\n }\n\n const activeToolNames = new Set(state.activeTools);\n const visibleToolNames = new Set<string>([...graph.pinnedToolNames, ...graph.warmToolNames, ...activeToolNames]);\n for (const toolName of graph.alwaysIndexToolNames) {\n visibleToolNames.delete(toolName);\n }\n const visibleNativeTools = graph.tools.filter(tool => visibleToolNames.has(tool.name));\n const visibleTools = [...visibleNativeTools, expandTool];\n const toolIndex = graph.tools\n .filter(tool => !visibleToolNames.has(tool.name))\n .map(tool => createToolIndexEntry(graph.server.id, graph.pinnedToolNames, graph.toolCards, tool));\n\n return {\n serverCard,\n visibleTools,\n toolIndex,\n skillIndex: graph.skillIndex\n };\n}\n\nexport function createExpandToolDeclaration(): NativeToolDeclaration {\n return {\n name: 'mcp_plus.expand',\n description: 'Ask MCP+ to activate folded MCP tools or skill guidance for a server.',\n inputSchema: {\n type: 'object',\n properties: {\n server: {\n type: 'string',\n description: 'Optional MCP server id to expand.'\n },\n request: {\n type: 'string',\n description: 'Natural-language capability request to match against the MCP+ index.'\n }\n },\n required: ['request'],\n additionalProperties: false\n }\n };\n}\n\nexport function lowerExposurePlanToMcpSurface(plan: ExposurePlan): McpCompatibleSurface {\n return {\n tools: plan.visibleTools,\n sidecar: {\n serverCard: plan.serverCard,\n toolIndex: plan.toolIndex,\n skillIndex: plan.skillIndex\n }\n };\n}\n\nexport function estimateExposurePlanImpact(graph: ExposureGraph, plan: ExposurePlan): ExposureImpactEstimate {\n const fullSchemaCharacters = JSON.stringify(graph.tools).length;\n const visibleSchemaCharacters = JSON.stringify(plan.visibleTools).length;\n const stableIndexCharacters = JSON.stringify(plan.toolIndex).length;\n const foldedContextCharacters = visibleSchemaCharacters + stableIndexCharacters;\n\n return {\n nativeToolCount: graph.tools.length,\n visibleToolCount: plan.visibleTools.length,\n indexedToolCount: plan.toolIndex.length,\n fullSchemaCharacters,\n visibleSchemaCharacters,\n foldedContextCharacters,\n schemaCharacterSavings: fullSchemaCharacters - foldedContextCharacters,\n indexedActivationTurns: plan.toolIndex.length > 0 ? 2 : 1,\n stableIndexCharacters\n };\n}\n\nexport class ExposurePlanner {\n public constructor(private readonly graph: ExposureGraph) {}\n\n public plan(state: ExposureState): ExposurePlan {\n return planExposure(this.graph, state);\n }\n}\n\nexport class McpPlusWrapperRuntime {\n #state: ExposureState;\n\n public constructor(\n private readonly graph: ExposureGraph,\n initialState?: Partial<ExposureState>\n ) {\n this.#state = {\n serverId: graph.server.id,\n mode: initialState?.mode ?? 'expanded',\n activeTools: initialState?.activeTools ?? []\n };\n }\n\n public getSurface(): McpCompatibleSurface {\n return lowerExposurePlanToMcpSurface(planExposure(this.graph, this.#state));\n }\n\n public expand(request: ExpandRequest): ExpandResult {\n if (request.server !== undefined && request.server !== this.graph.server.id) {\n return {\n serverId: this.graph.server.id,\n activatedTools: [],\n mode: this.#state.mode\n };\n }\n\n const matchedTools = this.#matchTools(request);\n const thawableTools = matchedTools.filter(toolName => !this.graph.alwaysIndexToolNames.has(toolName));\n const activatedTools = thawableTools.filter(toolName => !this.graph.pinnedToolNames.has(toolName));\n if (thawableTools.length === 0 && request.server === undefined) {\n return {\n serverId: this.graph.server.id,\n activatedTools,\n mode: this.#state.mode\n };\n }\n\n this.#state = {\n serverId: this.graph.server.id,\n mode: 'expanded',\n activeTools: mergeToolNames(this.#state.activeTools, activatedTools)\n };\n\n return {\n serverId: this.graph.server.id,\n activatedTools,\n mode: this.#state.mode\n };\n }\n\n #matchTools(request: ExpandRequest): string[] {\n if (request.server !== undefined && request.server !== this.graph.server.id) {\n return [];\n }\n\n const normalizedRequest = normalizeSearchText(request.request);\n const matches = this.graph.tools\n .filter(tool => {\n const card = this.graph.toolCards[tool.name];\n const haystack = normalizeSearchText(\n `${tool.name} ${tool.description} ${card?.title ?? ''} ${card?.summary ?? ''} ${(card?.keywords ?? []).join(' ')}`\n );\n return hasSearchOverlap(normalizedRequest, haystack);\n })\n .map(tool => tool.name);\n\n return matches;\n }\n}\n\nfunction createServerCard(graph: ExposureGraph, mode: ExposureMode): ServerCard {\n return {\n id: graph.server.id,\n title: graph.server.title ?? graph.server.id,\n summary: graph.server.summary,\n mode\n };\n}\n\nfunction createToolIndexEntry(\n serverId: string,\n pinnedToolNames: ReadonlySet<string>,\n toolCards: Readonly<Record<string, ToolCardPolicy>>,\n tool: NativeToolDeclaration\n): ToolIndexEntry {\n const card = toolCards[tool.name];\n\n return {\n id: tool.name,\n title: card?.title ?? tool.name,\n summary: card?.summary ?? tool.description,\n activation: {\n serverId,\n toolName: tool.name\n },\n pinned: pinnedToolNames.has(tool.name)\n };\n}\n\nfunction compareByName(left: NativeToolDeclaration, right: NativeToolDeclaration): number {\n return left.name < right.name ? -1 : left.name > right.name ? 1 : 0;\n}\n\nfunction mergeToolNames(current: readonly string[] | undefined, next: readonly string[]): string[] {\n return [...new Set([...(current ?? []), ...next])].toSorted();\n}\n\nfunction normalizeSearchText(value: string): string {\n return value.toLowerCase().replaceAll(/[^\\p{L}\\p{N}.]+/gu, ' ');\n}\n\nfunction hasSearchOverlap(request: string, haystack: string): boolean {\n const requestTerms = request.split(' ').filter(term => isMeaningfulSearchTerm(term));\n const haystackTerms = haystack.split(' ').filter(term => isMeaningfulSearchTerm(term));\n\n return requestTerms.some(requestTerm =>\n haystackTerms.some(haystackTerm => requestTerm.includes(haystackTerm) || haystackTerm.includes(requestTerm))\n );\n}\n\nfunction isMeaningfulSearchTerm(term: string): boolean {\n if (term === '') {\n return false;\n }\n\n return [...term].some(character => (character.codePointAt(0) ?? 0) > 0x7f) || term.length >= 3;\n}\n"],"mappings":";AAyDA,SAAgB,sBAA+D,UAAgC;AAC3G,QAAO;;AA8FX,MAAM,oCAAoC;AAC1C,MAAM,uCAAuC;AAC7C,MAAM,oCAAoC;AAE1C,SAAgB,uBAAuB,UAA2B,aAAqD;CACnH,MAAM,kBAAkB,IAAI,IAAI,SAAS,UAAU,YAAY;CAC/D,MAAM,gBAAgB,IAAI,IAAI,SAAS,UAAU,UAAU;CAC3D,MAAM,uBAAuB,IAAI,IAAI,SAAS,UAAU,iBAAiB;CACzE,MAAM,mBAAmB,IAAI,IAAI,CAAC,GAAI,SAAS,UAAU,gBAAgB,EAAE,EAAG,GAAG,qBAAqB,CAAC;AAEvG,MAAK,MAAM,QAAQ,YACf,KAAI,CAAC,gBAAgB,IAAI,KAAK,KAAK,IAAI,CAAC,cAAc,IAAI,KAAK,KAAK,CAChE,kBAAiB,IAAI,KAAK,KAAK;AAIvC,QAAO;EACH,QAAQ,SAAS;EACjB,OAAO,YAAY,SAAS,cAAc;EAC1C;EACA;EACA;EACA;EACA,WAAW,SAAS,UAAU,aAAa,EAAE;EAC7C,aAAa,SAAS,QAAQ,YAAY,EAAE,EAAE,KAAI,aAAY;GAC1D,IAAI,QAAQ;GACZ,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,UAAU,SAAS,OAAO;GAC7B,EAAE;EACH,QAAQ;GACJ,wBAAwB,SAAS,UAAU,0BAA0B;GACrE,2BAA2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U,KAAK;GAClB;EACD,QAAQ,gBAAgB,IAAI,KAAK,KAAK;EACzC;;AAGL,SAAS,cAAc,MAA6B,OAAsC;AACtF,QAAO,KAAK,OAAO,MAAM,OAAO,KAAK,KAAK,OAAO,MAAM,OAAO,IAAI;;AAGtE,SAAS,eAAe,SAAwC,MAAmC;AAC/F,QAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,WAAW,EAAE,EAAG,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU;;AAGjE,SAAS,oBAAoB,OAAuB;AAChD,QAAO,MAAM,aAAa,CAAC,WAAW,qBAAqB,IAAI;;AAGnE,SAAS,iBAAiB,SAAiB,UAA2B;CAClE,MAAM,eAAe,QAAQ,MAAM,IAAI,CAAC,QAAO,SAAQ,uBAAuB,KAAK,CAAC;CACpF,MAAM,gBAAgB,SAAS,MAAM,IAAI,CAAC,QAAO,SAAQ,uBAAuB,KAAK,CAAC;AAEtF,QAAO,aAAa,MAAK,gBACrB,cAAc,MAAK,iBAAgB,YAAY,SAAS,aAAa,IAAI,aAAa,SAAS,YAAY,CAAC,CAC/G;;AAGL,SAAS,uBAAuB,MAAuB;AACnD,KAAI,SAAS,GACT,QAAO;AAGX,QAAO,CAAC,GAAG,KAAK,CAAC,MAAK,eAAc,UAAU,YAAY,EAAE,IAAI,KAAK,IAAK,IAAI,KAAK,UAAU"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@praxis-ai/mcp-plus",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP+ wrapper-mode exposure and authoring layer for Model Context Protocol servers",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/Praxis-Agent-Architecture/MCP-Plus#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/Praxis-Agent-Architecture/MCP-Plus/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/Praxis-Agent-Architecture/MCP-Plus.git",
|
|
13
|
+
"directory": "packages/mcp-plus"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"mcp-plus",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"tool-exposure",
|
|
25
|
+
"agent-tools",
|
|
26
|
+
"praxis"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.mts",
|
|
34
|
+
"import": "./dist/index.mjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"typecheck": "tsgo -p tsconfig.json --noEmit",
|
|
43
|
+
"build": "tsdown",
|
|
44
|
+
"prepack": "pnpm run build",
|
|
45
|
+
"lint": "eslint src/ test/ && prettier --ignore-path ../../.prettierignore --check .",
|
|
46
|
+
"lint:fix": "eslint src/ test/ --fix && prettier --ignore-path ../../.prettierignore --write .",
|
|
47
|
+
"check": "pnpm run typecheck && pnpm run lint",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:watch": "vitest"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@eslint/js": "catalog:devTools",
|
|
53
|
+
"@modelcontextprotocol/eslint-config": "workspace:^",
|
|
54
|
+
"@modelcontextprotocol/tsconfig": "workspace:^",
|
|
55
|
+
"@modelcontextprotocol/vitest-config": "workspace:^",
|
|
56
|
+
"@typescript/native-preview": "catalog:devTools",
|
|
57
|
+
"eslint": "catalog:devTools",
|
|
58
|
+
"eslint-config-prettier": "catalog:devTools",
|
|
59
|
+
"eslint-plugin-n": "catalog:devTools",
|
|
60
|
+
"prettier": "catalog:devTools",
|
|
61
|
+
"tsdown": "catalog:devTools",
|
|
62
|
+
"tsx": "catalog:devTools",
|
|
63
|
+
"typescript": "catalog:devTools",
|
|
64
|
+
"typescript-eslint": "catalog:devTools",
|
|
65
|
+
"vitest": "catalog:devTools"
|
|
66
|
+
}
|
|
67
|
+
}
|