@visulima/vis-mcp 0.0.1 → 1.0.0-alpha.10
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/CHANGELOG.md +216 -0
- package/LICENSE.md +27 -0
- package/README.md +122 -29
- package/dist/bin.js +3 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +1 -0
- package/dist/packem_shared/execVis-BzS_F-9x.js +4 -0
- package/dist/packem_shared/isValidRunId-BKsKMWQf.js +1 -0
- package/dist/packem_shared/okResponse-DdzqnveW.js +1 -0
- package/dist/packem_shared/registerAllTools-BIzixHAA.js +3 -0
- package/dist/packem_shared/registerCacheHash-CVckSIVO.js +1 -0
- package/dist/packem_shared/registerCacheWhy-CMzL-Pg3.js +1 -0
- package/dist/packem_shared/registerDescribeProject-Dhuzun-I.js +1 -0
- package/dist/packem_shared/registerGetRunLogs-BxkRfYZU.js +1 -0
- package/dist/packem_shared/registerListProjects-C-AZj8RT.js +1 -0
- package/dist/packem_shared/registerListTargets-Cq6bkF7O.js +1 -0
- package/package.json +71 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
## @visulima/vis-mcp [1.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.9...@visulima/vis-mcp@1.0.0-alpha.10) (2026-05-14)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* **vis:** the following security.* keys were renamed:
|
|
6
|
+
- security.minimumReleaseAge -> security.policies.first_seen.minutes
|
|
7
|
+
- security.minimumReleaseAgeExclude -> security.policies.first_seen.exclude
|
|
8
|
+
- security.trustPolicy -> security.policies.publisher_change.mode
|
|
9
|
+
- security.trustPolicyExclude -> security.policies.publisher_change.exclude
|
|
10
|
+
- security.trustPolicyIgnoreAfter -> security.policies.publisher_change.ignoreAfter
|
|
11
|
+
- security.allowBuilds -> security.policies.install_scripts.allow
|
|
12
|
+
- security.strictDepBuilds -> security.policies.install_scripts.strict
|
|
13
|
+
- security.socket.minimumScore -> security.policies.score.minimum
|
|
14
|
+
- security.socket.acceptedRisks -> security.acceptedRisks
|
|
15
|
+
- security.audit.failOn -> security.policies.vulnerability.failOn
|
|
16
|
+
- security.audit.usage -> security.policies.vulnerability.usage
|
|
17
|
+
|
|
18
|
+
AcceptedRisk now carries optional policies[] and expiresAt fields so
|
|
19
|
+
risks can be scoped per-policy and time-boxed. Native PM sync writers
|
|
20
|
+
keep emitting pnpm-native field names since pnpm owns that schema.
|
|
21
|
+
|
|
22
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
23
|
+
|
|
24
|
+
* chore(vis): address coderabbit review feedback
|
|
25
|
+
|
|
26
|
+
- Add JSDoc to exported items across hook builtins, advisories, audit, docker
|
|
27
|
+
- Document OSV `last_affected` inclusive-upper semantics with a focused test
|
|
28
|
+
- Annotate NAPI u64→u32 truncations with JS Number range rationale
|
|
29
|
+
- Switch vis-mcp tool payloads to zod schemas with `.catchall(z.unknown())`
|
|
30
|
+
so unknown CLI fields stay forward-compatible
|
|
31
|
+
- Fence RFC code blocks with explicit languages and tidy hook-command
|
|
32
|
+
formatting (multi-line type, implicit-return arrows)
|
|
33
|
+
|
|
34
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
35
|
+
|
|
36
|
+
* chore(vis): address second-round coderabbit feedback on policies rename
|
|
37
|
+
|
|
38
|
+
- Drift report labels now reference `security.policies.*` paths so the
|
|
39
|
+
hint matches the keys users edit
|
|
40
|
+
- `defineConfig` JSDoc examples use the new `security.policies` shape
|
|
41
|
+
- `mergeSecurityDefaults` deep-merges every defaulted sub-policy
|
|
42
|
+
generically; `mergeVisConfigs` deep-merges `policies` and
|
|
43
|
+
`acceptedRisks` so presets aren't clobbered
|
|
44
|
+
- Config-writer scopes its `allow:` match to follow an
|
|
45
|
+
`install_scripts:` opener
|
|
46
|
+
- JSDoc clarifications for `audit.advisories.source` default,
|
|
47
|
+
`acceptedRisks.expiresAt`/`acceptedScore` ranges, `malware.mode`
|
|
48
|
+
cross-field default, and the current `policies.score.minimum`
|
|
49
|
+
wiring gap
|
|
50
|
+
|
|
51
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
52
|
+
|
|
53
|
+
* chore(vis): finish coderabbit round-2 fixes — camelCase policies + wire score.minimum
|
|
54
|
+
|
|
55
|
+
- Rename `PolicyName` union to camelCase (`firstSeen`, `installScripts`,
|
|
56
|
+
`publisherChange`, `unexpectedDeps`). Updates every consumer in src/,
|
|
57
|
+
test fixtures, schemas, and docs. JSON schema regenerated.
|
|
58
|
+
- Add `types` mapping to the `#native` package.json import so TypeScript
|
|
59
|
+
resolves `index.d.ts` when consumers import the alias.
|
|
60
|
+
- Thread `socketOptions.minimumScore` through `audit`, `doctor`, `check`,
|
|
61
|
+
`update`, `add`, `formatSecurityOverview`, `formatSummary`, and
|
|
62
|
+
`applyFilter`. `buildSocketOptions` now resolves the effective minimum
|
|
63
|
+
once (from `security.policies.score.minimum` or
|
|
64
|
+
`DEFAULT_LOW_SCORE_THRESHOLD`) so every consumer sees the same value
|
|
65
|
+
instead of comparing scores against the hard-coded constant.
|
|
66
|
+
- Update the JSDoc on `policies.score.minimum` to reflect the new wiring.
|
|
67
|
+
|
|
68
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
69
|
+
|
|
70
|
+
* feat(vis): add Socket-style policy engine with 4 offline-clean policies
|
|
71
|
+
|
|
72
|
+
Introduce a unified `evaluatePolicies()` engine under `src/security/policies/`
|
|
73
|
+
with four offline-clean modules: license, install_scripts, vulnerability,
|
|
74
|
+
and unexpected_deps (baseline mode). Each policy emits PolicyDecisions
|
|
75
|
+
(block/warn/info) keyed by package, with per-policy accepted-risk scoping
|
|
76
|
+
and expiresAt support reused from the shared matcher.
|
|
77
|
+
|
|
78
|
+
Wires the engine into `vis audit`: a new `--policies <names>` flag
|
|
79
|
+
(comma-list, `all`, or `none`) narrows evaluation. Block-severity
|
|
80
|
+
decisions feed into `--exit-code` and `--fail-on`. JSON output gains
|
|
81
|
+
`policies[]` + `summary.policyBlocks`. SARIF and HTML formatters render
|
|
82
|
+
policy decisions alongside vulnerabilities; CSAF and CycloneDX-VEX are
|
|
83
|
+
intentionally left untouched (vuln-specific data models).
|
|
84
|
+
|
|
85
|
+
Adds `readNodeModulesManifests()` to walk `node_modules/` (including the
|
|
86
|
+
pnpm `.pnpm/` content-addressed store) and surface license + scripts +
|
|
87
|
+
maintainers metadata for the offline policies.
|
|
88
|
+
|
|
89
|
+
33 new unit + integration tests; full vitest suite (3582/3582) green;
|
|
90
|
+
`tsc --noEmit` clean.
|
|
91
|
+
|
|
92
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
93
|
+
|
|
94
|
+
* fix(vis): close three audit policy gating gaps surfaced by CodeRabbit
|
|
95
|
+
|
|
96
|
+
- applyExitGate's fallthrough call to applyFailOnGate was dropping the
|
|
97
|
+
policyDecisions argument, so `vis audit --format sarif --fail-on high`
|
|
98
|
+
exited 0 when the only signal was a block-severity policy decision.
|
|
99
|
+
Forward the argument.
|
|
100
|
+
- Unknown --policies tokens were silently swallowed when format was
|
|
101
|
+
json/sarif/csaf/cyclonedx-vex, so a typoed CI invocation reduced
|
|
102
|
+
enforcement with no log. Always emit the warning to stderr and
|
|
103
|
+
surface the tokens in JSON output as `warnings[]`.
|
|
104
|
+
- Vulnerability-policy block decisions whose advisory was masked by
|
|
105
|
+
--severity used to exit 1 with no visible reason. Surface those
|
|
106
|
+
decisions in the human-readable "Policy Decisions" section so the
|
|
107
|
+
gate is always traceable.
|
|
108
|
+
|
|
109
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
110
|
+
|
|
111
|
+
* fix(vis): correct npm/yarn min-release-age native config writers
|
|
112
|
+
|
|
113
|
+
npm CLI types `min-release-age` as `Number` in days, not a duration string —
|
|
114
|
+
vis wrote `48h`/`15m`, which npm's parseInt would silently read as 48/15 days.
|
|
115
|
+
Write integer days rounded up so the native gate is never weaker than vis-config.
|
|
116
|
+
|
|
117
|
+
Yarn Berry silently treats day suffixes in `npmMinimalAgeGate` as minutes
|
|
118
|
+
|
|
119
|
+
### Features
|
|
120
|
+
|
|
121
|
+
* **vis:** offline OSV scanner + unified security.policies ([#632](https://github.com/visulima/visulima/issues/632)) ([6461902](https://github.com/visulima/visulima/commit/646190243bf51bb6df172665d70fd501644e7bc3)), closes [#631](https://github.com/visulima/visulima/issues/631) [#631](https://github.com/visulima/visulima/issues/631) [yarnpkg/berry#6991](https://github.com/yarnpkg/berry/issues/6991)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Dependencies
|
|
125
|
+
|
|
126
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.22
|
|
127
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.20
|
|
128
|
+
|
|
129
|
+
## @visulima/vis-mcp [1.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.8...@visulima/vis-mcp@1.0.0-alpha.9) (2026-05-11)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Dependencies
|
|
133
|
+
|
|
134
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.21
|
|
135
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.19
|
|
136
|
+
|
|
137
|
+
## @visulima/vis-mcp [1.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.7...@visulima/vis-mcp@1.0.0-alpha.8) (2026-05-11)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.20
|
|
143
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.18
|
|
144
|
+
|
|
145
|
+
## @visulima/vis-mcp [1.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.6...@visulima/vis-mcp@1.0.0-alpha.7) (2026-05-10)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Dependencies
|
|
149
|
+
|
|
150
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.19
|
|
151
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.17
|
|
152
|
+
|
|
153
|
+
## @visulima/vis-mcp [1.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.5...@visulima/vis-mcp@1.0.0-alpha.6) (2026-05-10)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Dependencies
|
|
157
|
+
|
|
158
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.18
|
|
159
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.16
|
|
160
|
+
|
|
161
|
+
## @visulima/vis-mcp [1.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.4...@visulima/vis-mcp@1.0.0-alpha.5) (2026-05-07)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Dependencies
|
|
165
|
+
|
|
166
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.17
|
|
167
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.15
|
|
168
|
+
|
|
169
|
+
## @visulima/vis-mcp [1.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.3...@visulima/vis-mcp@1.0.0-alpha.4) (2026-05-07)
|
|
170
|
+
|
|
171
|
+
### Miscellaneous Chores
|
|
172
|
+
|
|
173
|
+
* **vis-mcp:** bump eslint-plugin-zod and sort package.json keys ([787abc4](https://github.com/visulima/visulima/commit/787abc46e1b637fdb8968a492cd923537e404fbe))
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### Dependencies
|
|
177
|
+
|
|
178
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.16
|
|
179
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.14
|
|
180
|
+
|
|
181
|
+
## @visulima/vis-mcp [1.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.2...@visulima/vis-mcp@1.0.0-alpha.3) (2026-05-06)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Dependencies
|
|
185
|
+
|
|
186
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.15
|
|
187
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.13
|
|
188
|
+
|
|
189
|
+
## @visulima/vis-mcp [1.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.1...@visulima/vis-mcp@1.0.0-alpha.2) (2026-05-06)
|
|
190
|
+
|
|
191
|
+
### Miscellaneous Chores
|
|
192
|
+
|
|
193
|
+
* **vis-mcp:** housekeeping cleanup ([947eff5](https://github.com/visulima/visulima/commit/947eff503b5e170194f7f8e21bea2ab82b0786bf))
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
### Dependencies
|
|
197
|
+
|
|
198
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.14
|
|
199
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.12
|
|
200
|
+
|
|
201
|
+
## @visulima/vis-mcp 1.0.0-alpha.1 (2026-05-04)
|
|
202
|
+
|
|
203
|
+
### Features
|
|
204
|
+
|
|
205
|
+
* **vis-mcp:** add list_templates and describe_template tools ([549ea7e](https://github.com/visulima/visulima/commit/549ea7edbe88e3dde40e09cf5f5eaea80bb8fd58))
|
|
206
|
+
* **vis-mcp:** add MCP server package for AI-agent integration ([a8d5022](https://github.com/visulima/visulima/commit/a8d5022ba905481985378c0ac01e7f654608ec2b))
|
|
207
|
+
|
|
208
|
+
### Miscellaneous Chores
|
|
209
|
+
|
|
210
|
+
* **vis-mcp:** adopt zod v4 catalog and bump @modelcontextprotocol/sdk ([a84ceb1](https://github.com/visulima/visulima/commit/a84ceb1efcfb368c361eb738006f2e7f113ac4c7))
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Dependencies
|
|
214
|
+
|
|
215
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.13
|
|
216
|
+
* **@visulima/vis:** upgraded to 1.0.0-alpha.11
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 visulima
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
<!-- DEPENDENCIES -->
|
|
24
|
+
<!-- /DEPENDENCIES -->
|
|
25
|
+
|
|
26
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
27
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -1,45 +1,138 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<a href="https://www.anolilab.com/open-source" align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<img src="__assets__/package-og.svg" alt="vis-mcp" />
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
</a>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<h3 align="center">MCP (Model Context Protocol) server for @visulima/vis — exposes vis tooling to AI agents over stdio</h3>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@visulima/vis-mcp`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
11
|
+
<!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
<br />
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
<div align="center">
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
+
[![mit licence][license-badge]][license]
|
|
19
|
+
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
20
|
+
[![Chat][chat-badge]][chat]
|
|
21
|
+
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
</div>
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
<p>
|
|
29
|
+
<sup>
|
|
30
|
+
Daniel Bannert's open source work is supported by the community on <a href="https://github.com/sponsors/prisis">GitHub Sponsors</a>
|
|
31
|
+
</sup>
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
---
|
|
30
36
|
|
|
31
|
-
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
37
|
+
## Install
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
```sh
|
|
40
|
+
npm install @visulima/vis-mcp
|
|
41
|
+
```
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
```sh
|
|
44
|
+
yarn add @visulima/vis-mcp
|
|
45
|
+
```
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
```sh
|
|
48
|
+
pnpm add @visulima/vis-mcp
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
`@visulima/vis-mcp` is an MCP (Model Context Protocol) server that exposes a read-only view of your `@visulima/vis` workspace to an LLM agent over stdio. It assumes `@visulima/vis` is installed in the workspace it operates against.
|
|
54
|
+
|
|
55
|
+
### Run
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npx @visulima/vis-mcp
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The server speaks JSON-RPC on stdout and writes status to stderr. Wire it into any MCP-aware client (Claude Desktop, Cursor, Continue, etc.) by pointing the client at the `vis-mcp` command.
|
|
62
|
+
|
|
63
|
+
### Claude Desktop config
|
|
64
|
+
|
|
65
|
+
Add the server to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"vis": {
|
|
71
|
+
"command": "npx",
|
|
72
|
+
"args": ["-y", "@visulima/vis-mcp"],
|
|
73
|
+
"env": {
|
|
74
|
+
"VIS_MCP_WORKSPACE_ROOT": "/absolute/path/to/your/workspace"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Environment
|
|
82
|
+
|
|
83
|
+
- `VIS_MCP_WORKSPACE_ROOT` — workspace to operate against. Defaults to `process.cwd()`.
|
|
84
|
+
- `VIS_MCP_VIS_BIN` — explicit path to the `vis` CLI. Defaults to resolving `@visulima/vis` from the workspace's `node_modules`.
|
|
85
|
+
|
|
86
|
+
### Tools
|
|
87
|
+
|
|
88
|
+
All eight tools are read-only. The agent prepares commands; a human runs them.
|
|
89
|
+
|
|
90
|
+
| Tool | What it does |
|
|
91
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| `list_projects` | List all workspace projects, optionally filtered by a vis query string. |
|
|
93
|
+
| `describe_project` | Return full metadata for one project (language, layer, stack, targets). |
|
|
94
|
+
| `list_targets` | Flatten projects into per-target rows; optionally narrow to one project. |
|
|
95
|
+
| `list_templates` | List scaffolding templates discovered in the workspace, with source and one-line description. |
|
|
96
|
+
| `describe_template` | Return template metadata: description, default destination, and the variable schema for `vis generate`. |
|
|
97
|
+
| `get_run_logs` | Read a run summary from `.task-runner/`; optionally filter to one task. |
|
|
98
|
+
| `cache_why` | Diff a task's hash inputs against the previous run to explain a rotation. |
|
|
99
|
+
| `cache_hash` | Print the recorded hash and per-input hash details for a task. |
|
|
100
|
+
|
|
101
|
+
## Related
|
|
102
|
+
|
|
103
|
+
## Supported Node.js Versions
|
|
104
|
+
|
|
105
|
+
Libraries in this ecosystem make the best effort to track [Node.js’ release schedule](https://github.com/nodejs/release#release-schedule).
|
|
106
|
+
Here’s [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
|
107
|
+
|
|
108
|
+
## Contributing
|
|
109
|
+
|
|
110
|
+
If you would like to help take a look at the [list of issues](https://github.com/visulima/visulima/issues) and check our [Contributing](.github/CONTRIBUTING.md) guidelines.
|
|
111
|
+
|
|
112
|
+
> **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
|
113
|
+
|
|
114
|
+
## Credits
|
|
115
|
+
|
|
116
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
117
|
+
- [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
|
|
118
|
+
|
|
119
|
+
## Made with ❤️ at Anolilab
|
|
120
|
+
|
|
121
|
+
This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
The visulima vis-mcp is open-sourced software licensed under the [MIT][license]
|
|
126
|
+
|
|
127
|
+
<!-- badges -->
|
|
44
128
|
|
|
45
|
-
|
|
129
|
+
[license-badge]: https://img.shields.io/npm/l/@visulima/vis-mcp?style=for-the-badge
|
|
130
|
+
[license]: https://github.com/visulima/visulima/blob/main/LICENSE
|
|
131
|
+
[npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/vis-mcp?style=for-the-badge
|
|
132
|
+
[npm-downloads]: https://www.npmjs.com/package/@visulima/vis-mcp
|
|
133
|
+
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
134
|
+
[prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
|
|
135
|
+
[chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
|
|
136
|
+
[chat]: https://discord.gg/TtFJY8xkFK
|
|
137
|
+
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
138
|
+
[typescript-url]: https://www.typescriptlang.org/
|
package/dist/bin.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Spawn a `vis` subprocess and capture stdout/stderr without piping to the
|
|
4
|
+
* parent's stdio. The MCP server must keep its own stdout pristine — anything
|
|
5
|
+
* other than JSON-RPC frames corrupts the protocol stream.
|
|
6
|
+
*
|
|
7
|
+
* `visBin` is the resolved path to the user's installed vis CLI; injected so
|
|
8
|
+
* tests can point at a fixture instead of the real CLI.
|
|
9
|
+
*/
|
|
10
|
+
declare const execVis: (visBin: string, args: ReadonlyArray<string>, options?: ExecOptions) => Promise<ExecResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Run `vis` and parse stdout as JSON. Throws when the subprocess fails or
|
|
13
|
+
* stdout isn't valid JSON — callers map this into an `isError: true` MCP
|
|
14
|
+
* response.
|
|
15
|
+
*/
|
|
16
|
+
declare const execVisJson: <T>(visBin: string, args: ReadonlyArray<string>, options?: ExecOptions) => Promise<T>;
|
|
17
|
+
interface ExecResult {
|
|
18
|
+
exitCode: number;
|
|
19
|
+
stderr: string;
|
|
20
|
+
stdout: string;
|
|
21
|
+
timedOut: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface ExecOptions {
|
|
24
|
+
cwd?: string;
|
|
25
|
+
env?: Record<string, string | undefined>;
|
|
26
|
+
/** Hard ceiling. The default 120s suits cache lookups and listings. */
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* MCP tool response shape used across all `vis` tools. Kept in one place so
|
|
31
|
+
* adding a new tool doesn't require re-deriving the type from the SDK.
|
|
32
|
+
*
|
|
33
|
+
* The index signature matches the SDK's `CallToolResult` shape — the SDK
|
|
34
|
+
* extends the JSON-RPC result with an open `_meta` bag and refuses anything
|
|
35
|
+
* stricter at the assignment site.
|
|
36
|
+
*/
|
|
37
|
+
interface McpToolResponse {
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
content: {
|
|
40
|
+
text: string;
|
|
41
|
+
type: "text";
|
|
42
|
+
}[];
|
|
43
|
+
isError?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const okResponse: (payload: unknown) => McpToolResponse;
|
|
46
|
+
declare const errorResponse: (error: unknown) => McpToolResponse;
|
|
47
|
+
interface ToolContext {
|
|
48
|
+
/** Absolute path to the resolved `vis` CLI bundle. */
|
|
49
|
+
visBin: string;
|
|
50
|
+
/** Workspace root the MCP server should operate against. */
|
|
51
|
+
workspaceRoot: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Dependencies a tool needs from the MCP SDK. Threaded through so each tool
|
|
55
|
+
* stays a plain registration function and tests can swap in a fake `server`
|
|
56
|
+
* without touching the real SDK.
|
|
57
|
+
*/
|
|
58
|
+
interface ToolDeps {
|
|
59
|
+
server: McpServer;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Register every tool against an already-built MCP server. Pure wiring — no
|
|
63
|
+
* I/O — so tests can drive it against an `InMemoryTransport` without forking
|
|
64
|
+
* a subprocess.
|
|
65
|
+
*/
|
|
66
|
+
declare const registerAllTools: (deps: ToolDeps, context: ToolContext) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Build a fully-configured MCP server with all vis tools registered. Returns
|
|
69
|
+
* the server and deps so callers can connect any transport. Tests use this
|
|
70
|
+
* with `InMemoryTransport.createLinkedPair()`.
|
|
71
|
+
*/
|
|
72
|
+
declare const createMcpServer: (context: ToolContext) => Promise<{
|
|
73
|
+
deps: ToolDeps;
|
|
74
|
+
server: McpServer;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Boot the vis MCP server over stdio.
|
|
78
|
+
*
|
|
79
|
+
* Critical invariant: nothing in this process may write to stdout outside
|
|
80
|
+
* the MCP transport. Any console.log in tool handlers will frame-corrupt
|
|
81
|
+
* the JSON-RPC stream. Logs go to stderr only.
|
|
82
|
+
*/
|
|
83
|
+
declare const startMcpServer: () => Promise<void>;
|
|
84
|
+
declare const registerCacheHash: ({
|
|
85
|
+
server
|
|
86
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
87
|
+
declare const registerCacheWhy: ({
|
|
88
|
+
server
|
|
89
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
90
|
+
declare const registerDescribeProject: ({
|
|
91
|
+
server
|
|
92
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
93
|
+
declare const registerGetRunLogs: ({
|
|
94
|
+
server
|
|
95
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
96
|
+
declare const registerListProjects: ({
|
|
97
|
+
server
|
|
98
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
99
|
+
declare const registerListTargets: ({
|
|
100
|
+
server
|
|
101
|
+
}: ToolDeps, context: ToolContext) => void;
|
|
102
|
+
declare const isValidRunId: (value: string) => boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Task IDs are `<project>:<target>`; both halves are package or npm-scope
|
|
105
|
+
* shaped. The exec layer uses argv-form spawn so shell metacharacters are
|
|
106
|
+
* inert, but a leading `-` would be parsed as a CLI flag by the vis CLI.
|
|
107
|
+
*/
|
|
108
|
+
declare const isValidTaskId: (value: string) => boolean;
|
|
109
|
+
export { type ExecOptions, type ExecResult, type McpToolResponse, type ToolContext, type ToolDeps, createMcpServer, errorResponse, execVis, execVisJson, isValidRunId, isValidTaskId, okResponse, registerAllTools, registerCacheHash, registerCacheWhy, registerDescribeProject, registerGetRunLogs, registerListProjects, registerListTargets, startMcpServer };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{execVis as o,execVisJson as s}from"./packem_shared/execVis-BzS_F-9x.js";import{errorResponse as i,okResponse as p}from"./packem_shared/okResponse-DdzqnveW.js";import{createMcpServer as c,registerAllTools as f,startMcpServer as m}from"./packem_shared/registerAllTools-BIzixHAA.js";import{registerCacheHash as g}from"./packem_shared/registerCacheHash-CVckSIVO.js";import{registerCacheWhy as n}from"./packem_shared/registerCacheWhy-CMzL-Pg3.js";import{registerDescribeProject as h}from"./packem_shared/registerDescribeProject-Dhuzun-I.js";import{registerGetRunLogs as V}from"./packem_shared/registerGetRunLogs-BxkRfYZU.js";import{registerListProjects as T}from"./packem_shared/registerListProjects-C-AZj8RT.js";import{registerListTargets as k}from"./packem_shared/registerListTargets-Cq6bkF7O.js";import{isValidRunId as v,isValidTaskId as C}from"./packem_shared/isValidRunId-BKsKMWQf.js";export{c as createMcpServer,i as errorResponse,o as execVis,s as execVisJson,v as isValidRunId,C as isValidTaskId,p as okResponse,f as registerAllTools,g as registerCacheHash,n as registerCacheWhy,h as registerDescribeProject,V as registerGetRunLogs,T as registerListProjects,k as registerListTargets,m as startMcpServer};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var x=Object.defineProperty;var m=(i,e)=>x(i,"name",{value:e,configurable:!0});import{spawn as v}from"node:child_process";var g=Object.defineProperty,w=m((i,e)=>g(i,"name",{value:e,configurable:!0}),"c");const l=12e4,O=w(async(i,e,n={})=>{const o=n.timeoutMs??l,t={cwd:n.cwd??process.cwd(),env:{...process.env,...n.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"],windowsHide:!0};return await new Promise((p,f)=>{const r=v(process.execPath,[i,...e],t);let c="",d="",a=!1;const u=setTimeout(()=>{a=!0,r.kill("SIGTERM"),setTimeout(()=>r.kill("SIGKILL"),2e3).unref()},o);r.stdout?.setEncoding("utf8"),r.stdout?.on("data",s=>{c+=s}),r.stderr?.setEncoding("utf8"),r.stderr?.on("data",s=>{d+=s}),r.once("error",s=>{clearTimeout(u),f(s)}),r.once("close",s=>{clearTimeout(u),p({exitCode:s??-1,stderr:d,stdout:c,timedOut:a})})})},"execVis"),S=w(async(i,e,n={})=>{const o=await O(i,e,n);if(o.timedOut)throw new Error(`vis ${e.join(" ")} timed out after ${String(n.timeoutMs??l)}ms`);if(o.exitCode!==0){const t=o.stderr.trim().split(`
|
|
2
|
+
`).slice(-5).join(`
|
|
3
|
+
`);throw new Error(`vis ${e.join(" ")} exited with code ${String(o.exitCode)}${t?`
|
|
4
|
+
${t}`:""}`)}try{return JSON.parse(o.stdout)}catch(t){throw new Error(`vis ${e.join(" ")} did not emit valid JSON: ${t instanceof Error?t.message:String(t)}`,{cause:t})}},"execVisJson");export{O as execVis,S as execVisJson};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var a=(i,s)=>d(i,"name",{value:s,configurable:!0});var t=Object.defineProperty,e=a((i,s)=>t(i,"name",{value:s,configurable:!0}),"s");const n=/^[\w.-]+$/,r=e(i=>n.test(i),"isValidRunId"),o=e(i=>i.length>0&&!i.startsWith("-")&&i.includes(":"),"isValidTaskId");export{r as isValidRunId,o as isValidTaskId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});var s=Object.defineProperty,n=t((e,r)=>s(e,"name",{value:r,configurable:!0}),"o");const p=n(e=>({content:[{text:typeof e=="string"?e:JSON.stringify(e),type:"text"}]}),"okResponse"),a=n(e=>{const r=e instanceof Error?e.message:String(e);return{content:[{text:JSON.stringify({error:r}),type:"text"}],isError:!0}},"errorResponse");export{a as errorResponse,p as okResponse};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var y=Object.defineProperty;var n=(t,r)=>y(t,"name",{value:r,configurable:!0});import{readFile as g}from"node:fs/promises";import{createRequire as f}from"node:module";import{resolve as u,dirname as d}from"node:path";import{pathToFileURL as h,fileURLToPath as b}from"node:url";import{McpServer as w}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as k}from"@modelcontextprotocol/sdk/server/stdio.js";import{findUp as S}from"@visulima/fs";import*as e from"zod";import{execVisJson as l}from"./execVis-BzS_F-9x.js";import{okResponse as p,errorResponse as m}from"./okResponse-DdzqnveW.js";import{registerCacheHash as j}from"./registerCacheHash-CVckSIVO.js";import{registerCacheWhy as O}from"./registerCacheWhy-CMzL-Pg3.js";import{registerDescribeProject as R}from"./registerDescribeProject-Dhuzun-I.js";import{registerGetRunLogs as T}from"./registerGetRunLogs-BxkRfYZU.js";import{registerListProjects as P}from"./registerListProjects-C-AZj8RT.js";import{registerListTargets as V}from"./registerListTargets-Cq6bkF7O.js";var A=Object.defineProperty,_=n((t,r)=>A(t,"name",{value:r,configurable:!0}),"a$1");const B=e.object({advisoryCount:e.number(),lastSyncIso:e.string(),manifestEtag:e.string().nullable(),name:e.string()}),I=e.object({dbPath:e.string(),ecosystems:e.array(B),exists:e.boolean(),schemaVersion:e.number(),sizeBytes:e.number()}).catchall(e.unknown()),C=_(({server:t},r)=>{t.registerTool("advisory_status",{annotations:{readOnlyHint:!0},description:"Report the local OSV advisory DB freshness via `vis advisories status --format json`: DB path, schema version, per-ecosystem advisory counts, last sync timestamp, and ETag. Use this to detect whether the offline cache is stale before running an `audit` in offline mode.",inputSchema:{db:e.string().min(1).optional().describe("Override the cache DB path (default: <cache>/vis/advisories/db.sqlite).")}},async s=>{try{const a=["advisories","status","--format","json"];s.db!==void 0&&a.push("--db",s.db);const o=await l(r.visBin,a,{cwd:r.workspaceRoot}),i=I.parse(o);return p(i)}catch(a){return m(a)}})},"registerAdvisoryStatus");var D=Object.defineProperty,L=n((t,r)=>D(t,"name",{value:r,configurable:!0}),"a");const M=e.object({fixedVersions:e.array(e.string()).optional(),id:e.string(),severity:e.string(),summary:e.string().optional()}),E=e.object({acceptedRisk:e.unknown().optional(),name:e.string(),socketAlerts:e.array(e.unknown()).optional(),socketScore:e.number().nullable().optional(),version:e.string(),vulnerabilities:e.array(M)}),$=e.object({duplicates:e.array(e.object({name:e.string(),versionCount:e.number(),versions:e.array(e.string())})),packages:e.number(),results:e.array(E),summary:e.object({accepted:e.number(),duplicatePackages:e.number(),issues:e.number(),total:e.number()})}).catchall(e.unknown()),U=["low","medium","high","critical"],x=L(({server:t},r)=>{t.registerTool("audit",{annotations:{readOnlyHint:!0},description:"Audit installed packages for known vulnerabilities and supply-chain risk via `vis audit --format json`. Defaults to the local offline OSV cache when one exists, otherwise falls back to the live OSV API. Returns the parsed audit payload (results, duplicates, summary).",inputSchema:{ecosystem:e.string().optional().describe("Comma-separated OSV ecosystems to scan. Defaults to 'npm' (the only matcher wired today)."),offline:e.boolean().optional().describe("Force the local OSV cache. Errors if the cache is missing — run `vis advisories sync` first."),prodOnly:e.boolean().optional().describe("Skip devDependencies — scan the production graph only."),severity:e.enum(U).optional().describe("Minimum severity to report. Defaults to 'low'."),showAccepted:e.boolean().optional().describe("Include findings already on the workspace's accepted-risk list."),usage:e.boolean().optional().describe("Apply the reachability filter — only report vulnerabilities in statically-imported packages.")}},async s=>{try{const a=["audit","--format","json"];s.severity&&a.push("--severity",s.severity),s.offline&&a.push("--offline"),s.prodOnly&&a.push("--prod-only"),s.usage&&a.push("--usage"),s.ecosystem&&a.push("--ecosystem",s.ecosystem),s.showAccepted&&a.push("--show-accepted");const o=await l(r.visBin,a,{cwd:r.workspaceRoot}),i=$.parse(o);return p(i)}catch(a){return m(a)}})},"registerAudit");var H=Object.defineProperty,q=n((t,r)=>H(t,"name",{value:r,configurable:!0}),"r");const F=q(({server:t},r)=>{t.registerTool("describe_template",{annotations:{readOnlyHint:!0},description:"Return full metadata for a scaffolding template: description, default destination, and the variable schema (name, type, default, required, prompt, enum values). Use this before suggesting a `vis generate` command so option values can be filled correctly.",inputSchema:{name:e.string().describe('Template name (e.g. "package", "component"). Use list_templates to see available names.')}},async({name:s})=>{try{const a=await l(r.visBin,["generate",s,"--describe","--json"],{cwd:r.workspaceRoot});return p(a)}catch(a){return m(a)}})},"registerDescribeTemplate");var N=Object.defineProperty,J=n((t,r)=>N(t,"name",{value:r,configurable:!0}),"n");const W=J(({server:t},r)=>{t.registerTool("list_templates",{annotations:{readOnlyHint:!0},description:"List scaffolding templates discovered in the workspace (`.vis/templates/`, `.moon/templates/`, and `vis.config.ts` `generator.templates`). Each entry includes name, source, on-disk path, and one-line description.",inputSchema:{}},async()=>{try{const s=await l(r.visBin,["generate","--list","--json"],{cwd:r.workspaceRoot});return p({count:s.length,templates:s})}catch(s){return m(s)}})},"registerListTemplates");var z=Object.defineProperty,c=n((t,r)=>z(t,"name",{value:r,configurable:!0}),"s");const G=c(t=>{const r=process.env.VIS_MCP_VIS_BIN;if(r)return u(r);const s=f(h(`${t}/package.json`));let a,o;try{a=s.resolve("@visulima/vis/package.json"),o=s("@visulima/vis/package.json")}catch(v){throw new Error(`Cannot resolve \`@visulima/vis\` from ${t}. Install it as a workspace dependency, or set VIS_MCP_VIS_BIN to a vis CLI path.`,{cause:v})}const i=typeof o.bin=="string"?o.bin:o.bin?.vis;if(!i)throw new Error("`@visulima/vis` is installed but does not declare a `vis` bin entry — install a current version.");return u(d(a),i)},"resolveVisBin"),K=c(async()=>{try{const t=await S("package.json",{cwd:d(b(import.meta.url))});return t?JSON.parse(await g(t,"utf8")).version??"0.0.0":"0.0.0"}catch(t){return process.stderr.write(`[vis-mcp] failed to read package.json: ${t instanceof Error?t.message:String(t)}
|
|
2
|
+
`),"0.0.0"}},"loadVersion"),Q=c((t,r)=>{P(t,r),R(t,r),V(t,r),W(t,r),F(t,r),T(t,r),O(t,r),j(t,r),x(t,r),C(t,r)},"registerAllTools"),X=c(async t=>{const r=new w({name:"vis",version:await K()}),s={server:r};return Q(s,t),{deps:s,server:r}},"createMcpServer"),ve=c(async()=>{const t=process.env.VIS_MCP_WORKSPACE_ROOT??process.cwd(),r={visBin:G(t),workspaceRoot:t},{server:s}=await X(r);await s.connect(new k),process.stderr.write(`[vis-mcp] ready (workspace: ${r.workspaceRoot})
|
|
3
|
+
`)},"startMcpServer");export{X as createMcpServer,Q as registerAllTools,ve as startMcpServer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var s=(e,r)=>d(e,"name",{value:r,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{errorResponse as n,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=s((e,r)=>m(e,"name",{value:r,configurable:!0}),"n");const b=f(({server:e},r)=>{e.registerTool("cache_hash",{annotations:{readOnlyHint:!0},description:"Print the recorded hash and per-input hash details for a task — the contributing inputs (command, nodes, runtime, implicitDeps) that produced it.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:i})=>{if(!h(i))return n(new Error(`Invalid taskId "${i}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return n(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const a=["cache","hash",i,"--format=json"];t&&a.push("--run",t);const c=await p(r.visBin,a,{cwd:r.workspaceRoot});return u(c)}catch(a){return n(a)}})},"registerCacheHash");export{b as registerCacheHash};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{errorResponse as i,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=n((r,e)=>m(r,"name",{value:e,configurable:!0}),"i");const w=f(({server:r},e)=>{r.registerTool("cache_why",{annotations:{readOnlyHint:!0},description:"Explain why a task's cache hash rotated between runs. Diffs the task's hashDetails (command, nodes, runtime, implicitDeps) against the previous run to pinpoint what changed.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:a})=>{if(!h(a))return i(new Error(`Invalid taskId "${a}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return i(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const s=["cache","why",a,"--format=json"];t&&s.push("--run",t);const c=await p(e.visBin,s,{cwd:e.workspaceRoot});return u(c)}catch(s){return i(s)}})},"registerCacheWhy");export{w as registerCacheWhy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var a=(r,e)=>i(r,"name",{value:e,configurable:!0});import*as c from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{okResponse as l,errorResponse as s}from"./okResponse-DdzqnveW.js";var m=Object.defineProperty,g=a((r,e)=>m(r,"name",{value:e,configurable:!0}),"n");const b=g(({server:r},e)=>{r.registerTool("describe_project",{annotations:{readOnlyHint:!0},description:"Return full metadata for a single workspace project: language, layer, stack, type, tags, root path, and all targets.",inputSchema:{name:c.string().describe('Project name (e.g. "@visulima/cerebro")')}},async({name:o})=>{try{const t=(await p(e.visBin,["list","--json"],{cwd:e.workspaceRoot})).find(n=>n.name===o);return t?l(t):s(new Error(`No project named "${o}". Use list_projects to see available names.`))}catch(t){return s(t)}})},"registerDescribeProject");export{b as registerDescribeProject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var d=(t,r)=>f(t,"name",{value:r,configurable:!0});import{readFile as k}from"node:fs/promises";import{join as l}from"@visulima/path";import*as m from"zod";import{errorResponse as o,okResponse as p}from"./okResponse-DdzqnveW.js";import{isValidRunId as I}from"./isValidRunId-BKsKMWQf.js";var g=Object.defineProperty,y=d((t,r)=>g(t,"name",{value:r,configurable:!0}),"m");const h=y(({server:t},r)=>{t.registerTool("get_run_logs",{annotations:{readOnlyHint:!0},description:"Read a vis run summary from .task-runner/. Returns the most recent run by default, or a specific run when `runId` is set. Optionally filter to a single task with `taskId`.",inputSchema:{runId:m.string().optional().describe("Run ID (default: latest)"),taskId:m.string().optional().describe('Filter to a single task ID like "@my/app:build"')}},async({runId:e,taskId:a})=>{if(e!==void 0&&!I(e))return o(new Error(`Invalid runId "${e}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));const i=e?l(r.workspaceRoot,".task-runner","runs",`${e}.json`):l(r.workspaceRoot,".task-runner","last-summary.json");try{const n=await k(i,"utf8"),s=JSON.parse(n);if(a){const u=s.tasks?.find(c=>c.taskId===a);return u?p({runId:s.runId,task:u}):o(new Error(`Task "${a}" not found in run "${s.runId??"(unknown)"}".`))}return p(s)}catch(n){return n.code==="ENOENT"?o(new Error(`No run summary at ${i}. Run a task first to populate it.`)):o(n)}})},"registerGetRunLogs");export{h as registerGetRunLogs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var i=(t,e)=>n(t,"name",{value:e,configurable:!0});import*as a from"zod";import{execVisJson as c}from"./execVis-BzS_F-9x.js";import{okResponse as p,errorResponse as l}from"./okResponse-DdzqnveW.js";var g=Object.defineProperty,u=i((t,e)=>g(t,"name",{value:e,configurable:!0}),"n");const f=u(({server:t},e)=>{t.registerTool("list_projects",{annotations:{readOnlyHint:!0},description:'List all workspace projects with their language, type, layer, tags, and target metadata. Optionally filter with a vis query string (e.g. "tag=frontend", "type=application").',inputSchema:{query:a.string().optional().describe('Filter projects by vis query string (e.g. "tag=frontend")')}},async({query:s})=>{try{const r=["list","--json"];s&&r.push("--query",s);const o=await c(e.visBin,r,{cwd:e.workspaceRoot});return p({count:o.length,projects:o})}catch(r){return l(r)}})},"registerListProjects");export{f as registerListProjects};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=Object.defineProperty;var c=(t,e)=>l(t,"name",{value:e,configurable:!0});import*as g from"zod";import{execVisJson as m}from"./execVis-BzS_F-9x.js";import{errorResponse as p,okResponse as j}from"./okResponse-DdzqnveW.js";var u=Object.defineProperty,d=c((t,e)=>u(t,"name",{value:e,configurable:!0}),"c");const v=d(({server:t},e)=>{t.registerTool("list_targets",{annotations:{readOnlyHint:!0},description:"List per-target rows across the workspace: which targets each project exposes, with type, command, and description. Optionally narrow to a single project.",inputSchema:{project:g.string().optional().describe('Limit to one project (e.g. "@visulima/cerebro")')}},async({project:r})=>{try{const o=await m(e.visBin,["list","--targets","--json"],{cwd:e.workspaceRoot}),a=r?o.filter(s=>s.name===r):o;if(r&&a.length===0)return p(new Error(`No project named "${r}". Use list_projects to see available names.`));const n=a.flatMap(s=>(s.targets??[]).map(i=>({project:s.name,target:i.name,...i})));return j({count:n.length,targets:n})}catch(o){return p(o)}})},"registerListTargets");export{v as registerListTargets};
|
package/package.json
CHANGED
|
@@ -1,10 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/vis-mcp",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
|
+
"description": "MCP (Model Context Protocol) server for @visulima/vis — exposes vis tooling to AI agents over stdio",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
"agent",
|
|
7
|
+
"ai",
|
|
8
|
+
"claude",
|
|
9
|
+
"cursor",
|
|
10
|
+
"llm",
|
|
11
|
+
"mcp",
|
|
12
|
+
"model-context-protocol",
|
|
13
|
+
"vis",
|
|
14
|
+
"visulima"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://visulima.com/packages/vis-mcp",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/visulima/visulima/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/visulima/visulima.git",
|
|
23
|
+
"directory": "packages/tooling/vis-mcp"
|
|
24
|
+
},
|
|
25
|
+
"funding": [
|
|
26
|
+
{
|
|
27
|
+
"type": "github",
|
|
28
|
+
"url": "https://github.com/sponsors/prisis"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "consulting",
|
|
32
|
+
"url": "https://anolilab.com/support"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "Daniel Bannert",
|
|
38
|
+
"email": "d.bannert@anolilab.de"
|
|
39
|
+
},
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"type": "module",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"default": "./dist/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"bin": {
|
|
50
|
+
"vis-mcp": "./dist/bin.js"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist/**",
|
|
54
|
+
"README.md",
|
|
55
|
+
"CHANGELOG.md",
|
|
56
|
+
"LICENSE.md"
|
|
57
|
+
],
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
|
+
"@visulima/fs": "5.0.0-alpha.22",
|
|
61
|
+
"@visulima/path": "3.0.0-alpha.10",
|
|
62
|
+
"zod": "4.4.3"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@visulima/vis": "1.0.0-alpha.20"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": "^22.14.0 || >=24.10.0"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public",
|
|
72
|
+
"provenance": true
|
|
73
|
+
}
|
|
74
|
+
}
|