@beeeeen/mcp-probe 0.1.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/LICENSE +21 -0
- package/README.md +234 -0
- package/dist/checks/hygiene.d.ts +17 -0
- package/dist/checks/hygiene.js +104 -0
- package/dist/checks/index.d.ts +16 -0
- package/dist/checks/index.js +24 -0
- package/dist/checks/protocol.d.ts +15 -0
- package/dist/checks/protocol.js +225 -0
- package/dist/checks/robustness.d.ts +17 -0
- package/dist/checks/robustness.js +240 -0
- package/dist/checks/schema.d.ts +12 -0
- package/dist/checks/schema.js +224 -0
- package/dist/checks/util.d.ts +7 -0
- package/dist/checks/util.js +23 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +292 -0
- package/dist/client/http.d.ts +37 -0
- package/dist/client/http.js +133 -0
- package/dist/client/index.d.ts +47 -0
- package/dist/client/index.js +79 -0
- package/dist/client/jsonrpc.d.ts +40 -0
- package/dist/client/jsonrpc.js +28 -0
- package/dist/client/stdio.d.ts +55 -0
- package/dist/client/stdio.js +213 -0
- package/dist/client/transport.d.ts +21 -0
- package/dist/client/transport.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +5 -0
- package/dist/report/junit.d.ts +7 -0
- package/dist/report/junit.js +60 -0
- package/dist/report/terminal.d.ts +6 -0
- package/dist/report/terminal.js +101 -0
- package/dist/run.d.ts +23 -0
- package/dist/run.js +155 -0
- package/dist/types.d.ts +98 -0
- package/dist/types.js +1 -0
- package/package.json +65 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/** Outcome of a single check. */
|
|
2
|
+
export type Status = 'pass' | 'fail' | 'warn' | 'skip';
|
|
3
|
+
/**
|
|
4
|
+
* How much a failure matters.
|
|
5
|
+
* - `error` the server is out of spec or will break agents; fails CI by default
|
|
6
|
+
* - `warn` legal but harmful in practice (vague descriptions, huge payloads)
|
|
7
|
+
* - `info` advisory only, never fails CI
|
|
8
|
+
*/
|
|
9
|
+
export type Severity = 'error' | 'warn' | 'info';
|
|
10
|
+
export interface CheckResult {
|
|
11
|
+
/** Stable dotted id, e.g. `protocol.handshake`. Used for --skip / --only. */
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
status: Status;
|
|
15
|
+
severity: Severity;
|
|
16
|
+
/** One line, shown inline in the terminal report. */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Multi-line evidence: the offending payload, a diff, a stack. */
|
|
19
|
+
detail?: string;
|
|
20
|
+
/** Tool/resource/prompt this result is about, when it is scoped to one. */
|
|
21
|
+
target?: string;
|
|
22
|
+
/** Spec anchor so the user can check we are not making things up. */
|
|
23
|
+
spec?: string;
|
|
24
|
+
/** Wall-clock duration in ms, when meaningful. */
|
|
25
|
+
ms?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface CheckContext {
|
|
28
|
+
client: import('./client/index.js').McpClient;
|
|
29
|
+
/** Populated after the handshake so later checks do not re-list. */
|
|
30
|
+
tools: ToolDef[];
|
|
31
|
+
resources: unknown[];
|
|
32
|
+
prompts: unknown[];
|
|
33
|
+
serverInfo: {
|
|
34
|
+
name?: string;
|
|
35
|
+
version?: string;
|
|
36
|
+
} | null;
|
|
37
|
+
capabilities: Record<string, unknown>;
|
|
38
|
+
protocolVersion: string | null;
|
|
39
|
+
options: RunOptions;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolDef {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
inputSchema?: JsonSchema;
|
|
45
|
+
outputSchema?: JsonSchema;
|
|
46
|
+
annotations?: Record<string, unknown>;
|
|
47
|
+
title?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface JsonSchema {
|
|
50
|
+
type?: string | string[];
|
|
51
|
+
properties?: Record<string, JsonSchema>;
|
|
52
|
+
required?: string[];
|
|
53
|
+
items?: JsonSchema | JsonSchema[];
|
|
54
|
+
enum?: unknown[];
|
|
55
|
+
const?: unknown;
|
|
56
|
+
description?: string;
|
|
57
|
+
additionalProperties?: boolean | JsonSchema;
|
|
58
|
+
[k: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
export interface RunOptions {
|
|
61
|
+
/** Per-request timeout. */
|
|
62
|
+
timeoutMs: number;
|
|
63
|
+
/** Actually invoke tools (mutating!). Off by default. */
|
|
64
|
+
callTools: boolean;
|
|
65
|
+
/** Tool names that are safe to invoke; implies callTools for those only. */
|
|
66
|
+
safeTools: string[];
|
|
67
|
+
only?: string[];
|
|
68
|
+
skip?: string[];
|
|
69
|
+
/** Treat warnings as failures for the exit code. */
|
|
70
|
+
strict: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface Check {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
severity: Severity;
|
|
76
|
+
spec?: string;
|
|
77
|
+
/** A check may emit several results (e.g. one per tool). */
|
|
78
|
+
run(ctx: CheckContext): Promise<CheckResult[]> | CheckResult[];
|
|
79
|
+
}
|
|
80
|
+
export interface RunReport {
|
|
81
|
+
server: {
|
|
82
|
+
name?: string;
|
|
83
|
+
version?: string;
|
|
84
|
+
protocolVersion?: string | null;
|
|
85
|
+
target: string;
|
|
86
|
+
};
|
|
87
|
+
results: CheckResult[];
|
|
88
|
+
summary: {
|
|
89
|
+
pass: number;
|
|
90
|
+
fail: number;
|
|
91
|
+
warn: number;
|
|
92
|
+
skip: number;
|
|
93
|
+
};
|
|
94
|
+
durationMs: number;
|
|
95
|
+
/** Non-JSON bytes the server wrote to stdout. The classic stdio killer. */
|
|
96
|
+
stdoutNoise: string[];
|
|
97
|
+
stderr: string[];
|
|
98
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@beeeeen/mcp-probe",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Conformance and robustness test suite for Model Context Protocol (MCP) servers. Runs in CI, zero dependencies. Catches stdout pollution, broken tool schemas, and bad JSON-RPC error handling before your agent does.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"mcp-server",
|
|
9
|
+
"mcp-test",
|
|
10
|
+
"mcp-testing",
|
|
11
|
+
"mcp-lint",
|
|
12
|
+
"mcp-validator",
|
|
13
|
+
"conformance",
|
|
14
|
+
"testing",
|
|
15
|
+
"ci",
|
|
16
|
+
"json-rpc",
|
|
17
|
+
"claude",
|
|
18
|
+
"anthropic",
|
|
19
|
+
"agent",
|
|
20
|
+
"llm",
|
|
21
|
+
"tools"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"bin": {
|
|
26
|
+
"mcp-probe": "dist/cli.js"
|
|
27
|
+
},
|
|
28
|
+
"main": "dist/index.js",
|
|
29
|
+
"types": "dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"test": "npm run build && node --test",
|
|
47
|
+
"prepublishOnly": "npm run build"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.10.0",
|
|
51
|
+
"typescript": "^5.7.0"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/Beeeeen/mcp-probe.git"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/Beeeeen/mcp-probe#readme",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/Beeeeen/mcp-probe/issues"
|
|
60
|
+
},
|
|
61
|
+
"author": "Ben Yang <ben@yangjiawei.com>",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
65
|
+
}
|