@eidonze/mcpdoctor 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/LICENSE +21 -0
- package/README.md +81 -52
- package/bin/mcpdoctor.mjs +1 -1
- package/package.json +6 -4
- package/test/smoke.mjs +73 -73
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xka0085-byte (Eidon)
|
|
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,29 +1,30 @@
|
|
|
1
1
|
# mcpdoctor
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
One command tells you whether your paid endpoint answers the way agent clients
|
|
5
|
-
actually expect — before a real buyer (human or AI) hits it.
|
|
3
|
+
> ⚠️ **Official package notice**: this is the official `mcpdoctor`, published by npm user [`eidonze`](https://www.npmjs.com/~eidonze), repo [`xka0085-byte/mcp-doctor`](https://github.com/xka0085-byte/mcp-doctor). We are **NOT affiliated** with **mcpdoctor.dev** — that is a *different* product (an MCP **server-auditing** tool). This `mcpdoctor` is an independent, read-only **402/x402 payment-endpoint inspector CLI**. Same name, different tool. Verify the package by its scope: `@eidonze/mcpdoctor`.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
**mcpdoctor is a read-only CLI for inspecting MCP and x402 endpoints.**
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
npx @eidonze/mcpdoctor inspect https://your-endpoint/v1/paid --method=POST
|
|
11
|
-
```
|
|
7
|
+
Point it at a URL, get one `PASS / FAIL / UNKNOWN` report:
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- the **HTTP 402 payment document** — parsed from the known locations
|
|
10
|
+
(`Payment-Required` / `X-Payment-Required` / `WWW-Authenticate` headers or
|
|
11
|
+
the response body), in both x402 v1 (`accepts[]`) and v2 (`x402.accepts`)
|
|
12
|
+
shapes, with every `scheme / network / asset / amount / payTo` field checked;
|
|
13
|
+
- the **discovery manifests** — whether `/.well-known/mcp/server.json` and
|
|
14
|
+
`/.well-known/x402` are reachable, with a SHA-256 of each;
|
|
15
|
+
- a **SHA-256 digest** of the response body, plus latency and size.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
mcpdoctor is **not an MCP server** and does not implement the MCP protocol.
|
|
18
|
+
It is the endpoint inspector you run *before* pointing an MCP client or an
|
|
19
|
+
x402 buyer at an endpoint — a preflight/debugging tool for AI-agent payment
|
|
20
|
+
infrastructure. Zero dependencies. Node ≥ 18. Never touches keys, never pays.
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
challenge is invisible to every x402 client — they only react to `402`;
|
|
20
|
-
- payment documents arrive in **four different places** (`Payment-Required` /
|
|
21
|
-
`X-Payment-Required` / `WWW-Authenticate` headers, or the response body) and
|
|
22
|
-
in **two different shapes** (v1 top-level `accepts[]`, v2 nested `x402.accepts`);
|
|
23
|
-
parsers that only look at one place report false failures;
|
|
24
|
-
- vendor hint headers without `accepts[]` can shadow the real payment document.
|
|
22
|
+
## Install
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @eidonze/mcpdoctor # or run without installing:
|
|
26
|
+
npx @eidonze/mcpdoctor inspect <url>
|
|
27
|
+
```
|
|
27
28
|
|
|
28
29
|
## Usage
|
|
29
30
|
|
|
@@ -35,47 +36,75 @@ mcpdoctor inspect <url> [--method=GET|POST] [--format=json|markdown]
|
|
|
35
36
|
|---|---|---|
|
|
36
37
|
| `--method` | `GET` | HTTP verb for the probe (`POST` sends `{}`) |
|
|
37
38
|
| `--format` | `markdown` | `json` for CI / machine-readable reports |
|
|
39
|
+
| `--json` | — | shorthand for `--format=json` |
|
|
40
|
+
|
|
41
|
+
Exit codes: `0` PASS · `1` FAIL · `2` UNKNOWN (network/timeout) · `3` usage error.
|
|
42
|
+
|
|
43
|
+
## Real examples (captured 2026-09-29, against live endpoints)
|
|
44
|
+
|
|
45
|
+
Inspecting an MCP endpoint that is free (no payment gate) — the tool reports
|
|
46
|
+
the 200 instead of a 402, and still verifies the discovery manifests:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"endpoint": "https://agenttoll-receipts.app.workbuddy.host/mcp",
|
|
51
|
+
"method": "POST",
|
|
52
|
+
"finalStatus": "FAIL",
|
|
53
|
+
"http": { "status": 200, "elapsedMs": 2830, "bodyBytes": 82,
|
|
54
|
+
"bodySha256": "598dc097dcca1e573c742100863899c00724a021b421a5bb49952d49fec6b4f4" },
|
|
55
|
+
"findings": [
|
|
56
|
+
{ "status": "FAIL", "code": "NO_402", "message": "Expected HTTP 402, received 200" }
|
|
57
|
+
],
|
|
58
|
+
"metadata": [
|
|
59
|
+
{ "path": "/.well-known/mcp/server.json", "status": 200, "reachable": true }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
38
63
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
Inspecting the official x402 demo endpoint — it does return 402, but ships a
|
|
65
|
+
payment document mcpdoctor cannot parse, which is exactly the class of silent
|
|
66
|
+
breakage this CLI exists to catch:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"endpoint": "https://x402.org/protected",
|
|
71
|
+
"finalStatus": "FAIL",
|
|
72
|
+
"http": { "status": 402 },
|
|
73
|
+
"headers": { "paymentRequired": true },
|
|
74
|
+
"findings": [
|
|
75
|
+
{ "status": "FAIL", "code": "NO_ACCEPTS",
|
|
76
|
+
"message": "No recognizable payment requirement found" }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
52
80
|
|
|
53
|
-
##
|
|
81
|
+
## What it does NOT do
|
|
54
82
|
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
83
|
+
- No MCP protocol session: no `initialize`, no `tools/list` — mcpdoctor
|
|
84
|
+
checks what an endpoint *advertises* (402 documents, discovery manifests),
|
|
85
|
+
not a full MCP handshake.
|
|
86
|
+
- No wallet, signing, settlement, or retries. Read-only preflight only.
|
|
87
|
+
- `PASS` means the observed 402 document had recognizable, complete fields —
|
|
88
|
+
it is not a security or payment-success certification.
|
|
60
89
|
|
|
61
|
-
|
|
62
|
-
npm test
|
|
63
|
-
```
|
|
90
|
+
## Why
|
|
64
91
|
|
|
65
|
-
|
|
92
|
+
We ship an x402 service ourselves ([ReceiptRail](https://github.com/xka0085-byte/agenttoll))
|
|
93
|
+
and hit every way a paid endpoint can silently break:
|
|
66
94
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
95
|
+
- an endpoint that validates the request body **before** returning the 402
|
|
96
|
+
challenge is invisible to every x402 client — they only react to `402`;
|
|
97
|
+
- payment documents arrive in **four different places** and **two different
|
|
98
|
+
shapes**; parsers that only look at one place report false failures;
|
|
99
|
+
- vendor hint headers without `accepts[]` can shadow the real payment document.
|
|
71
100
|
|
|
72
|
-
|
|
101
|
+
Each check in mcpdoctor maps to a failure mode we actually hit in production.
|
|
73
102
|
|
|
74
|
-
|
|
75
|
-
- `x-payment-info.protocols` object-array check
|
|
76
|
-
- MCP streamable-HTTP `initialize` handshake check
|
|
77
|
-
- `/.well-known/mcp/server-card.json` (Smithery SEP-1649) validation
|
|
103
|
+
## Part of the Agent / Chain Evidence Tools suite
|
|
78
104
|
|
|
79
|
-
|
|
105
|
+
Read-only diagnostics for AI agents on Web3 —
|
|
106
|
+
[hub & docs](https://xka0085-byte.github.io/evidence-tools/) ·
|
|
107
|
+
[ReceiptRail (live MCP service)](https://github.com/xka0085-byte/agenttoll) ·
|
|
108
|
+
[npm: @eidonze/mcpdoctor](https://www.npmjs.com/package/@eidonze/mcpdoctor)
|
|
80
109
|
|
|
81
|
-
MIT
|
|
110
|
+
MIT licensed. Known limitations are documented, not hidden.
|
package/bin/mcpdoctor.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eidonze/mcpdoctor",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"mcpName": "io.github.xka0085-byte/mcpdoctor",
|
|
5
|
+
"description": "CLI for inspecting MCP and x402 endpoints: parses the HTTP 402 payment document (v1/v2 accepts[]), checks /.well-known/mcp and /.well-known/x402 discovery manifests, returns a response SHA-256 digest. Read-only endpoint inspector and preflight debugging tool for AI-agent payment endpoints. Not an MCP server. Zero dependencies.",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"bin": { "mcpdoctor": "bin/mcpdoctor.mjs" },
|
|
8
9
|
"main": "bin/mcpdoctor.mjs",
|
|
10
|
+
"files": ["bin", "test", "README.md", "LICENSE"],
|
|
9
11
|
"engines": { "node": ">=18" },
|
|
10
12
|
"scripts": { "test": "node test/smoke.mjs" },
|
|
11
|
-
"keywords": ["mcp", "
|
|
13
|
+
"keywords": ["mcp", "model-context-protocol", "mcp-cli", "mcp-inspector", "mcp-endpoint-inspector", "mcp-debugging", "x402", "cli", "developer-tools", "diagnostics"],
|
|
12
14
|
"repository": { "type": "git", "url": "git+https://github.com/xka0085-byte/mcp-doctor.git" },
|
|
13
15
|
"bugs": { "url": "https://github.com/xka0085-byte/mcp-doctor/issues" },
|
|
14
|
-
"homepage": "https://github.
|
|
16
|
+
"homepage": "https://xka0085-byte.github.io/evidence-tools/"
|
|
15
17
|
}
|
package/test/smoke.mjs
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { createServer } from 'node:http';
|
|
4
|
-
import { spawn } from 'node:child_process';
|
|
5
|
-
import { once } from 'node:events';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
|
|
9
|
-
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
10
|
-
const cli = path.join(root, 'bin', 'mcpdoctor.mjs');
|
|
11
|
-
const server = createServer((request, response) => {
|
|
12
|
-
if (request.url === '/good') {
|
|
13
|
-
response.writeHead(402, { 'content-type': 'application/json', 'payment-required': JSON.stringify({ x402Version: 2, accepts: [{ scheme: 'exact', network: 'eip155:8453', asset: 'USDC', amount: '10000', payTo: '0x1234567890123456789012345678901234567890' }] }) });
|
|
14
|
-
response.end(JSON.stringify({ x402Version: 2, accepts: [{ scheme: 'exact', network: 'eip155:8453', asset: 'USDC', amount: '10000', payTo: '0x1234567890123456789012345678901234567890' }] }));
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
// regression (found against production ReceiptRail): a hint header WITHOUT accepts[]
|
|
18
|
-
// must not shadow the real payment document in the body
|
|
19
|
-
if (request.url === '/header-hint') {
|
|
20
|
-
response.writeHead(402, { 'content-type': 'application/json', 'x-payment-required': JSON.stringify({ vendor: 'VendorHintNoAccepts', amount: '1000', decimals: 6 }) });
|
|
21
|
-
response.end(JSON.stringify({ x402Version: 2, resource: { url: 'x', description: 'd', mimeType: 'application/json' }, accepts: [{ scheme: 'exact', network: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1', amount: '1000', asset: 'MINT', payTo: 'PayToAddr' }] }));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// regression (our original production bug): body validation must not shadow the 402
|
|
25
|
-
if (request.url === '/bad-400') {
|
|
26
|
-
response.writeHead(400, { 'content-type': 'application/json' });
|
|
27
|
-
response.end(JSON.stringify({ error: 'missing body param' }));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
response.writeHead(404, { 'content-type': 'application/json' });
|
|
31
|
-
response.end(JSON.stringify({ error: 'not found' }));
|
|
32
|
-
});
|
|
33
|
-
server.listen(0, '127.0.0.1');
|
|
34
|
-
await once(server, 'listening');
|
|
35
|
-
const port = server.address().port;
|
|
36
|
-
|
|
37
|
-
function run(url, ...args) {
|
|
38
|
-
return new Promise((resolve) => {
|
|
39
|
-
const child = spawn(process.execPath, [cli, 'inspect', url, '--format=json', ...args], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
40
|
-
let stdout = ''; let stderr = '';
|
|
41
|
-
child.stdout.on('data', (chunk) => { stdout += chunk; });
|
|
42
|
-
child.stderr.on('data', (chunk) => { stderr += chunk; });
|
|
43
|
-
child.on('close', (code) => resolve({ code, stdout, stderr }));
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
const good = await run(`http://127.0.0.1:${port}/good`);
|
|
49
|
-
assert.equal(good.code, 0, good.stderr);
|
|
50
|
-
assert.equal(JSON.parse(good.stdout).finalStatus, 'PASS');
|
|
51
|
-
const bad = await run(`http://127.0.0.1:${port}/missing`);
|
|
52
|
-
assert.equal(bad.code, 1, bad.stderr);
|
|
53
|
-
assert.equal(JSON.parse(bad.stdout).finalStatus, 'FAIL');
|
|
54
|
-
const hint = await run(`http://127.0.0.1:${port}/header-hint`, '--method=POST');
|
|
55
|
-
assert.equal(hint.code, 0, hint.stderr);
|
|
56
|
-
const hintReport = JSON.parse(hint.stdout);
|
|
57
|
-
assert.equal(hintReport.finalStatus, 'PASS', JSON.stringify(hintReport.findings));
|
|
58
|
-
assert.equal(hintReport.x402.accepts.length, 1, 'body accepts[] must win over accept-less header hints');
|
|
59
|
-
const bad400 = await run(`http://127.0.0.1:${port}/bad-400`, '--method=POST');
|
|
60
|
-
assert.equal(bad400.code, 1, bad400.stderr);
|
|
61
|
-
const bad400Report = JSON.parse(bad400.stdout);
|
|
62
|
-
assert.equal(bad400Report.finalStatus, 'FAIL');
|
|
63
|
-
assert.ok(bad400Report.findings.some((f) => f.code === 'NO_402'), 'must flag 400-instead-of-402');
|
|
64
|
-
const help = await new Promise((resolve) => {
|
|
65
|
-
const child = spawn(process.execPath, [cli, '--help'], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
66
|
-
let stdout = ''; child.stdout.on('data', (chunk) => { stdout += chunk; }); child.on('close', (code) => resolve({ code, stdout }));
|
|
67
|
-
});
|
|
68
|
-
assert.equal(help.code, 0);
|
|
69
|
-
assert.match(help.stdout, /mcpdoctor/);
|
|
70
|
-
console.log('mcpdoctor smoke tests passed');
|
|
71
|
-
} finally {
|
|
72
|
-
server.close();
|
|
73
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createServer } from 'node:http';
|
|
4
|
+
import { spawn } from 'node:child_process';
|
|
5
|
+
import { once } from 'node:events';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
|
|
9
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
10
|
+
const cli = path.join(root, 'bin', 'mcpdoctor.mjs');
|
|
11
|
+
const server = createServer((request, response) => {
|
|
12
|
+
if (request.url === '/good') {
|
|
13
|
+
response.writeHead(402, { 'content-type': 'application/json', 'payment-required': JSON.stringify({ x402Version: 2, accepts: [{ scheme: 'exact', network: 'eip155:8453', asset: 'USDC', amount: '10000', payTo: '0x1234567890123456789012345678901234567890' }] }) });
|
|
14
|
+
response.end(JSON.stringify({ x402Version: 2, accepts: [{ scheme: 'exact', network: 'eip155:8453', asset: 'USDC', amount: '10000', payTo: '0x1234567890123456789012345678901234567890' }] }));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
// regression (found against production ReceiptRail): a hint header WITHOUT accepts[]
|
|
18
|
+
// must not shadow the real payment document in the body
|
|
19
|
+
if (request.url === '/header-hint') {
|
|
20
|
+
response.writeHead(402, { 'content-type': 'application/json', 'x-payment-required': JSON.stringify({ vendor: 'VendorHintNoAccepts', amount: '1000', decimals: 6 }) });
|
|
21
|
+
response.end(JSON.stringify({ x402Version: 2, resource: { url: 'x', description: 'd', mimeType: 'application/json' }, accepts: [{ scheme: 'exact', network: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1', amount: '1000', asset: 'MINT', payTo: 'PayToAddr' }] }));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// regression (our original production bug): body validation must not shadow the 402
|
|
25
|
+
if (request.url === '/bad-400') {
|
|
26
|
+
response.writeHead(400, { 'content-type': 'application/json' });
|
|
27
|
+
response.end(JSON.stringify({ error: 'missing body param' }));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
response.writeHead(404, { 'content-type': 'application/json' });
|
|
31
|
+
response.end(JSON.stringify({ error: 'not found' }));
|
|
32
|
+
});
|
|
33
|
+
server.listen(0, '127.0.0.1');
|
|
34
|
+
await once(server, 'listening');
|
|
35
|
+
const port = server.address().port;
|
|
36
|
+
|
|
37
|
+
function run(url, ...args) {
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
const child = spawn(process.execPath, [cli, 'inspect', url, '--format=json', ...args], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
40
|
+
let stdout = ''; let stderr = '';
|
|
41
|
+
child.stdout.on('data', (chunk) => { stdout += chunk; });
|
|
42
|
+
child.stderr.on('data', (chunk) => { stderr += chunk; });
|
|
43
|
+
child.on('close', (code) => resolve({ code, stdout, stderr }));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const good = await run(`http://127.0.0.1:${port}/good`);
|
|
49
|
+
assert.equal(good.code, 0, good.stderr);
|
|
50
|
+
assert.equal(JSON.parse(good.stdout).finalStatus, 'PASS');
|
|
51
|
+
const bad = await run(`http://127.0.0.1:${port}/missing`);
|
|
52
|
+
assert.equal(bad.code, 1, bad.stderr);
|
|
53
|
+
assert.equal(JSON.parse(bad.stdout).finalStatus, 'FAIL');
|
|
54
|
+
const hint = await run(`http://127.0.0.1:${port}/header-hint`, '--method=POST');
|
|
55
|
+
assert.equal(hint.code, 0, hint.stderr);
|
|
56
|
+
const hintReport = JSON.parse(hint.stdout);
|
|
57
|
+
assert.equal(hintReport.finalStatus, 'PASS', JSON.stringify(hintReport.findings));
|
|
58
|
+
assert.equal(hintReport.x402.accepts.length, 1, 'body accepts[] must win over accept-less header hints');
|
|
59
|
+
const bad400 = await run(`http://127.0.0.1:${port}/bad-400`, '--method=POST');
|
|
60
|
+
assert.equal(bad400.code, 1, bad400.stderr);
|
|
61
|
+
const bad400Report = JSON.parse(bad400.stdout);
|
|
62
|
+
assert.equal(bad400Report.finalStatus, 'FAIL');
|
|
63
|
+
assert.ok(bad400Report.findings.some((f) => f.code === 'NO_402'), 'must flag 400-instead-of-402');
|
|
64
|
+
const help = await new Promise((resolve) => {
|
|
65
|
+
const child = spawn(process.execPath, [cli, '--help'], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
66
|
+
let stdout = ''; child.stdout.on('data', (chunk) => { stdout += chunk; }); child.on('close', (code) => resolve({ code, stdout }));
|
|
67
|
+
});
|
|
68
|
+
assert.equal(help.code, 0);
|
|
69
|
+
assert.match(help.stdout, /mcpdoctor/);
|
|
70
|
+
console.log('mcpdoctor smoke tests passed');
|
|
71
|
+
} finally {
|
|
72
|
+
server.close();
|
|
73
|
+
}
|