@deplens/mcp 0.1.4 → 0.1.6
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/package.json +2 -2
- package/src/server.mjs +53 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deplens/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/server.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@deplens/core": "0.1.
|
|
20
|
+
"@deplens/core": "0.1.5",
|
|
21
21
|
"@modelcontextprotocol/sdk": "^1.25.1"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/server.mjs
CHANGED
|
@@ -21,64 +21,68 @@ async function loadCore() {
|
|
|
21
21
|
return corePromise;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
description: "
|
|
28
|
-
|
|
24
|
+
const inspectToolSchema = {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
target: { type: "string", description: "Package name or import path (e.g. react, next/server)" },
|
|
28
|
+
subpath: { type: "string", description: "Optional subpath (e.g. server for next/server)" },
|
|
29
|
+
filter: { type: "string", description: "Substring filter for exports" },
|
|
30
|
+
kind: {
|
|
31
|
+
type: "array",
|
|
32
|
+
items: { type: "string", enum: ["function", "class", "object", "constant", "interface", "type"] },
|
|
33
|
+
description: "Filter by export kind",
|
|
34
|
+
},
|
|
35
|
+
showTypes: { type: "boolean", description: "Show type signatures from .d.ts" },
|
|
36
|
+
depth: { type: "number", description: "Depth for object inspection (0-5)" },
|
|
37
|
+
resolveFrom: { type: "string", description: "Base directory for module resolution" },
|
|
38
|
+
rootDir: { type: "string", description: "Working directory for the inspection (default: cwd)" },
|
|
39
|
+
jsdoc: { type: "string", enum: ["off", "compact", "full"], description: "JSDoc mode" },
|
|
40
|
+
jsdocOutput: {
|
|
41
|
+
type: "string",
|
|
42
|
+
enum: ["off", "section", "inline", "only"],
|
|
43
|
+
description: "Where to print JSDoc",
|
|
44
|
+
},
|
|
45
|
+
jsdocQuery: {
|
|
29
46
|
type: "object",
|
|
30
47
|
properties: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
filter: { type: "string", description: "Substring filter for exports" },
|
|
34
|
-
kind: {
|
|
35
|
-
type: "array",
|
|
36
|
-
items: { type: "string", enum: ["function", "class", "object", "constant", "interface", "type"] },
|
|
37
|
-
description: "Filter by export kind",
|
|
48
|
+
symbols: {
|
|
49
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
38
50
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
rootDir: { type: "string", description: "Working directory for the inspection (default: cwd)" },
|
|
43
|
-
jsdoc: { type: "string", enum: ["off", "compact", "full"], description: "JSDoc mode" },
|
|
44
|
-
jsdocOutput: {
|
|
45
|
-
type: "string",
|
|
46
|
-
enum: ["off", "section", "inline", "only"],
|
|
47
|
-
description: "Where to print JSDoc",
|
|
51
|
+
sections: {
|
|
52
|
+
type: "array",
|
|
53
|
+
items: { type: "string", enum: ["summary", "params", "returns", "tags"] },
|
|
48
54
|
},
|
|
49
|
-
|
|
55
|
+
tags: {
|
|
50
56
|
type: "object",
|
|
51
57
|
properties: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
type: "array",
|
|
60
|
-
items: { type: "string", enum: ["summary", "params", "returns", "tags"] }
|
|
61
|
-
},
|
|
62
|
-
tags: {
|
|
63
|
-
type: "object",
|
|
64
|
-
properties: {
|
|
65
|
-
include: { type: "array", items: { type: "string" } },
|
|
66
|
-
exclude: { type: "array", items: { type: "string" } }
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
mode: { type: "string", enum: ["compact", "full"] },
|
|
70
|
-
maxLen: { type: "number" },
|
|
71
|
-
truncate: { type: "string", enum: ["none", "sentence", "word"] }
|
|
72
|
-
}
|
|
73
|
-
}
|
|
58
|
+
include: { type: "array", items: { type: "string" } },
|
|
59
|
+
exclude: { type: "array", items: { type: "string" } },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
mode: { type: "string", enum: ["compact", "full"] },
|
|
63
|
+
maxLen: { type: "number" },
|
|
64
|
+
truncate: { type: "string", enum: ["none", "sentence", "word"] },
|
|
74
65
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
required: ["target"],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const tools = [
|
|
72
|
+
{
|
|
73
|
+
name: "deplens.inspect",
|
|
74
|
+
description: "Inspect exports and types for an installed npm package.",
|
|
75
|
+
inputSchema: inspectToolSchema,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "deplens_inspect",
|
|
79
|
+
description: "Inspect exports and types for an installed npm package.",
|
|
80
|
+
inputSchema: inspectToolSchema,
|
|
81
|
+
},
|
|
78
82
|
];
|
|
79
83
|
|
|
80
84
|
const server = new Server(
|
|
81
|
-
{ name: "deplens", version: "0.1.
|
|
85
|
+
{ name: "deplens", version: "0.1.6" },
|
|
82
86
|
{ capabilities: { tools: {} } }
|
|
83
87
|
);
|
|
84
88
|
|
|
@@ -89,7 +93,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
89
93
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
90
94
|
const { name, arguments: args } = request.params;
|
|
91
95
|
try {
|
|
92
|
-
if (name !== "deplens.inspect") {
|
|
96
|
+
if (name !== "deplens.inspect" && name !== "deplens_inspect") {
|
|
93
97
|
throw new Error(`Unknown tool: ${name}`);
|
|
94
98
|
}
|
|
95
99
|
|