@viberaven/mcp 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +69 -69
- package/dist/lib/cli-runner.js +56 -2
- package/dist/server.js +49 -3
- package/dist/tools/index.js +48 -2
- package/package.json +56 -56
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 VibeRaven
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VibeRaven
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# @viberaven/mcp
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
4
|
-
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
5
|
-
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
6
|
-
|
|
7
|
-
Thin MCP wrapper for VibeRaven.
|
|
8
|
-
|
|
9
|
-
This package exposes VibeRaven CLI actions as MCP tools for Codex, Claude Code, Cursor, and other agent runtimes. It does not contain VibeRaven backend logic and does not bypass VibeRaven login or scan quotas.
|
|
10
|
-
|
|
11
|
-
The MCP server wraps the stable CLI package: `npx -y viberaven`.
|
|
12
|
-
|
|
13
|
-
For agent-mode artifacts, use `npx -y viberaven --agent-mode`.
|
|
14
|
-
|
|
15
|
-
## Run
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npx -y @viberaven/mcp
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
You can also start the MCP server from the main CLI package:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx -y viberaven mcp
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Tools
|
|
28
|
-
|
|
29
|
-
- `viberaven_check_readiness` -> `npx -y viberaven check --json`
|
|
30
|
-
- `viberaven_verify` -> `npx -y viberaven check --json`
|
|
31
|
-
- `viberaven_audit` -> `npx -y viberaven audit --vercel-supabase`
|
|
32
|
-
- `viberaven_init_rules` -> `npx -y viberaven init`
|
|
33
|
-
- `viberaven_clean_plan` -> `npx -y viberaven clean --plan`
|
|
34
|
-
- `viberaven_strict_gate` -> `npx -y viberaven --strict --json`
|
|
35
|
-
- `viberaven_gate_result` -> `npx -y viberaven --json`
|
|
36
|
-
- `viberaven_context_map` -> `npx -y viberaven --condense`
|
|
37
|
-
- `viberaven_actions` -> `npx -y viberaven actions`
|
|
38
|
-
- `viberaven_verify_action` -> `npx -y viberaven verify --action <id>`
|
|
39
|
-
- `viberaven_heal_plan` -> `npx -y viberaven --heal --plan`
|
|
40
|
-
- `viberaven_heal_prompt` -> `npx -y viberaven --heal --prompt`
|
|
41
|
-
- `viberaven_heal_apply` -> `npx -y viberaven --heal --apply`
|
|
42
|
-
- `viberaven_validate_npm_package` -> `npx -y viberaven validate-npm-package --json`
|
|
43
|
-
|
|
44
|
-
`viberaven_check_readiness` is the canonical entrypoint. It runs the local `viberaven check` (no login, no API key, no telemetry) and writes `.viberaven/agent-tasklist.md`, `.viberaven/gate-result.json`, and `.viberaven/context-map.json`.
|
|
45
|
-
|
|
46
|
-
After a batch of fixes, call `viberaven_verify`. Before deploy or CI pass, call `viberaven_strict_gate` or run:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npx -y viberaven --strict
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Machine Artifact Contract
|
|
53
|
-
|
|
54
|
-
```text
|
|
55
|
-
docs/contracts/artifacts.md
|
|
56
|
-
https://viberaven.dev/schemas/gate-result.schema.json
|
|
57
|
-
https://viberaven.dev/schemas/context-map.schema.json
|
|
58
|
-
https://viberaven.dev/schemas/gap.schema.json
|
|
59
|
-
https://viberaven.dev/schemas/heal-result.schema.json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Login
|
|
63
|
-
|
|
64
|
-
If VibeRaven prints `LOGIN_URL_READY`, open that exact URL for the user, keep the MCP call alive, and do not ask for passwords, tokens, cookies, or other secrets.
|
|
65
|
-
|
|
66
|
-
## Security
|
|
67
|
-
|
|
68
|
-
The MCP package is public integration glue only. It returns CLI stdout/stderr and structured JSON content when available. It does not mutate provider dashboards and does not bypass VibeRaven login, managed API checks, or quota enforcement. Do not claim provider dashboard checks are fixed by repo-code edits.
|
|
69
|
-
|
|
1
|
+
# @viberaven/mcp
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
4
|
+
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
5
|
+
[](https://www.npmjs.com/package/@viberaven/mcp)
|
|
6
|
+
|
|
7
|
+
Thin MCP wrapper for VibeRaven.
|
|
8
|
+
|
|
9
|
+
This package exposes VibeRaven CLI actions as MCP tools for Codex, Claude Code, Cursor, and other agent runtimes. It does not contain VibeRaven backend logic and does not bypass VibeRaven login or scan quotas.
|
|
10
|
+
|
|
11
|
+
The MCP server wraps the stable CLI package: `npx -y viberaven`.
|
|
12
|
+
|
|
13
|
+
For agent-mode artifacts, use `npx -y viberaven --agent-mode`.
|
|
14
|
+
|
|
15
|
+
## Run
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx -y @viberaven/mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You can also start the MCP server from the main CLI package:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx -y viberaven mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Tools
|
|
28
|
+
|
|
29
|
+
- `viberaven_check_readiness` -> `npx -y viberaven check --json`
|
|
30
|
+
- `viberaven_verify` -> `npx -y viberaven check --json`
|
|
31
|
+
- `viberaven_audit` -> `npx -y viberaven audit --vercel-supabase`
|
|
32
|
+
- `viberaven_init_rules` -> `npx -y viberaven init`
|
|
33
|
+
- `viberaven_clean_plan` -> `npx -y viberaven clean --plan`
|
|
34
|
+
- `viberaven_strict_gate` -> `npx -y viberaven --strict --json`
|
|
35
|
+
- `viberaven_gate_result` -> `npx -y viberaven --json`
|
|
36
|
+
- `viberaven_context_map` -> `npx -y viberaven --condense`
|
|
37
|
+
- `viberaven_actions` -> `npx -y viberaven actions`
|
|
38
|
+
- `viberaven_verify_action` -> `npx -y viberaven verify --action <id>`
|
|
39
|
+
- `viberaven_heal_plan` -> `npx -y viberaven --heal --plan`
|
|
40
|
+
- `viberaven_heal_prompt` -> `npx -y viberaven --heal --prompt`
|
|
41
|
+
- `viberaven_heal_apply` -> `npx -y viberaven --heal --apply`
|
|
42
|
+
- `viberaven_validate_npm_package` -> `npx -y viberaven validate-npm-package --json`
|
|
43
|
+
|
|
44
|
+
`viberaven_check_readiness` is the canonical entrypoint. It runs the local `viberaven check` (no login, no API key, no telemetry) and writes `.viberaven/agent-tasklist.md`, `.viberaven/gate-result.json`, and `.viberaven/context-map.json`.
|
|
45
|
+
|
|
46
|
+
After a batch of fixes, call `viberaven_verify`. Before deploy or CI pass, call `viberaven_strict_gate` or run:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx -y viberaven --strict
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Machine Artifact Contract
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
docs/contracts/artifacts.md
|
|
56
|
+
https://viberaven.dev/schemas/gate-result.schema.json
|
|
57
|
+
https://viberaven.dev/schemas/context-map.schema.json
|
|
58
|
+
https://viberaven.dev/schemas/gap.schema.json
|
|
59
|
+
https://viberaven.dev/schemas/heal-result.schema.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Login
|
|
63
|
+
|
|
64
|
+
If VibeRaven prints `LOGIN_URL_READY`, open that exact URL for the user, keep the MCP call alive, and do not ask for passwords, tokens, cookies, or other secrets.
|
|
65
|
+
|
|
66
|
+
## Security
|
|
67
|
+
|
|
68
|
+
The MCP package is public integration glue only. It returns CLI stdout/stderr and structured JSON content when available. It does not mutate provider dashboards and does not bypass VibeRaven login, managed API checks, or quota enforcement. Do not claim provider dashboard checks are fixed by repo-code edits.
|
|
69
|
+
|
package/dist/lib/cli-runner.js
CHANGED
|
@@ -26,13 +26,57 @@ __export(cli_runner_exports, {
|
|
|
26
26
|
buildHealArgs: () => buildHealArgs,
|
|
27
27
|
buildNpxCommand: () => buildNpxCommand,
|
|
28
28
|
buildToolArgs: () => buildToolArgs,
|
|
29
|
+
cliChildEnv: () => cliChildEnv,
|
|
30
|
+
cliNpxArgs: () => cliNpxArgs,
|
|
31
|
+
cliPackageSpec: () => cliPackageSpec,
|
|
32
|
+
mcpVersion: () => mcpVersion,
|
|
29
33
|
resolveCwd: () => resolveCwd,
|
|
30
34
|
runVibeRaven: () => runVibeRaven,
|
|
31
35
|
safeStringArg: () => safeStringArg
|
|
32
36
|
});
|
|
33
37
|
module.exports = __toCommonJS(cli_runner_exports);
|
|
34
38
|
var import_node_child_process = require("node:child_process");
|
|
39
|
+
var import_node_fs = require("node:fs");
|
|
40
|
+
var import_node_path = require("node:path");
|
|
35
41
|
var CLI_PACKAGE = "@viberaven/cli";
|
|
42
|
+
var MCP_PACKAGE = "@viberaven/mcp";
|
|
43
|
+
var PLAIN_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
44
|
+
var cachedVersion;
|
|
45
|
+
function mcpVersion() {
|
|
46
|
+
if (cachedVersion) return cachedVersion;
|
|
47
|
+
let found;
|
|
48
|
+
for (let dir = __dirname, depth = 0; depth < 4 && !found; depth += 1, dir = (0, import_node_path.dirname)(dir)) {
|
|
49
|
+
try {
|
|
50
|
+
const manifest = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(dir, "package.json"), "utf8"));
|
|
51
|
+
if (manifest.name === MCP_PACKAGE && typeof manifest.version === "string") found = manifest.version;
|
|
52
|
+
} catch {
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
found ??= true ? "1.5.1" : void 0;
|
|
56
|
+
if (!found || !PLAIN_VERSION.test(found)) {
|
|
57
|
+
throw new Error(`Could not read a valid ${MCP_PACKAGE} version (got ${JSON.stringify(found)}), so the matching ${CLI_PACKAGE} cannot be pinned.`);
|
|
58
|
+
}
|
|
59
|
+
cachedVersion = found;
|
|
60
|
+
return found;
|
|
61
|
+
}
|
|
62
|
+
function cliPackageSpec() {
|
|
63
|
+
return `${CLI_PACKAGE}@${mcpVersion()}`;
|
|
64
|
+
}
|
|
65
|
+
var CLI_BIN = "viberaven";
|
|
66
|
+
function cliNpxArgs(args) {
|
|
67
|
+
return ["-y", `--package=${cliPackageSpec()}`, "--", CLI_BIN, ...args];
|
|
68
|
+
}
|
|
69
|
+
var KEPT_NPM_CONFIG = /^(?:registry|.+:registry|proxy|https?_proxy|no_?proxy|cafile|ca|cert|key|strict_ssl|cache|offline|prefer_offline|prefer_online|fetch_.+|maxsockets|always_auth|_auth|_authtoken|.+:_auth|.+:_authtoken)$/;
|
|
70
|
+
function cliChildEnv(env = process.env) {
|
|
71
|
+
const out = {};
|
|
72
|
+
for (const [key, value] of Object.entries(env)) {
|
|
73
|
+
const lower = key.toLowerCase();
|
|
74
|
+
if (lower.startsWith("npm_package_") || lower.startsWith("npm_lifecycle_")) continue;
|
|
75
|
+
if (lower.startsWith("npm_config_") && !KEPT_NPM_CONFIG.test(lower.slice("npm_config_".length))) continue;
|
|
76
|
+
out[key] = value;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
36
80
|
var spawnFn = import_node_child_process.spawn;
|
|
37
81
|
function __setSpawnForTest(fn) {
|
|
38
82
|
spawnFn = fn;
|
|
@@ -113,11 +157,17 @@ function buildToolArgs(name, args) {
|
|
|
113
157
|
}
|
|
114
158
|
}
|
|
115
159
|
function runVibeRaven(args, cwd) {
|
|
160
|
+
let npxArgs;
|
|
161
|
+
try {
|
|
162
|
+
npxArgs = cliNpxArgs(args);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
return Promise.resolve(`ERROR: ${error instanceof Error ? error.message : String(error)}`);
|
|
165
|
+
}
|
|
116
166
|
return new Promise((resolve) => {
|
|
117
|
-
const built = buildNpxCommand(
|
|
167
|
+
const built = buildNpxCommand(npxArgs);
|
|
118
168
|
const child = spawnFn(built.command, built.args, {
|
|
119
169
|
cwd: resolveCwd(cwd),
|
|
120
|
-
env:
|
|
170
|
+
env: cliChildEnv(),
|
|
121
171
|
shell: built.shell,
|
|
122
172
|
stdio: ["ignore", "pipe", "pipe"]
|
|
123
173
|
});
|
|
@@ -144,6 +194,10 @@ ${combined}` : ""}`);
|
|
|
144
194
|
buildHealArgs,
|
|
145
195
|
buildNpxCommand,
|
|
146
196
|
buildToolArgs,
|
|
197
|
+
cliChildEnv,
|
|
198
|
+
cliNpxArgs,
|
|
199
|
+
cliPackageSpec,
|
|
200
|
+
mcpVersion,
|
|
147
201
|
resolveCwd,
|
|
148
202
|
runVibeRaven,
|
|
149
203
|
safeStringArg
|
package/dist/server.js
CHANGED
|
@@ -175,7 +175,47 @@ var npmTools = [
|
|
|
175
175
|
|
|
176
176
|
// src/lib/cli-runner.ts
|
|
177
177
|
var import_node_child_process = require("node:child_process");
|
|
178
|
+
var import_node_fs = require("node:fs");
|
|
179
|
+
var import_node_path = require("node:path");
|
|
178
180
|
var CLI_PACKAGE = "@viberaven/cli";
|
|
181
|
+
var MCP_PACKAGE = "@viberaven/mcp";
|
|
182
|
+
var PLAIN_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
183
|
+
var cachedVersion;
|
|
184
|
+
function mcpVersion() {
|
|
185
|
+
if (cachedVersion) return cachedVersion;
|
|
186
|
+
let found;
|
|
187
|
+
for (let dir = __dirname, depth = 0; depth < 4 && !found; depth += 1, dir = (0, import_node_path.dirname)(dir)) {
|
|
188
|
+
try {
|
|
189
|
+
const manifest = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(dir, "package.json"), "utf8"));
|
|
190
|
+
if (manifest.name === MCP_PACKAGE && typeof manifest.version === "string") found = manifest.version;
|
|
191
|
+
} catch {
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
found ??= true ? "1.5.1" : void 0;
|
|
195
|
+
if (!found || !PLAIN_VERSION.test(found)) {
|
|
196
|
+
throw new Error(`Could not read a valid ${MCP_PACKAGE} version (got ${JSON.stringify(found)}), so the matching ${CLI_PACKAGE} cannot be pinned.`);
|
|
197
|
+
}
|
|
198
|
+
cachedVersion = found;
|
|
199
|
+
return found;
|
|
200
|
+
}
|
|
201
|
+
function cliPackageSpec() {
|
|
202
|
+
return `${CLI_PACKAGE}@${mcpVersion()}`;
|
|
203
|
+
}
|
|
204
|
+
var CLI_BIN = "viberaven";
|
|
205
|
+
function cliNpxArgs(args) {
|
|
206
|
+
return ["-y", `--package=${cliPackageSpec()}`, "--", CLI_BIN, ...args];
|
|
207
|
+
}
|
|
208
|
+
var KEPT_NPM_CONFIG = /^(?:registry|.+:registry|proxy|https?_proxy|no_?proxy|cafile|ca|cert|key|strict_ssl|cache|offline|prefer_offline|prefer_online|fetch_.+|maxsockets|always_auth|_auth|_authtoken|.+:_auth|.+:_authtoken)$/;
|
|
209
|
+
function cliChildEnv(env = process.env) {
|
|
210
|
+
const out = {};
|
|
211
|
+
for (const [key, value] of Object.entries(env)) {
|
|
212
|
+
const lower = key.toLowerCase();
|
|
213
|
+
if (lower.startsWith("npm_package_") || lower.startsWith("npm_lifecycle_")) continue;
|
|
214
|
+
if (lower.startsWith("npm_config_") && !KEPT_NPM_CONFIG.test(lower.slice("npm_config_".length))) continue;
|
|
215
|
+
out[key] = value;
|
|
216
|
+
}
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
179
219
|
var spawnFn = import_node_child_process.spawn;
|
|
180
220
|
function safeStringArg(value, label) {
|
|
181
221
|
if (typeof value !== "string") throw new Error(`Invalid ${label}: expected string`);
|
|
@@ -250,11 +290,17 @@ function buildToolArgs(name, args) {
|
|
|
250
290
|
}
|
|
251
291
|
}
|
|
252
292
|
function runVibeRaven(args, cwd) {
|
|
293
|
+
let npxArgs;
|
|
294
|
+
try {
|
|
295
|
+
npxArgs = cliNpxArgs(args);
|
|
296
|
+
} catch (error) {
|
|
297
|
+
return Promise.resolve(`ERROR: ${error instanceof Error ? error.message : String(error)}`);
|
|
298
|
+
}
|
|
253
299
|
return new Promise((resolve) => {
|
|
254
|
-
const built = buildNpxCommand(
|
|
300
|
+
const built = buildNpxCommand(npxArgs);
|
|
255
301
|
const child = spawnFn(built.command, built.args, {
|
|
256
302
|
cwd: resolveCwd(cwd),
|
|
257
|
-
env:
|
|
303
|
+
env: cliChildEnv(),
|
|
258
304
|
shell: built.shell,
|
|
259
305
|
stdio: ["ignore", "pipe", "pipe"]
|
|
260
306
|
});
|
|
@@ -315,7 +361,7 @@ async function handleRequest(method, params) {
|
|
|
315
361
|
}
|
|
316
362
|
|
|
317
363
|
// src/server.ts
|
|
318
|
-
var SERVER_INFO = { name: "viberaven-mcp", version: "1.
|
|
364
|
+
var SERVER_INFO = { name: "viberaven-mcp", version: "1.5.1" };
|
|
319
365
|
var server = new import_server.Server(SERVER_INFO, { capabilities: { tools: {} } });
|
|
320
366
|
server.setRequestHandler(
|
|
321
367
|
import_types.ListToolsRequestSchema,
|
package/dist/tools/index.js
CHANGED
|
@@ -176,7 +176,47 @@ var npmTools = [
|
|
|
176
176
|
|
|
177
177
|
// src/lib/cli-runner.ts
|
|
178
178
|
var import_node_child_process = require("node:child_process");
|
|
179
|
+
var import_node_fs = require("node:fs");
|
|
180
|
+
var import_node_path = require("node:path");
|
|
179
181
|
var CLI_PACKAGE = "@viberaven/cli";
|
|
182
|
+
var MCP_PACKAGE = "@viberaven/mcp";
|
|
183
|
+
var PLAIN_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
184
|
+
var cachedVersion;
|
|
185
|
+
function mcpVersion() {
|
|
186
|
+
if (cachedVersion) return cachedVersion;
|
|
187
|
+
let found;
|
|
188
|
+
for (let dir = __dirname, depth = 0; depth < 4 && !found; depth += 1, dir = (0, import_node_path.dirname)(dir)) {
|
|
189
|
+
try {
|
|
190
|
+
const manifest = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(dir, "package.json"), "utf8"));
|
|
191
|
+
if (manifest.name === MCP_PACKAGE && typeof manifest.version === "string") found = manifest.version;
|
|
192
|
+
} catch {
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
found ??= true ? "1.5.1" : void 0;
|
|
196
|
+
if (!found || !PLAIN_VERSION.test(found)) {
|
|
197
|
+
throw new Error(`Could not read a valid ${MCP_PACKAGE} version (got ${JSON.stringify(found)}), so the matching ${CLI_PACKAGE} cannot be pinned.`);
|
|
198
|
+
}
|
|
199
|
+
cachedVersion = found;
|
|
200
|
+
return found;
|
|
201
|
+
}
|
|
202
|
+
function cliPackageSpec() {
|
|
203
|
+
return `${CLI_PACKAGE}@${mcpVersion()}`;
|
|
204
|
+
}
|
|
205
|
+
var CLI_BIN = "viberaven";
|
|
206
|
+
function cliNpxArgs(args) {
|
|
207
|
+
return ["-y", `--package=${cliPackageSpec()}`, "--", CLI_BIN, ...args];
|
|
208
|
+
}
|
|
209
|
+
var KEPT_NPM_CONFIG = /^(?:registry|.+:registry|proxy|https?_proxy|no_?proxy|cafile|ca|cert|key|strict_ssl|cache|offline|prefer_offline|prefer_online|fetch_.+|maxsockets|always_auth|_auth|_authtoken|.+:_auth|.+:_authtoken)$/;
|
|
210
|
+
function cliChildEnv(env = process.env) {
|
|
211
|
+
const out = {};
|
|
212
|
+
for (const [key, value] of Object.entries(env)) {
|
|
213
|
+
const lower = key.toLowerCase();
|
|
214
|
+
if (lower.startsWith("npm_package_") || lower.startsWith("npm_lifecycle_")) continue;
|
|
215
|
+
if (lower.startsWith("npm_config_") && !KEPT_NPM_CONFIG.test(lower.slice("npm_config_".length))) continue;
|
|
216
|
+
out[key] = value;
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
180
220
|
var spawnFn = import_node_child_process.spawn;
|
|
181
221
|
function __setSpawnForTest(fn) {
|
|
182
222
|
spawnFn = fn;
|
|
@@ -257,11 +297,17 @@ function buildToolArgs(name, args) {
|
|
|
257
297
|
}
|
|
258
298
|
}
|
|
259
299
|
function runVibeRaven(args, cwd) {
|
|
300
|
+
let npxArgs;
|
|
301
|
+
try {
|
|
302
|
+
npxArgs = cliNpxArgs(args);
|
|
303
|
+
} catch (error) {
|
|
304
|
+
return Promise.resolve(`ERROR: ${error instanceof Error ? error.message : String(error)}`);
|
|
305
|
+
}
|
|
260
306
|
return new Promise((resolve) => {
|
|
261
|
-
const built = buildNpxCommand(
|
|
307
|
+
const built = buildNpxCommand(npxArgs);
|
|
262
308
|
const child = spawnFn(built.command, built.args, {
|
|
263
309
|
cwd: resolveCwd(cwd),
|
|
264
|
-
env:
|
|
310
|
+
env: cliChildEnv(),
|
|
265
311
|
shell: built.shell,
|
|
266
312
|
stdio: ["ignore", "pipe", "pipe"]
|
|
267
313
|
});
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@viberaven/mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "MCP server for VibeRaven production-readiness: check_readiness, verify, heal, audit, and strict gate tools for Cursor, Claude Code, and Codex.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "VibeRaven",
|
|
7
|
-
"mcpName": "io.github.ohad6k/viberaven",
|
|
8
|
-
"homepage": "https://viberaven.dev/mcp.md",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/ohad6k/VibeRaven.git",
|
|
12
|
-
"directory": "packages/mcp"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/ohad6k/VibeRaven/issues"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"viberaven",
|
|
19
|
-
"mcp",
|
|
20
|
-
"claude-code",
|
|
21
|
-
"codex",
|
|
22
|
-
"cursor",
|
|
23
|
-
"launch-readiness",
|
|
24
|
-
"production"
|
|
25
|
-
],
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public",
|
|
28
|
-
"tag": "latest"
|
|
29
|
-
},
|
|
30
|
-
"bin": {
|
|
31
|
-
"viberaven-mcp": "dist/server.js"
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"dist",
|
|
35
|
-
"README.md"
|
|
36
|
-
],
|
|
37
|
-
"engines": {
|
|
38
|
-
"node": ">=20"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "node scripts/build.mjs",
|
|
42
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
43
|
-
"presmoke": "npm run build",
|
|
44
|
-
"smoke": "node scripts/smoke.mjs",
|
|
45
|
-
"pretest": "npm run build",
|
|
46
|
-
"test": "vitest run"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"esbuild": "^0.25.0",
|
|
53
|
-
"typescript": "^5.8.0",
|
|
54
|
-
"vitest": "^3.2.0"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@viberaven/mcp",
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "MCP server for VibeRaven production-readiness: check_readiness, verify, heal, audit, and strict gate tools for Cursor, Claude Code, and Codex.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "VibeRaven",
|
|
7
|
+
"mcpName": "io.github.ohad6k/viberaven",
|
|
8
|
+
"homepage": "https://viberaven.dev/mcp.md",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/ohad6k/VibeRaven.git",
|
|
12
|
+
"directory": "packages/mcp"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ohad6k/VibeRaven/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"viberaven",
|
|
19
|
+
"mcp",
|
|
20
|
+
"claude-code",
|
|
21
|
+
"codex",
|
|
22
|
+
"cursor",
|
|
23
|
+
"launch-readiness",
|
|
24
|
+
"production"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"tag": "latest"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"viberaven-mcp": "dist/server.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"README.md"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "node scripts/build.mjs",
|
|
42
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
43
|
+
"presmoke": "npm run build",
|
|
44
|
+
"smoke": "node scripts/smoke.mjs",
|
|
45
|
+
"pretest": "npm run build",
|
|
46
|
+
"test": "vitest run"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"esbuild": "^0.25.0",
|
|
53
|
+
"typescript": "^5.8.0",
|
|
54
|
+
"vitest": "^3.2.0"
|
|
55
|
+
}
|
|
56
|
+
}
|