@dotsetlabs/bellwether 2.1.0 → 2.1.2

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 (55) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +48 -31
  3. package/dist/cli/commands/check.js +49 -6
  4. package/dist/cli/commands/dashboard.d.ts +3 -0
  5. package/dist/cli/commands/dashboard.js +69 -0
  6. package/dist/cli/commands/discover.js +24 -2
  7. package/dist/cli/commands/explore.js +49 -6
  8. package/dist/cli/commands/watch.js +12 -1
  9. package/dist/cli/index.js +27 -34
  10. package/dist/cli/utils/headers.d.ts +12 -0
  11. package/dist/cli/utils/headers.js +63 -0
  12. package/dist/config/defaults.d.ts +2 -0
  13. package/dist/config/defaults.js +2 -0
  14. package/dist/config/template.js +12 -0
  15. package/dist/config/validator.d.ts +38 -18
  16. package/dist/config/validator.js +10 -0
  17. package/dist/constants/core.d.ts +4 -2
  18. package/dist/constants/core.js +13 -2
  19. package/dist/dashboard/index.d.ts +3 -0
  20. package/dist/dashboard/index.js +6 -0
  21. package/dist/dashboard/runtime/artifact-index.d.ts +45 -0
  22. package/dist/dashboard/runtime/artifact-index.js +238 -0
  23. package/dist/dashboard/runtime/command-profiles.d.ts +764 -0
  24. package/dist/dashboard/runtime/command-profiles.js +691 -0
  25. package/dist/dashboard/runtime/config-service.d.ts +21 -0
  26. package/dist/dashboard/runtime/config-service.js +73 -0
  27. package/dist/dashboard/runtime/job-runner.d.ts +26 -0
  28. package/dist/dashboard/runtime/job-runner.js +292 -0
  29. package/dist/dashboard/security/input-validation.d.ts +3 -0
  30. package/dist/dashboard/security/input-validation.js +27 -0
  31. package/dist/dashboard/security/localhost-guard.d.ts +5 -0
  32. package/dist/dashboard/security/localhost-guard.js +52 -0
  33. package/dist/dashboard/server.d.ts +14 -0
  34. package/dist/dashboard/server.js +293 -0
  35. package/dist/dashboard/types.d.ts +55 -0
  36. package/dist/dashboard/types.js +2 -0
  37. package/dist/dashboard/ui.d.ts +2 -0
  38. package/dist/dashboard/ui.js +2264 -0
  39. package/dist/discovery/discovery.js +20 -1
  40. package/dist/discovery/types.d.ts +1 -1
  41. package/dist/docs/contract.js +7 -1
  42. package/dist/errors/retry.js +15 -1
  43. package/dist/errors/types.d.ts +10 -0
  44. package/dist/errors/types.js +28 -0
  45. package/dist/logging/logger.js +5 -2
  46. package/dist/transport/env-filter.d.ts +6 -0
  47. package/dist/transport/env-filter.js +76 -0
  48. package/dist/transport/http-transport.js +10 -0
  49. package/dist/transport/mcp-client.d.ts +16 -9
  50. package/dist/transport/mcp-client.js +119 -88
  51. package/dist/transport/sse-transport.js +19 -0
  52. package/dist/version.js +2 -2
  53. package/package.json +5 -15
  54. package/man/bellwether.1 +0 -204
  55. package/man/bellwether.1.md +0 -148
@@ -1,6 +1,7 @@
1
1
  import { BaseTransport } from './base-transport.js';
2
2
  import { TIME_CONSTANTS, TIMEOUTS } from '../constants.js';
3
3
  import { isLocalhost } from '../utils/index.js';
4
+ import { ServerAuthError } from '../errors/types.js';
4
5
  /**
5
6
  * Validate that a URL uses HTTPS in production contexts.
6
7
  * Allows HTTP only for localhost/127.0.0.1 for local development.
@@ -161,6 +162,15 @@ export class SSETransport extends BaseTransport {
161
162
  signal: this.streamAbortController.signal,
162
163
  });
163
164
  if (!response.ok) {
165
+ if (response.status === 401) {
166
+ throw new ServerAuthError('Remote MCP SSE authentication failed (401 Unauthorized)', 401, 'Add server.headers.Authorization (for example: Bearer token) in bellwether.yaml or pass --header.');
167
+ }
168
+ if (response.status === 403) {
169
+ throw new ServerAuthError('Remote MCP SSE authorization failed (403 Forbidden)', 403, 'Credentials are recognized but lack required permissions. Verify token scopes/roles.');
170
+ }
171
+ if (response.status === 407) {
172
+ throw new ServerAuthError('Proxy authentication required (407)', 407, 'Configure proxy credentials and retry.');
173
+ }
164
174
  throw new Error(`Failed to connect to SSE endpoint: HTTP ${response.status}`);
165
175
  }
166
176
  if (!response.body) {
@@ -334,6 +344,15 @@ export class SSETransport extends BaseTransport {
334
344
  .then(async (response) => {
335
345
  clearTimeout(timeoutId);
336
346
  if (!response.ok) {
347
+ if (response.status === 401) {
348
+ throw new ServerAuthError('Remote MCP message authentication failed (401 Unauthorized)', 401, 'Add server.headers.Authorization (for example: Bearer token) in bellwether.yaml or pass --header.');
349
+ }
350
+ if (response.status === 403) {
351
+ throw new ServerAuthError('Remote MCP message authorization failed (403 Forbidden)', 403, 'Credentials are recognized but lack required permissions. Verify token scopes/roles.');
352
+ }
353
+ if (response.status === 407) {
354
+ throw new ServerAuthError('Proxy authentication required (407)', 407, 'Configure proxy credentials and retry.');
355
+ }
337
356
  const errorText = await response.text().catch(() => 'Unknown error');
338
357
  throw new Error(`HTTP ${response.status}: ${errorText}`);
339
358
  }
package/dist/version.js CHANGED
@@ -29,8 +29,8 @@ function getPackageVersion() {
29
29
  return packageJson.version;
30
30
  }
31
31
  catch {
32
- // Fallback version - should match package.json
33
- return '2.1.0';
32
+ // Final fallback to avoid hardcoded release drift.
33
+ return process.env.BELLWETHER_VERSION || '0.0.0';
34
34
  }
35
35
  }
36
36
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotsetlabs/bellwether",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "The open-source MCP testing tool. Structural drift detection and behavioral documentation for Model Context Protocol servers.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsc",
26
- "postbuild": "chmod +x dist/cli/index.js",
26
+ "postbuild": "node ./scripts/postbuild.mjs",
27
27
  "dev": "tsc --watch",
28
28
  "test": "vitest run",
29
29
  "test:watch": "vitest",
@@ -32,12 +32,11 @@
32
32
  "lint:fix": "eslint src --ext .ts --fix",
33
33
  "format": "prettier --write \"src/**/*.ts\"",
34
34
  "format:check": "prettier --check \"src/**/*.ts\"",
35
+ "check:consistency": "node ./scripts/validate-consistency.mjs",
35
36
  "clean": "rm -rf dist",
36
37
  "docs:generate": "npm --prefix website run build",
37
38
  "docs:dev": "npm --prefix website run start",
38
- "man:generate": "./scripts/generate-manpage.sh",
39
- "prepare": "husky install || true",
40
- "prepublishOnly": "npm run build && npm run man:generate"
39
+ "prepublishOnly": "npm run build"
41
40
  },
42
41
  "keywords": [
43
42
  "mcp",
@@ -74,7 +73,7 @@
74
73
  "node": ">=20.0.0"
75
74
  },
76
75
  "dependencies": {
77
- "@anthropic-ai/sdk": "^0.72.1",
76
+ "@anthropic-ai/sdk": "^0.74.0",
78
77
  "ajv": "^8.17.1",
79
78
  "chalk": "^5.4.1",
80
79
  "cli-progress": "^3.12.0",
@@ -97,25 +96,16 @@
97
96
  "@typescript-eslint/parser": "^6.21.0",
98
97
  "@vitest/coverage-v8": "^4.0.18",
99
98
  "eslint": "^8.57.1",
100
- "husky": "^9.1.0",
101
- "lint-staged": "^16.2.7",
102
99
  "prettier": "^3.3.0",
103
100
  "tsx": "^4.21.0",
104
101
  "typescript": "^5.3.0",
105
102
  "vitest": "^4.0.17"
106
103
  },
107
- "lint-staged": {
108
- "*.ts": [
109
- "eslint --fix",
110
- "prettier --write"
111
- ]
112
- },
113
104
  "files": [
114
105
  "dist",
115
106
  "!dist/**/*.map",
116
107
  "schemas",
117
108
  "scripts/completions",
118
- "man",
119
109
  "README.md",
120
110
  "LICENSE",
121
111
  "CHANGELOG.md",
package/man/bellwether.1 DELETED
@@ -1,204 +0,0 @@
1
- .TH "BELLWETHER" "1" "2026\-02\-11" "Bellwether 2.1.0" "User Commands"
2
- .SH NAME
3
- .PP
4
- bellwether \[em] MCP server testing and validation tool
5
- .SH SYNOPSIS
6
- .PP
7
- \f[B]bellwether\f[] [OPTIONS] COMMAND [ARGS...]
8
- .PP
9
- \f[B]bellwether\f[] \f[B]\-\-version\f[]
10
- .PP
11
- \f[B]bellwether\f[] \f[B]\-\-help\f[]
12
- .SH DESCRIPTION
13
- .PP
14
- Bellwether is an open\-source MCP (Model Context Protocol) testing tool
15
- that provides structural drift detection and behavioral documentation
16
- for MCP servers.
17
- .SH COMMANDS
18
- .TP
19
- .B \f[B]check\f[] [\f[I]options\f[]] [server\-command]
20
- Schema validation and drift detection (free, fast, deterministic)
21
- .RS
22
- .RE
23
- .TP
24
- .B \f[B]explore\f[] [\f[I]options\f[]] [server\-command]
25
- LLM\-powered behavioral exploration and documentation
26
- .RS
27
- .RE
28
- .TP
29
- .B \f[B]discover\f[] [\f[I]options\f[]] [server\-command]
30
- Discover MCP server capabilities (tools, prompts, resources)
31
- .RS
32
- .RE
33
- .TP
34
- .B \f[B]watch\f[] [\f[I]options\f[]]
35
- Watch for MCP server changes and auto\-check
36
- .RS
37
- .RE
38
- .TP
39
- .B \f[B]init\f[] [\f[I]options\f[]] [server\-command]
40
- Initialize a bellwether.yaml configuration file
41
- .RS
42
- .RE
43
- .TP
44
- .B \f[B]auth\f[] \f[I]subcommand\f[] [\f[I]options\f[]]
45
- Manage LLM provider API keys
46
- .RS
47
- .RE
48
- .TP
49
- .B \f[B]baseline\f[] \f[I]subcommand\f[] [\f[I]options\f[]]
50
- Manage baselines for drift detection
51
- .RS
52
- .RE
53
- .TP
54
- .B \f[B]golden\f[] \f[I]subcommand\f[] [\f[I]options\f[]]
55
- Manage golden outputs for validation
56
- .RS
57
- .RE
58
- .TP
59
- .B \f[B]registry\f[] [\f[I]options\f[]] \f[I]search\f[]
60
- Search the MCP Registry for servers
61
- .RS
62
- .RE
63
- .TP
64
- .B \f[B]contract\f[] \f[I]subcommand\f[] [\f[I]options\f[]]
65
- Validate MCP servers against contracts
66
- .RS
67
- .RE
68
- .TP
69
- .B \f[B]validate\-config\f[] [\f[I]options\f[]]
70
- Validate bellwether.yaml configuration
71
- .RS
72
- .RE
73
- .SH GLOBAL OPTIONS
74
- .TP
75
- .B \f[B]\-h\f[], \f[B]\-\-help\f[]
76
- Show help message and exit
77
- .RS
78
- .RE
79
- .TP
80
- .B \f[B]\-\-version\f[]
81
- Show version information and exit
82
- .RS
83
- .RE
84
- .TP
85
- .B \f[B]\-\-log\-level\f[] \f[I]LEVEL\f[]
86
- Set log level: debug, info, warn, error, silent
87
- .RS
88
- .RE
89
- .TP
90
- .B \f[B]\-\-log\-file\f[] \f[I]PATH\f[]
91
- Write logs to file instead of stderr
92
- .RS
93
- .RE
94
- .SH EXAMPLES
95
- .PP
96
- Initialize configuration:
97
- .IP
98
- .nf
99
- \f[C]
100
- bellwether\ init\ npx\ \@modelcontextprotocol/server\-filesystem
101
- \f[]
102
- .fi
103
- .PP
104
- Run drift detection:
105
- .IP
106
- .nf
107
- \f[C]
108
- bellwether\ check
109
- \f[]
110
- .fi
111
- .PP
112
- Save baseline:
113
- .IP
114
- .nf
115
- \f[C]
116
- bellwether\ baseline\ save
117
- \f[]
118
- .fi
119
- .PP
120
- Explore with LLM:
121
- .IP
122
- .nf
123
- \f[C]
124
- bellwether\ explore
125
- \f[]
126
- .fi
127
- .SH FILES
128
- .TP
129
- .B \f[I]bellwether.yaml\f[]
130
- Configuration file for the project
131
- .RS
132
- .RE
133
- .TP
134
- .B \f[I]bellwether\-baseline.json\f[]
135
- Saved baseline for drift detection
136
- .RS
137
- .RE
138
- .TP
139
- .B \f[I]CONTRACT.md\f[]
140
- Generated contract documentation
141
- .RS
142
- .RE
143
- .TP
144
- .B \f[I]AGENTS.md\f[]
145
- Generated behavioral documentation
146
- .RS
147
- .RE
148
- .SH ENVIRONMENT
149
- .TP
150
- .B \f[I]OPENAI_API_KEY\f[]
151
- API key for OpenAI (explore mode only)
152
- .RS
153
- .RE
154
- .TP
155
- .B \f[I]ANTHROPIC_API_KEY\f[]
156
- API key for Anthropic (explore mode only)
157
- .RS
158
- .RE
159
- .TP
160
- .B \f[I]OLLAMA_BASE_URL\f[]
161
- Ollama URL (default: http://localhost:11434)
162
- .RS
163
- .RE
164
- .SH EXIT STATUS
165
- .TP
166
- .B \f[B]0\f[]
167
- Success, no changes detected
168
- .RS
169
- .RE
170
- .TP
171
- .B \f[B]1\f[]
172
- Info\-level changes only
173
- .RS
174
- .RE
175
- .TP
176
- .B \f[B]2\f[]
177
- Warning\-level changes
178
- .RS
179
- .RE
180
- .TP
181
- .B \f[B]3\f[]
182
- Breaking changes detected
183
- .RS
184
- .RE
185
- .TP
186
- .B \f[B]4\f[]
187
- Runtime error
188
- .RS
189
- .RE
190
- .TP
191
- .B \f[B]5\f[]
192
- Low confidence metrics
193
- .RS
194
- .RE
195
- .SH SEE ALSO
196
- .PP
197
- Project homepage: <https://github.com/dotsetlabs/bellwether>
198
- .PP
199
- Documentation: <https://docs.bellwether.sh>
200
- .PP
201
- MCP Specification: <https://modelcontextprotocol.io>
202
- .SH AUTHORS
203
- .PP
204
- Dotset Labs LLC <hello@dotsetlabs.com>
@@ -1,148 +0,0 @@
1
- ---
2
- title: BELLWETHER
3
- section: 1
4
- header: User Commands
5
- footer: Bellwether 2.1.0
6
- date: 2026-02-11
7
- ---
8
-
9
- # NAME
10
-
11
- bellwether — MCP server testing and validation tool
12
-
13
- # SYNOPSIS
14
-
15
- **bellwether** [OPTIONS] COMMAND [ARGS...]
16
-
17
- **bellwether** **--version**
18
-
19
- **bellwether** **--help**
20
-
21
- # DESCRIPTION
22
-
23
- Bellwether is an open-source MCP (Model Context Protocol) testing tool that provides
24
- structural drift detection and behavioral documentation for MCP servers.
25
-
26
- # COMMANDS
27
-
28
- **check** [*options*] [server-command]
29
- : Schema validation and drift detection (free, fast, deterministic)
30
-
31
- **explore** [*options*] [server-command]
32
- : LLM-powered behavioral exploration and documentation
33
-
34
- **discover** [*options*] [server-command]
35
- : Discover MCP server capabilities (tools, prompts, resources)
36
-
37
- **watch** [*options*]
38
- : Watch for MCP server changes and auto-check
39
-
40
- **init** [*options*] [server-command]
41
- : Initialize a bellwether.yaml configuration file
42
-
43
- **auth** *subcommand* [*options*]
44
- : Manage LLM provider API keys
45
-
46
- **baseline** *subcommand* [*options*]
47
- : Manage baselines for drift detection
48
-
49
- **golden** *subcommand* [*options*]
50
- : Manage golden outputs for validation
51
-
52
- **registry** [*options*] *search*
53
- : Search the MCP Registry for servers
54
-
55
- **contract** *subcommand* [*options*]
56
- : Validate MCP servers against contracts
57
-
58
- **validate-config** [*options*]
59
- : Validate bellwether.yaml configuration
60
-
61
- # GLOBAL OPTIONS
62
-
63
- **-h**, **--help**
64
- : Show help message and exit
65
-
66
- **--version**
67
- : Show version information and exit
68
-
69
- **--log-level** *LEVEL*
70
- : Set log level: debug, info, warn, error, silent
71
-
72
- **--log-file** *PATH*
73
- : Write logs to file instead of stderr
74
-
75
- # EXAMPLES
76
-
77
- Initialize configuration:
78
-
79
- bellwether init npx @modelcontextprotocol/server-filesystem
80
-
81
- Run drift detection:
82
-
83
- bellwether check
84
-
85
- Save baseline:
86
-
87
- bellwether baseline save
88
-
89
- Explore with LLM:
90
-
91
- bellwether explore
92
-
93
- # FILES
94
-
95
- *bellwether.yaml*
96
- : Configuration file for the project
97
-
98
- *bellwether-baseline.json*
99
- : Saved baseline for drift detection
100
-
101
- *CONTRACT.md*
102
- : Generated contract documentation
103
-
104
- *AGENTS.md*
105
- : Generated behavioral documentation
106
-
107
- # ENVIRONMENT
108
-
109
- *OPENAI_API_KEY*
110
- : API key for OpenAI (explore mode only)
111
-
112
- *ANTHROPIC_API_KEY*
113
- : API key for Anthropic (explore mode only)
114
-
115
- *OLLAMA_BASE_URL*
116
- : Ollama URL (default: http://localhost:11434)
117
-
118
- # EXIT STATUS
119
-
120
- **0**
121
- : Success, no changes detected
122
-
123
- **1**
124
- : Info-level changes only
125
-
126
- **2**
127
- : Warning-level changes
128
-
129
- **3**
130
- : Breaking changes detected
131
-
132
- **4**
133
- : Runtime error
134
-
135
- **5**
136
- : Low confidence metrics
137
-
138
- # SEE ALSO
139
-
140
- Project homepage: <https://github.com/dotsetlabs/bellwether>
141
-
142
- Documentation: <https://docs.bellwether.sh>
143
-
144
- MCP Specification: <https://modelcontextprotocol.io>
145
-
146
- # AUTHORS
147
-
148
- Dotset Labs LLC <hello@dotsetlabs.com>