@deplens/mcp 0.1.1 → 0.1.3
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 +93 -0
- package/package.json +3 -3
- package/src/core/inspect.mjs +1041 -0
- package/src/core/parse-dts.mjs +416 -0
- package/src/server.mjs +23 -1
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @deplens/mcp
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server for DepLens.
|
|
4
|
+
|
|
5
|
+
## Run
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @deplens/mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
If your MCP host requires a command + args, use one of:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{ "command": "npx", "args": ["--yes", "@deplens/mcp"] }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "command": "npm", "args": ["exec", "--", "@deplens/mcp"] }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If `npx`/`npm exec` is unreliable, install once and call the binary:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i -g @deplens/mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{ "command": "deplens-mcp" }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or point directly to the local bin if installed in a project:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "command": "node", "args": ["./node_modules/@deplens/mcp/bin/deplens-mcp.js"] }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Avoid: `npm @deplens/mcp` (npm will treat it as an unknown command).
|
|
38
|
+
|
|
39
|
+
This starts an MCP server over stdio.
|
|
40
|
+
|
|
41
|
+
## Tool
|
|
42
|
+
|
|
43
|
+
`deplens.inspect`
|
|
44
|
+
|
|
45
|
+
### Input schema (high level)
|
|
46
|
+
|
|
47
|
+
- `target` (string, required): package name or import path (e.g. `react`, `next/server`)
|
|
48
|
+
- `subpath` (string, optional): appended to `target` (e.g. `server` for `next/server`)
|
|
49
|
+
- `filter` (string)
|
|
50
|
+
- `kind` (string[])
|
|
51
|
+
- `showTypes` (boolean)
|
|
52
|
+
- `depth` (number 0–5)
|
|
53
|
+
- `resolveFrom` (string)
|
|
54
|
+
- `rootDir` (string): working directory for inspection
|
|
55
|
+
- `jsdoc` (off|compact|full)
|
|
56
|
+
- `jsdocOutput` (off|section|inline|only)
|
|
57
|
+
- `jsdocQuery` (object):
|
|
58
|
+
- `symbols` (string|string[])
|
|
59
|
+
- `sections` (summary|params|returns|tags)[]
|
|
60
|
+
- `tags.include` / `tags.exclude` (string[])
|
|
61
|
+
- `mode` (compact|full)
|
|
62
|
+
- `maxLen` (number)
|
|
63
|
+
- `truncate` (none|sentence|word)
|
|
64
|
+
|
|
65
|
+
### Example call
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"target": "ai",
|
|
70
|
+
"showTypes": true,
|
|
71
|
+
"filter": "generate",
|
|
72
|
+
"resolveFrom": ".",
|
|
73
|
+
"jsdocOutput": "section",
|
|
74
|
+
"jsdocQuery": {
|
|
75
|
+
"symbols": "generateText",
|
|
76
|
+
"sections": ["summary", "params", "returns"],
|
|
77
|
+
"tags": { "include": ["param", "returns"] },
|
|
78
|
+
"mode": "compact"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Environment
|
|
84
|
+
|
|
85
|
+
- `DEPLENS_ROOT`: default `rootDir` if not provided.
|
|
86
|
+
|
|
87
|
+
## Requirements
|
|
88
|
+
|
|
89
|
+
- Node.js >= 18
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deplens/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/server.mjs",
|
|
6
6
|
"bin": {
|
|
7
|
-
"deplens-mcp": "
|
|
7
|
+
"deplens-mcp": "bin/deplens-mcp.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"src",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@deplens/core": "0.1.
|
|
20
|
+
"@deplens/core": "0.1.2",
|
|
21
21
|
"@modelcontextprotocol/sdk": "^1.25.1"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|