@k08200/mcp-probe 0.8.0 → 1.4.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.
Files changed (49) hide show
  1. package/README.md +267 -13
  2. package/dist/assertions.d.ts +11 -0
  3. package/dist/assertions.d.ts.map +1 -0
  4. package/dist/assertions.js +156 -0
  5. package/dist/assertions.js.map +1 -0
  6. package/dist/checker.d.ts.map +1 -1
  7. package/dist/checker.js +47 -24
  8. package/dist/checker.js.map +1 -1
  9. package/dist/cli.js +76 -3
  10. package/dist/cli.js.map +1 -1
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +21 -0
  13. package/dist/config.js.map +1 -1
  14. package/dist/init.d.ts +22 -0
  15. package/dist/init.d.ts.map +1 -0
  16. package/dist/init.js +141 -0
  17. package/dist/init.js.map +1 -0
  18. package/dist/issues.d.ts +5 -0
  19. package/dist/issues.d.ts.map +1 -0
  20. package/dist/issues.js +126 -0
  21. package/dist/issues.js.map +1 -0
  22. package/dist/protocols/mcp-client.d.ts.map +1 -1
  23. package/dist/protocols/mcp-client.js +57 -27
  24. package/dist/protocols/mcp-client.js.map +1 -1
  25. package/dist/redact.d.ts +3 -0
  26. package/dist/redact.d.ts.map +1 -0
  27. package/dist/redact.js +34 -0
  28. package/dist/redact.js.map +1 -0
  29. package/dist/reporters/github.d.ts.map +1 -1
  30. package/dist/reporters/github.js +15 -9
  31. package/dist/reporters/github.js.map +1 -1
  32. package/dist/reporters/json-reporter.d.ts.map +1 -1
  33. package/dist/reporters/json-reporter.js +2 -1
  34. package/dist/reporters/json-reporter.js.map +1 -1
  35. package/dist/reporters/terminal.d.ts.map +1 -1
  36. package/dist/reporters/terminal.js +18 -5
  37. package/dist/reporters/terminal.js.map +1 -1
  38. package/dist/types.d.ts +32 -3
  39. package/dist/types.d.ts.map +1 -1
  40. package/examples/datadog.tools.json +4 -1
  41. package/examples/mcp-probe.config.json +4 -0
  42. package/examples/recipes/datadog.tools.json +7 -2
  43. package/examples/recipes/gmail.tools.json +6 -2
  44. package/examples/recipes/supabase.tools.json +18 -2
  45. package/examples/self-check.config.json +14 -0
  46. package/examples/self-check.tools.json +37 -0
  47. package/package.json +16 -5
  48. package/schemas/mcp-probe.config.schema.json +74 -0
  49. package/schemas/mcp-probe.sidecar.schema.json +68 -0
package/dist/types.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  export type CheckStatus = 'pass' | 'fail' | 'warn';
2
+ export type IssueCode = 'NO_TOOLS' | 'TOOL_SCHEMA_INVALID' | 'TOOL_CALL_AUTH' | 'TOOL_CALL_FAILED' | 'TOOL_CALL_TIMEOUT' | 'CONTRACT_ASSERTION_FAILED' | 'AUTO_DRY_RUN_INPUT' | 'SIDECAR_MISSING' | 'SIDECAR_INVALID' | 'HANDSHAKE_TIMEOUT' | 'HANDSHAKE_AUTH' | 'HANDSHAKE_FAILED' | 'TARGET_NOT_FOUND';
3
+ export type Issue = {
4
+ code: IssueCode;
5
+ hint: string;
6
+ docsUrl?: string;
7
+ };
2
8
  export type CheckItem = {
3
9
  name: string;
4
10
  status: CheckStatus;
5
11
  message: string;
6
12
  latencyMs?: number;
13
+ issue?: Issue;
7
14
  };
8
15
  export type ToolInfo = {
9
16
  name: string;
@@ -16,12 +23,27 @@ export type ToolCallResult = {
16
23
  latencyMs: number;
17
24
  error?: string;
18
25
  source: 'sidecar' | 'auto';
26
+ assertions?: AssertionResult[];
27
+ issue?: Issue;
28
+ };
29
+ export type ExpectedToolStatus = 'pass' | 'fail' | 'warn';
30
+ export type AssertionResult = {
31
+ name: string;
32
+ status: CheckStatus;
33
+ message: string;
34
+ };
35
+ export type ToolExpectations = {
36
+ status?: ExpectedToolStatus;
37
+ not_error_code?: number[];
38
+ requiredFields?: string[];
39
+ maxRows?: number;
40
+ errorCode?: string;
41
+ contains?: string[];
42
+ notContains?: string[];
19
43
  };
20
44
  export type ToolSidecarEntry = {
21
45
  input: Record<string, unknown>;
22
- expect?: {
23
- not_error_code?: number[];
24
- };
46
+ expect?: ToolExpectations;
25
47
  };
26
48
  export type ToolSidecar = {
27
49
  tools: Record<string, ToolSidecarEntry>;
@@ -32,6 +54,10 @@ export type ServerInfo = {
32
54
  capabilities: string[];
33
55
  };
34
56
  export type TransportMode = 'stdio' | 'http' | 'sse';
57
+ export type StderrRules = {
58
+ allow?: string[];
59
+ fatal?: string[];
60
+ };
35
61
  export type ResolvedTarget = {
36
62
  transport: TransportMode;
37
63
  command?: string;
@@ -56,6 +82,7 @@ export type CheckOptions = {
56
82
  timeoutMs: number;
57
83
  transport?: TransportMode;
58
84
  headers?: Record<string, string>;
85
+ stderr?: StderrRules;
59
86
  probeTools?: boolean;
60
87
  toolsFile?: string;
61
88
  };
@@ -66,6 +93,7 @@ export type ConfigServer = {
66
93
  timeoutMs?: number;
67
94
  transport?: TransportMode;
68
95
  headers?: Record<string, string>;
96
+ stderr?: StderrRules;
69
97
  probeTools?: boolean;
70
98
  toolsFile?: string;
71
99
  };
@@ -110,6 +138,7 @@ export type ProbeOptions = {
110
138
  args?: string[];
111
139
  url?: string;
112
140
  headers?: Record<string, string>;
141
+ stderr?: StderrRules;
113
142
  timeoutMs: number;
114
143
  probeTools?: boolean;
115
144
  sidecar?: ToolSidecar;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AA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,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC"}
@@ -6,7 +6,10 @@
6
6
  "timeframe": "1h"
7
7
  },
8
8
  "expect": {
9
- "not_error_code": [401, 403]
9
+ "status": "pass",
10
+ "not_error_code": [401, 403],
11
+ "requiredFields": ["source", "freshness"],
12
+ "maxRows": 100
10
13
  }
11
14
  }
12
15
  }
@@ -13,6 +13,10 @@
13
13
  "headers": {
14
14
  "Authorization": "Bearer ${DATADOG_MCP_TOKEN}"
15
15
  },
16
+ "stderr": {
17
+ "allow": ["^Warning:", "missing optional config"],
18
+ "fatal": ["panic", "FATAL"]
19
+ },
16
20
  "toolsFile": "./recipes/datadog.tools.json"
17
21
  }
18
22
  ]
@@ -6,7 +6,10 @@
6
6
  "timeframe": "1h"
7
7
  },
8
8
  "expect": {
9
- "not_error_code": [401, 403]
9
+ "status": "pass",
10
+ "not_error_code": [401, 403],
11
+ "requiredFields": ["source", "freshness"],
12
+ "maxRows": 100
10
13
  }
11
14
  },
12
15
  "metrics_query": {
@@ -16,7 +19,9 @@
16
19
  "to": "now"
17
20
  },
18
21
  "expect": {
19
- "not_error_code": [401, 403]
22
+ "status": "pass",
23
+ "not_error_code": [401, 403],
24
+ "requiredFields": ["source", "freshness"]
20
25
  }
21
26
  }
22
27
  }
@@ -5,13 +5,17 @@
5
5
  "query": "newer_than:7d"
6
6
  },
7
7
  "expect": {
8
- "not_error_code": [401, 403]
8
+ "status": "pass",
9
+ "not_error_code": [401, 403],
10
+ "notContains": ["refresh_token", "client_secret"]
9
11
  }
10
12
  },
11
13
  "get_profile": {
12
14
  "input": {},
13
15
  "expect": {
14
- "not_error_code": [401, 403]
16
+ "status": "pass",
17
+ "not_error_code": [401, 403],
18
+ "requiredFields": ["emailAddress"]
15
19
  }
16
20
  }
17
21
  }
@@ -3,7 +3,9 @@
3
3
  "list_projects": {
4
4
  "input": {},
5
5
  "expect": {
6
- "not_error_code": [401, 403]
6
+ "status": "pass",
7
+ "not_error_code": [401, 403],
8
+ "requiredFields": ["project_id"]
7
9
  }
8
10
  },
9
11
  "execute_sql": {
@@ -12,7 +14,21 @@
12
14
  "query": "select 1 as health_check"
13
15
  },
14
16
  "expect": {
15
- "not_error_code": [401, 403]
17
+ "status": "pass",
18
+ "not_error_code": [401, 403],
19
+ "requiredFields": ["rowCount", "limit", "source", "freshness"],
20
+ "maxRows": 100
21
+ }
22
+ },
23
+ "execute_sql_write_denied": {
24
+ "input": {
25
+ "project_id": "YOUR_PROJECT_ID",
26
+ "query": "delete from users where id = 1"
27
+ },
28
+ "expect": {
29
+ "status": "fail",
30
+ "errorCode": "WRITE_NOT_ALLOWED",
31
+ "notContains": ["DATABASE_URL", "password", "stack"]
16
32
  }
17
33
  }
18
34
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "timeoutMs": 10000,
3
+ "servers": [
4
+ {
5
+ "name": "fixture-stdio",
6
+ "target": "./tests/fixtures/stdio-mcp-server.js",
7
+ "toolsFile": "./self-check.tools.json",
8
+ "stderr": {
9
+ "allow": ["^Warning:", "missing optional config"],
10
+ "fatal": ["panic", "FATAL"]
11
+ }
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "tools": {
3
+ "echo": {
4
+ "input": {
5
+ "message": "mcp-probe self-check"
6
+ }
7
+ },
8
+ "auth_check": {
9
+ "input": {
10
+ "query": "errors"
11
+ },
12
+ "expect": {
13
+ "not_error_code": [401]
14
+ }
15
+ },
16
+ "db_query": {
17
+ "input": {
18
+ "sql": "select 1 as ok"
19
+ },
20
+ "expect": {
21
+ "status": "pass",
22
+ "requiredFields": ["rowCount", "limit", "source", "freshness"],
23
+ "maxRows": 100
24
+ }
25
+ },
26
+ "db_write": {
27
+ "input": {
28
+ "sql": "delete from users where id = 1"
29
+ },
30
+ "expect": {
31
+ "status": "fail",
32
+ "errorCode": "WRITE_NOT_ALLOWED",
33
+ "notContains": ["DATABASE_URL", "password", "stack"]
34
+ }
35
+ }
36
+ }
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k08200/mcp-probe",
3
- "version": "0.8.0",
3
+ "version": "1.4.0",
4
4
  "description": "Quality checker for MCP servers — validates protocol handshake, discovery, tool-call dry-runs, and latency",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
- "examples"
11
+ "examples",
12
+ "schemas"
12
13
  ],
13
14
  "scripts": {
14
15
  "build": "tsc",
@@ -22,11 +23,19 @@
22
23
  "keywords": [
23
24
  "mcp",
24
25
  "model-context-protocol",
26
+ "mcp-server",
27
+ "mcp-client",
25
28
  "ai",
29
+ "agent",
30
+ "agentic",
26
31
  "llm",
27
32
  "cli",
33
+ "ci",
34
+ "github-actions",
28
35
  "testing",
29
36
  "validation",
37
+ "readiness",
38
+ "healthcheck",
30
39
  "inspector",
31
40
  "checker"
32
41
  ],
@@ -47,13 +56,15 @@
47
56
  "ora": "^8.1.0"
48
57
  },
49
58
  "devDependencies": {
59
+ "@emnapi/core": "^1.10.0",
60
+ "@emnapi/runtime": "^1.10.0",
50
61
  "@types/node": "^22.0.0",
51
- "@vitest/coverage-v8": "^2.0.0",
62
+ "@vitest/coverage-v8": "^4.1.7",
52
63
  "tsx": "^4.19.0",
53
64
  "typescript": "^5.6.0",
54
- "vitest": "^2.0.0"
65
+ "vitest": "^4.1.7"
55
66
  },
56
67
  "engines": {
57
- "node": ">=18.0.0"
68
+ "node": ">=20.19.0"
58
69
  }
59
70
  }
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/k08200/mcp-probe/main/schemas/mcp-probe.config.schema.json",
4
+ "title": "mcp-probe config",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["servers"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "timeoutMs": {
13
+ "type": "number",
14
+ "minimum": 1,
15
+ "description": "Default timeout in milliseconds."
16
+ },
17
+ "servers": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "items": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["name", "target"],
24
+ "properties": {
25
+ "name": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "target": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "description": "npm package, local file path, or remote MCP URL."
33
+ },
34
+ "serverArgs": {
35
+ "type": "array",
36
+ "items": { "type": "string" }
37
+ },
38
+ "timeoutMs": {
39
+ "type": "number",
40
+ "minimum": 1
41
+ },
42
+ "transport": {
43
+ "enum": ["stdio", "http", "sse"]
44
+ },
45
+ "headers": {
46
+ "type": "object",
47
+ "additionalProperties": { "type": "string" },
48
+ "description": "HTTP headers for remote MCP servers. Supports ${ENV_VAR} interpolation."
49
+ },
50
+ "stderr": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "properties": {
54
+ "allow": {
55
+ "type": "array",
56
+ "items": { "type": "string" }
57
+ },
58
+ "fatal": {
59
+ "type": "array",
60
+ "items": { "type": "string" }
61
+ }
62
+ }
63
+ },
64
+ "probeTools": {
65
+ "type": "boolean"
66
+ },
67
+ "toolsFile": {
68
+ "type": "string"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/k08200/mcp-probe/main/schemas/mcp-probe.sidecar.schema.json",
4
+ "title": "mcp-probe tool sidecar",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["tools"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "tools": {
13
+ "type": "object",
14
+ "minProperties": 1,
15
+ "additionalProperties": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["input"],
19
+ "properties": {
20
+ "input": {
21
+ "type": "object",
22
+ "description": "Sample input passed to tools/call."
23
+ },
24
+ "expect": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "not_error_code": {
29
+ "type": "array",
30
+ "items": { "type": "number" },
31
+ "description": "HTTP/status codes that should be treated as warnings instead of failures."
32
+ },
33
+ "status": {
34
+ "type": "string",
35
+ "enum": ["pass", "fail", "warn"],
36
+ "description": "Expected final status for this tool call. Use fail for negative probes such as denied writes."
37
+ },
38
+ "requiredFields": {
39
+ "type": "array",
40
+ "items": { "type": "string" },
41
+ "description": "Field names that must appear anywhere in the tool result payload."
42
+ },
43
+ "maxRows": {
44
+ "type": "number",
45
+ "minimum": 0,
46
+ "description": "Maximum allowed row count. Uses rowCount, rowsReturned, or common rows/data/items arrays."
47
+ },
48
+ "errorCode": {
49
+ "type": "string",
50
+ "description": "Stable error code expected in an error response."
51
+ },
52
+ "contains": {
53
+ "type": "array",
54
+ "items": { "type": "string" },
55
+ "description": "Text snippets that must appear in the result or error payload."
56
+ },
57
+ "notContains": {
58
+ "type": "array",
59
+ "items": { "type": "string" },
60
+ "description": "Text snippets that must not appear in the result or error payload. Use this to catch leaked internals."
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }