@booyaka/mcp-vet 0.7.0 → 0.8.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 +3 -3
- package/dist/cli.js +11 -1
- package/dist/colors.d.ts +27 -0
- package/dist/colors.js +60 -0
- package/dist/reporters.js +4 -7
- package/package.json +71 -72
package/README.md
CHANGED
|
@@ -387,8 +387,8 @@ jobs:
|
|
|
387
387
|
vet:
|
|
388
388
|
runs-on: ubuntu-latest
|
|
389
389
|
steps:
|
|
390
|
-
- uses: actions/checkout@
|
|
391
|
-
- uses: actions/setup-node@
|
|
390
|
+
- uses: actions/checkout@v7
|
|
391
|
+
- uses: actions/setup-node@v7
|
|
392
392
|
with: { node-version: '20' }
|
|
393
393
|
- run: npx @booyaka/mcp-vet . --github-annotations
|
|
394
394
|
```
|
|
@@ -399,7 +399,7 @@ To upload results to GitHub code scanning instead:
|
|
|
399
399
|
|
|
400
400
|
```yaml
|
|
401
401
|
- run: npx @booyaka/mcp-vet . --sarif mcp-vet.sarif --fail-on none
|
|
402
|
-
- uses: github/codeql-action/upload-sarif@
|
|
402
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
403
403
|
with: { sarif_file: mcp-vet.sarif }
|
|
404
404
|
```
|
|
405
405
|
|
package/dist/cli.js
CHANGED
|
@@ -103,7 +103,17 @@ if (process.argv[2] === 'fixtures') {
|
|
|
103
103
|
// server/discover, resource error code). `run` is an alias for `probe`.
|
|
104
104
|
// Async, so the scan pipeline only runs in the else-branch.
|
|
105
105
|
if (process.argv[2] === 'probe' || process.argv[2] === 'run') {
|
|
106
|
-
(0, probe_cli_1.runProbeCli)(process.argv.slice(3)).then((code) =>
|
|
106
|
+
(0, probe_cli_1.runProbeCli)(process.argv.slice(3)).then((code) => {
|
|
107
|
+
// Calling process.exit() the moment the probe resolves tears the process
|
|
108
|
+
// down while undici's keep-alive sockets and the AbortSignal.timeout timer
|
|
109
|
+
// are still closing. On Windows that trips a libuv assertion
|
|
110
|
+
// (!(handle->flags & UV_HANDLE_CLOSING)) and the process dies with
|
|
111
|
+
// 0xC0000409 instead of the intended exit code. Set exitCode and let the
|
|
112
|
+
// loop drain instead; the unref'd fallback stops a lingering socket from
|
|
113
|
+
// ever hanging CI.
|
|
114
|
+
process.exitCode = code;
|
|
115
|
+
setTimeout(() => process.exit(code), 2000).unref();
|
|
116
|
+
}, (err) => fail(err.message));
|
|
107
117
|
}
|
|
108
118
|
else {
|
|
109
119
|
scanMain();
|
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny ANSI colouriser standing in for chalk.
|
|
3
|
+
*
|
|
4
|
+
* chalk 5+ is ESM-only. This package compiles to CommonJS, so `import chalk from
|
|
5
|
+
* 'chalk'` fails to typecheck (TS2307) and `require('chalk')` only works on Node
|
|
6
|
+
* versions with require(esm) — it broke on Node 20. The surface actually used here
|
|
7
|
+
* is seven colours plus `.bold` chaining, which is not worth a dependency.
|
|
8
|
+
*/
|
|
9
|
+
/** A callable style that can also be chained, e.g. `c.red.bold('x')`. */
|
|
10
|
+
export type Style = ((text: string) => string) & {
|
|
11
|
+
bold: (text: string) => string;
|
|
12
|
+
};
|
|
13
|
+
export interface Colors {
|
|
14
|
+
red: Style;
|
|
15
|
+
green: Style;
|
|
16
|
+
yellow: Style;
|
|
17
|
+
cyan: Style;
|
|
18
|
+
gray: Style;
|
|
19
|
+
bold: Style;
|
|
20
|
+
underline: Style;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `level` mirrors chalk's: 0 disables colour, anything higher enables it.
|
|
24
|
+
* When omitted, colour is auto-detected the way chalk does — a TTY on stdout,
|
|
25
|
+
* unless NO_COLOR is set or the terminal is `dumb`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createColors(level?: number): Colors;
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A tiny ANSI colouriser standing in for chalk.
|
|
4
|
+
*
|
|
5
|
+
* chalk 5+ is ESM-only. This package compiles to CommonJS, so `import chalk from
|
|
6
|
+
* 'chalk'` fails to typecheck (TS2307) and `require('chalk')` only works on Node
|
|
7
|
+
* versions with require(esm) — it broke on Node 20. The surface actually used here
|
|
8
|
+
* is seven colours plus `.bold` chaining, which is not worth a dependency.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.createColors = createColors;
|
|
12
|
+
const ESC = String.fromCharCode(27);
|
|
13
|
+
const CODES = {
|
|
14
|
+
reset: 0,
|
|
15
|
+
bold: 1,
|
|
16
|
+
red: 31,
|
|
17
|
+
green: 32,
|
|
18
|
+
yellow: 33,
|
|
19
|
+
cyan: 36,
|
|
20
|
+
gray: 90,
|
|
21
|
+
underline: 4,
|
|
22
|
+
};
|
|
23
|
+
function wrap(enabled, codes) {
|
|
24
|
+
if (!enabled || codes.length === 0)
|
|
25
|
+
return (text) => text;
|
|
26
|
+
const open = codes.map((c) => `${ESC}[${c}m`).join('');
|
|
27
|
+
const close = `${ESC}[${CODES.reset}m`;
|
|
28
|
+
return (text) => open + text + close;
|
|
29
|
+
}
|
|
30
|
+
function style(enabled, name) {
|
|
31
|
+
const base = wrap(enabled, [CODES[name]]);
|
|
32
|
+
base.bold = wrap(enabled, [CODES[name], CODES.bold]);
|
|
33
|
+
return base;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `level` mirrors chalk's: 0 disables colour, anything higher enables it.
|
|
37
|
+
* When omitted, colour is auto-detected the way chalk does — a TTY on stdout,
|
|
38
|
+
* unless NO_COLOR is set or the terminal is `dumb`.
|
|
39
|
+
*/
|
|
40
|
+
function createColors(level) {
|
|
41
|
+
const enabled = level === undefined ? autoDetect() : level > 0;
|
|
42
|
+
return {
|
|
43
|
+
red: style(enabled, 'red'),
|
|
44
|
+
green: style(enabled, 'green'),
|
|
45
|
+
yellow: style(enabled, 'yellow'),
|
|
46
|
+
cyan: style(enabled, 'cyan'),
|
|
47
|
+
gray: style(enabled, 'gray'),
|
|
48
|
+
bold: style(enabled, 'bold'),
|
|
49
|
+
underline: style(enabled, 'underline'),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function autoDetect() {
|
|
53
|
+
if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== '')
|
|
54
|
+
return false;
|
|
55
|
+
if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== '0')
|
|
56
|
+
return true;
|
|
57
|
+
if (process.env.TERM === 'dumb')
|
|
58
|
+
return false;
|
|
59
|
+
return Boolean(process.stdout && process.stdout.isTTY);
|
|
60
|
+
}
|
package/dist/reporters.js
CHANGED
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.reportTerminal = reportTerminal;
|
|
40
37
|
exports.renderMarkdown = renderMarkdown;
|
|
@@ -48,17 +45,17 @@ exports.writeSarif = writeSarif;
|
|
|
48
45
|
exports.reportProbeTerminal = reportProbeTerminal;
|
|
49
46
|
const fs = __importStar(require("node:fs"));
|
|
50
47
|
const path = __importStar(require("node:path"));
|
|
51
|
-
const
|
|
48
|
+
const colors_1 = require("./colors");
|
|
52
49
|
const types_1 = require("./types");
|
|
53
50
|
const rules_1 = require("./rules");
|
|
54
51
|
const constants_1 = require("./constants");
|
|
55
52
|
function makeChalk(color) {
|
|
56
53
|
// color === true -> force on; false -> force off; undefined -> auto-detect
|
|
57
54
|
if (color === true)
|
|
58
|
-
return
|
|
55
|
+
return (0, colors_1.createColors)(1);
|
|
59
56
|
if (color === false)
|
|
60
|
-
return
|
|
61
|
-
return
|
|
57
|
+
return (0, colors_1.createColors)(0);
|
|
58
|
+
return (0, colors_1.createColors)();
|
|
62
59
|
}
|
|
63
60
|
function indent(text, pad) {
|
|
64
61
|
return text
|
package/package.json
CHANGED
|
@@ -1,72 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@booyaka/mcp-vet",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Scan MCP server source code for patterns that break under the 2026-07-28 Model Context Protocol spec release candidate.",
|
|
5
|
-
"type": "commonjs",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"default": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
14
|
-
},
|
|
15
|
-
"sideEffects": false,
|
|
16
|
-
"bin": {
|
|
17
|
-
"mcp-vet": "dist/cli.js"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist",
|
|
21
|
-
"schema",
|
|
22
|
-
"README.md",
|
|
23
|
-
"CHANGELOG.md",
|
|
24
|
-
"BENCHMARK.md",
|
|
25
|
-
"LICENSE"
|
|
26
|
-
],
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=
|
|
29
|
-
},
|
|
30
|
-
"author": "Booyaka101 <cbosch101@gmail.com>",
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/Booyaka101/mcp-vet.git"
|
|
34
|
-
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/Booyaka101/mcp-vet/issues"
|
|
37
|
-
},
|
|
38
|
-
"homepage": "https://github.com/Booyaka101/mcp-vet#readme",
|
|
39
|
-
"publishConfig": {
|
|
40
|
-
"access": "public"
|
|
41
|
-
},
|
|
42
|
-
"keywords": [
|
|
43
|
-
"mcp",
|
|
44
|
-
"model-context-protocol",
|
|
45
|
-
"linter",
|
|
46
|
-
"static-analysis",
|
|
47
|
-
"migration",
|
|
48
|
-
"breaking-changes",
|
|
49
|
-
"2026-07-28",
|
|
50
|
-
"sarif",
|
|
51
|
-
"ci",
|
|
52
|
-
"ast",
|
|
53
|
-
"cli",
|
|
54
|
-
"typescript",
|
|
55
|
-
"python"
|
|
56
|
-
],
|
|
57
|
-
"license": "MIT",
|
|
58
|
-
"scripts": {
|
|
59
|
-
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
60
|
-
"prepare": "npm run build",
|
|
61
|
-
"test": "npm run build && node --test test/scan.test.mjs test/probe.test.mjs"
|
|
62
|
-
},
|
|
63
|
-
"dependencies": {
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@booyaka/mcp-vet",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Scan MCP server source code for patterns that break under the 2026-07-28 Model Context Protocol spec release candidate.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"bin": {
|
|
17
|
+
"mcp-vet": "dist/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"schema",
|
|
22
|
+
"README.md",
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"BENCHMARK.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22"
|
|
29
|
+
},
|
|
30
|
+
"author": "Booyaka101 <cbosch101@gmail.com>",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/Booyaka101/mcp-vet.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/Booyaka101/mcp-vet/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/Booyaka101/mcp-vet#readme",
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"mcp",
|
|
44
|
+
"model-context-protocol",
|
|
45
|
+
"linter",
|
|
46
|
+
"static-analysis",
|
|
47
|
+
"migration",
|
|
48
|
+
"breaking-changes",
|
|
49
|
+
"2026-07-28",
|
|
50
|
+
"sarif",
|
|
51
|
+
"ci",
|
|
52
|
+
"ast",
|
|
53
|
+
"cli",
|
|
54
|
+
"typescript",
|
|
55
|
+
"python"
|
|
56
|
+
],
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
60
|
+
"prepare": "npm run build",
|
|
61
|
+
"test": "npm run build && node --test test/scan.test.mjs test/probe.test.mjs"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"commander": "^15.0.0",
|
|
65
|
+
"ts-morph": "^28.0.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^26.1.1",
|
|
69
|
+
"typescript": "^5.5.4"
|
|
70
|
+
}
|
|
71
|
+
}
|