@error-bar/mcp 0.3.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 +202 -0
- package/README.md +155 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +58 -0
- package/dist/client.d.ts +38 -0
- package/dist/client.js +62 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/manifest-types.d.ts +32 -0
- package/dist/manifest-types.js +1 -0
- package/dist/manifest.d.ts +2 -0
- package/dist/manifest.js +2042 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +135 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# @error-bar/mcp
|
|
2
|
+
|
|
3
|
+
The errorbar platform as MCP tools — every public API operation (evals, judges/criteria, gates, logs, datasets, aliases, label sets, audit/proving, dedicated endpoints, training) callable from Claude Code, Claude Desktop, Cursor, or any MCP client.
|
|
4
|
+
|
|
5
|
+
One tool per API operation, 76 tools, generated from the platform's route contracts. Inputs are validated with the same field names and casing the REST API accepts; responses come back exactly as the API returned them (JSON pretty-printed, exports as text), including the API's own error status and message.
|
|
6
|
+
|
|
7
|
+
> Renamed from `@omnia-voice/mcp` (2026-08-30). The old name is published as a shim that forwards here; update your config when convenient.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y @error-bar/mcp # or: npm i -g @error-bar/mcp && errorbar-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Needs `ERRORBAR_API_KEY` (a workspace API key, `sk_…`, from **Settings → API keys**). Give the key only the scopes the agent should have — `read` for a monitoring agent, `read` + `evals:write` for one that runs evals — the platform enforces them and each tool's description says which scope it needs.
|
|
16
|
+
|
|
17
|
+
### Claude Code
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
claude mcp add errorbar -e ERRORBAR_API_KEY=sk_… -- npx -y @error-bar/mcp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Claude Desktop / Cursor / any `mcpServers` config
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"errorbar": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["-y", "@error-bar/mcp"],
|
|
31
|
+
"env": { "ERRORBAR_API_KEY": "sk_…" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Flags
|
|
38
|
+
|
|
39
|
+
| Flag | Effect |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `--read-only` (or `ERRORBAR_MCP_READ_ONLY=1`) | expose only `GET` tools |
|
|
42
|
+
| `--no-spend` (or `ERRORBAR_MCP_NO_SPEND=1`) | hide tools that start billable work (eval runs, training, dedicated capacity, judge assists) |
|
|
43
|
+
| `--only list_evals,get_eval` | expose just these tools |
|
|
44
|
+
| `--base-url URL` (or `ERRORBAR_BASE_URL`) | API root, default `https://gateway.errorbar.ai` |
|
|
45
|
+
|
|
46
|
+
The `OMNIA_*` spellings of every environment variable are still accepted.
|
|
47
|
+
|
|
48
|
+
Tools that spend wallet credit say **SPENDS MONEY** in their description and are not `readOnlyHint`; MCP clients that confirm before non-read-only calls will ask for those.
|
|
49
|
+
|
|
50
|
+
## Tools
|
|
51
|
+
|
|
52
|
+
| Tool | Operation | Scope |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `list_alerts` | `GET /v1/alerts` | read |
|
|
55
|
+
| `list_aliases` | `GET /v1/aliases` | read |
|
|
56
|
+
| `upsert_alias` | `PUT /v1/aliases` | aliases:write |
|
|
57
|
+
| `delete_alias` | `DELETE /v1/aliases/{id}` | aliases:write |
|
|
58
|
+
| `export_audit_log` | `GET /v1/audit/export` | read |
|
|
59
|
+
| `list_audit_tombstones` | `GET /v1/audit/tombstones` | read |
|
|
60
|
+
| `create_audit_tombstone` | `POST /v1/audit/tombstones` | platform:write |
|
|
61
|
+
| `get_audit_verification` | `GET /v1/audit/verify` | read |
|
|
62
|
+
| `list_batches` | `GET /v1/batches` | read |
|
|
63
|
+
| `create_batch` | `POST /v1/batches` | platform:write · **spends** |
|
|
64
|
+
| `get_batch` | `GET /v1/batches/{id}` | read |
|
|
65
|
+
| `cancel_batch` | `POST /v1/batches/{id}/cancel` | platform:write |
|
|
66
|
+
| `list_criteria` | `GET /v1/criteria` | read |
|
|
67
|
+
| `create_criterion` | `POST /v1/criteria` | evals:write |
|
|
68
|
+
| `suggest_criteria` | `POST /v1/criteria/suggest` | evals:write · **spends** |
|
|
69
|
+
| `list_criterion_templates` | `GET /v1/criteria/templates` | read |
|
|
70
|
+
| `get_criterion` | `GET /v1/criteria/{id}` | read |
|
|
71
|
+
| `update_criterion` | `PATCH /v1/criteria/{id}` | evals:write |
|
|
72
|
+
| `delete_criterion` | `DELETE /v1/criteria/{id}` | evals:write |
|
|
73
|
+
| `run_criterion_alignment` | `POST /v1/criteria/{id}/align` | evals:write · **spends** |
|
|
74
|
+
| `get_criterion_alignment` | `GET /v1/criteria/{id}/alignment` | read |
|
|
75
|
+
| `auto_improve_criterion` | `POST /v1/criteria/{id}/auto_improve` | evals:write · **spends** |
|
|
76
|
+
| `get_criterion_certificate` | `GET /v1/criteria/{id}/certificate` | read |
|
|
77
|
+
| `scan_criterion_suspects` | `POST /v1/criteria/{id}/scan` | evals:write · **spends** |
|
|
78
|
+
| `decontaminate_texts` | `POST /v1/datasets/decontaminate` | evals:write |
|
|
79
|
+
| `create_dataset_from_logs` | `POST /v1/datasets/from_logs` | evals:write |
|
|
80
|
+
| `list_dedicated_endpoints` | `GET /v1/dedicated` | read |
|
|
81
|
+
| `create_dedicated_endpoint` | `POST /v1/dedicated` | platform:write · **spends** |
|
|
82
|
+
| `list_dedicated_templates` | `GET /v1/dedicated/templates` | read |
|
|
83
|
+
| `get_dedicated_endpoint` | `GET /v1/dedicated/{id}` | read |
|
|
84
|
+
| `update_dedicated_endpoint` | `PATCH /v1/dedicated/{id}` | platform:write · **spends** |
|
|
85
|
+
| `delete_dedicated_endpoint` | `DELETE /v1/dedicated/{id}` | platform:write |
|
|
86
|
+
| `list_refusals` | `GET /v1/enforcement/refusals` | read |
|
|
87
|
+
| `list_env_tools` | `GET /v1/env/tools` | read |
|
|
88
|
+
| `register_env_tool` | `POST /v1/env/tools` | platform:write |
|
|
89
|
+
| `delete_env_tool` | `DELETE /v1/env/tools/{id}` | platform:write |
|
|
90
|
+
| `list_evals` | `GET /v1/evals` | read |
|
|
91
|
+
| `create_eval` | `POST /v1/evals` | evals:write · **spends** |
|
|
92
|
+
| `compare_evals` | `GET /v1/evals/compare` | read |
|
|
93
|
+
| `get_failure_clusters` | `GET /v1/evals/failure_clusters` | read |
|
|
94
|
+
| `get_eval` | `GET /v1/evals/{id}` | read |
|
|
95
|
+
| `delete_eval` | `DELETE /v1/evals/{id}` | evals:write |
|
|
96
|
+
| `cancel_eval` | `POST /v1/evals/{id}/cancel` | evals:write |
|
|
97
|
+
| `get_eval_evidence` | `GET /v1/evals/{id}/evidence` | read |
|
|
98
|
+
| `get_eval_gate` | `GET /v1/evals/{id}/gate` | read |
|
|
99
|
+
| `get_eval_samples` | `GET /v1/evals/{id}/samples` | read |
|
|
100
|
+
| `list_training_files` | `GET /v1/fine_tuning/files` | read |
|
|
101
|
+
| `upload_training_file` | `POST /v1/fine_tuning/files` | platform:write |
|
|
102
|
+
| `list_fine_tuning_jobs` | `GET /v1/fine_tuning/jobs` | read |
|
|
103
|
+
| `create_fine_tuning_job` | `POST /v1/fine_tuning/jobs` | platform:write · **spends** |
|
|
104
|
+
| `get_fine_tuning_job` | `GET /v1/fine_tuning/jobs/{id}` | read |
|
|
105
|
+
| `cancel_fine_tuning_job` | `DELETE /v1/fine_tuning/jobs/{id}` | platform:write |
|
|
106
|
+
| `get_fine_tuning_bakeoff` | `GET /v1/fine_tuning/jobs/{id}/bakeoff` | read |
|
|
107
|
+
| `start_fine_tuning_bakeoff` | `POST /v1/fine_tuning/jobs/{id}/bakeoff` | platform:write · **spends** |
|
|
108
|
+
| `list_grpo_runs` | `GET /v1/grpo/runs` | read |
|
|
109
|
+
| `start_grpo_run` | `POST /v1/grpo/runs` | platform:write · **spends** |
|
|
110
|
+
| `get_grpo_run` | `GET /v1/grpo/runs/{id}` | read |
|
|
111
|
+
| `stop_grpo_run` | `POST /v1/grpo/runs/{id}/stop` | platform:write |
|
|
112
|
+
| `get_grpo_run_weights` | `GET /v1/grpo/runs/{id}/weights` | read |
|
|
113
|
+
| `list_label_sets` | `GET /v1/label_sets` | read |
|
|
114
|
+
| `create_label_set` | `POST /v1/label_sets` | evals:write |
|
|
115
|
+
| `attach_label_set` | `POST /v1/label_sets/{id}/attach` | evals:write |
|
|
116
|
+
| `freeze_label_set` | `POST /v1/label_sets/{id}/freeze` | evals:write |
|
|
117
|
+
| `list_labels` | `GET /v1/labels` | read |
|
|
118
|
+
| `create_label` | `POST /v1/labels` | evals:write |
|
|
119
|
+
| `list_logs` | `GET /v1/logs` | read |
|
|
120
|
+
| `export_logs` | `GET /v1/logs/export` | read |
|
|
121
|
+
| `list_model_versions` | `GET /v1/model_versions` | read |
|
|
122
|
+
| `get_model_version` | `GET /v1/model_versions/{id}` | read |
|
|
123
|
+
| `adopt_model_version` | `POST /v1/model_versions/{id}/adopt` | platform:write |
|
|
124
|
+
| `list_raft_rounds` | `GET /v1/raft/rounds` | read |
|
|
125
|
+
| `get_judge_settings` | `GET /v1/settings/judge` | read |
|
|
126
|
+
| `set_judge_settings` | `PUT /v1/settings/judge` | platform:write |
|
|
127
|
+
| `get_setup_status` | `GET /v1/setup/status` | read |
|
|
128
|
+
| `get_trace` | `GET /v1/traces/{traceId}` | read |
|
|
129
|
+
| `verify_document` | `POST /v1/verify` | read |
|
|
130
|
+
|
|
131
|
+
Each tool's description carries the full contract: every query and body field, what the response contains, and the gotchas (feature flags, 400 conditions, cursor semantics).
|
|
132
|
+
|
|
133
|
+
## Programmatic use
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import { createServer, ErrorbarClient } from "@error-bar/mcp";
|
|
137
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
138
|
+
|
|
139
|
+
const server = createServer({ client: new ErrorbarClient({ apiKey: process.env.ERRORBAR_API_KEY! }), readOnly: true });
|
|
140
|
+
await server.connect(new StdioServerTransport());
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm ci && npm run typecheck && npm test && npm run build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`src/manifest.ts` is generated from the platform's `app/api/v1` routes; `test/manifest.test.ts` pins the exact route inventory it must cover, so a new platform route fails this suite until the manifest is regenerated.
|
|
150
|
+
|
|
151
|
+
## Release
|
|
152
|
+
|
|
153
|
+
Tag `vX.Y.Z` here, then run the `publish-mcp` workflow in [omnia-tracing](https://github.com/omnia-v/omnia-tracing/actions/workflows/publish-mcp.yml) with that tag (`dir: .` publishes `@error-bar/mcp`; run it again with `dir: legacy` to publish the `@omnia-voice/mcp` forwarding shim) — the npm token lives there.
|
|
154
|
+
|
|
155
|
+
License: Apache-2.0
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { OmniaClient, DEFAULT_BASE_URL } from "./client.js";
|
|
5
|
+
import { createServer } from "./server.js";
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const { version } = require("../package.json");
|
|
8
|
+
function flag(name) {
|
|
9
|
+
return process.argv.includes(`--${name}`);
|
|
10
|
+
}
|
|
11
|
+
function option(name) {
|
|
12
|
+
const i = process.argv.indexOf(`--${name}`);
|
|
13
|
+
if (i >= 0 && process.argv[i + 1] && !process.argv[i + 1].startsWith("--"))
|
|
14
|
+
return process.argv[i + 1];
|
|
15
|
+
const eq = process.argv.find((a) => a.startsWith(`--${name}=`));
|
|
16
|
+
return eq ? eq.slice(name.length + 3) : undefined;
|
|
17
|
+
}
|
|
18
|
+
/** ERRORBAR_<name> first; the pre-rename OMNIA_<name> still works. */
|
|
19
|
+
function env(name) {
|
|
20
|
+
return process.env[`ERRORBAR_${name}`] ?? process.env[`OMNIA_${name}`];
|
|
21
|
+
}
|
|
22
|
+
if (flag("help") || flag("h")) {
|
|
23
|
+
process.stdout.write(`errorbar MCP server v${version}
|
|
24
|
+
|
|
25
|
+
Usage: errorbar-mcp [--read-only] [--no-spend] [--only a,b,c] [--base-url URL]
|
|
26
|
+
|
|
27
|
+
Environment:
|
|
28
|
+
ERRORBAR_API_KEY (required) workspace API key, starts with sk_
|
|
29
|
+
ERRORBAR_BASE_URL API root, default ${DEFAULT_BASE_URL}
|
|
30
|
+
(the OMNIA_* spellings of these are still accepted)
|
|
31
|
+
|
|
32
|
+
Flags:
|
|
33
|
+
--read-only expose only GET tools (or ERRORBAR_MCP_READ_ONLY=1)
|
|
34
|
+
--no-spend hide tools that start billable work — eval runs, training,
|
|
35
|
+
dedicated capacity (or ERRORBAR_MCP_NO_SPEND=1)
|
|
36
|
+
--only NAMES comma-separated tool names to expose
|
|
37
|
+
--base-url URL override the API root
|
|
38
|
+
`);
|
|
39
|
+
process.exit(0);
|
|
40
|
+
}
|
|
41
|
+
const apiKey = env("API_KEY");
|
|
42
|
+
if (!apiKey) {
|
|
43
|
+
process.stderr.write("errorbar-mcp: ERRORBAR_API_KEY is not set\n");
|
|
44
|
+
process.exit(2);
|
|
45
|
+
}
|
|
46
|
+
const client = new OmniaClient({
|
|
47
|
+
apiKey,
|
|
48
|
+
baseUrl: option("base-url") ?? env("BASE_URL"),
|
|
49
|
+
userAgent: `errorbar-mcp/${version}`,
|
|
50
|
+
});
|
|
51
|
+
const server = createServer({
|
|
52
|
+
client,
|
|
53
|
+
version,
|
|
54
|
+
readOnly: flag("read-only") || env("MCP_READ_ONLY") === "1",
|
|
55
|
+
noSpend: flag("no-spend") || env("MCP_NO_SPEND") === "1",
|
|
56
|
+
only: option("only")?.split(",").map((s) => s.trim()).filter(Boolean),
|
|
57
|
+
});
|
|
58
|
+
await server.connect(new StdioServerTransport());
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin HTTP client for the errorbar platform API. It does not interpret
|
|
3
|
+
* responses — the API's own status and body are what the tool returns, so an
|
|
4
|
+
* agent sees exactly the error a curl would.
|
|
5
|
+
*/
|
|
6
|
+
export interface ClientOptions {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
/** API root, default https://gateway.errorbar.ai */
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
userAgent?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiResponse {
|
|
14
|
+
status: number;
|
|
15
|
+
ok: boolean;
|
|
16
|
+
contentType: string;
|
|
17
|
+
/** Parsed JSON when the response is JSON; otherwise undefined. */
|
|
18
|
+
json?: unknown;
|
|
19
|
+
/** Raw text when the response is not JSON (CSV/JSONL exports, HTML errors). */
|
|
20
|
+
text?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_BASE_URL = "https://gateway.errorbar.ai";
|
|
23
|
+
export declare class OmniaClient {
|
|
24
|
+
private readonly apiKey;
|
|
25
|
+
private readonly baseUrl;
|
|
26
|
+
private readonly fetchImpl;
|
|
27
|
+
private readonly userAgent;
|
|
28
|
+
constructor(opts: ClientOptions);
|
|
29
|
+
/** Builds the absolute URL: path with `{param}` filled, plus a query string. */
|
|
30
|
+
buildUrl(path: string, pathParams?: Record<string, unknown>, query?: Record<string, unknown>): string;
|
|
31
|
+
request(input: {
|
|
32
|
+
method: string;
|
|
33
|
+
path: string;
|
|
34
|
+
pathParams?: Record<string, unknown>;
|
|
35
|
+
query?: Record<string, unknown>;
|
|
36
|
+
body?: unknown;
|
|
37
|
+
}): Promise<ApiResponse>;
|
|
38
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const DEFAULT_BASE_URL = "https://gateway.errorbar.ai";
|
|
2
|
+
export class OmniaClient {
|
|
3
|
+
apiKey;
|
|
4
|
+
baseUrl;
|
|
5
|
+
fetchImpl;
|
|
6
|
+
userAgent;
|
|
7
|
+
constructor(opts) {
|
|
8
|
+
if (!opts.apiKey)
|
|
9
|
+
throw new Error("apiKey is required");
|
|
10
|
+
this.apiKey = opts.apiKey;
|
|
11
|
+
this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
12
|
+
this.fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
13
|
+
this.userAgent = opts.userAgent ?? "errorbar-mcp";
|
|
14
|
+
}
|
|
15
|
+
/** Builds the absolute URL: path with `{param}` filled, plus a query string. */
|
|
16
|
+
buildUrl(path, pathParams = {}, query = {}) {
|
|
17
|
+
const filled = path.replace(/\{(\w+)\}/g, (_, k) => {
|
|
18
|
+
const v = pathParams[k];
|
|
19
|
+
if (v === undefined || v === null || v === "")
|
|
20
|
+
throw new Error(`missing path parameter: ${k}`);
|
|
21
|
+
return encodeURIComponent(String(v));
|
|
22
|
+
});
|
|
23
|
+
const url = new URL(this.baseUrl + filled);
|
|
24
|
+
for (const [k, v] of Object.entries(query)) {
|
|
25
|
+
if (v === undefined || v === null)
|
|
26
|
+
continue;
|
|
27
|
+
if (Array.isArray(v))
|
|
28
|
+
for (const item of v)
|
|
29
|
+
url.searchParams.append(k, String(item));
|
|
30
|
+
else
|
|
31
|
+
url.searchParams.set(k, typeof v === "object" ? JSON.stringify(v) : String(v));
|
|
32
|
+
}
|
|
33
|
+
return url.toString();
|
|
34
|
+
}
|
|
35
|
+
async request(input) {
|
|
36
|
+
const url = this.buildUrl(input.path, input.pathParams, input.query);
|
|
37
|
+
const headers = {
|
|
38
|
+
authorization: `Bearer ${this.apiKey}`,
|
|
39
|
+
// No text/plain: some routes (setup/status) switch to a shell-oriented flat
|
|
40
|
+
// format when they see it; the model wants the JSON the docs describe.
|
|
41
|
+
accept: "application/json, text/csv, application/x-ndjson, */*;q=0.8",
|
|
42
|
+
"user-agent": this.userAgent,
|
|
43
|
+
};
|
|
44
|
+
let body;
|
|
45
|
+
if (input.body !== undefined && input.method !== "GET") {
|
|
46
|
+
headers["content-type"] = "application/json";
|
|
47
|
+
body = JSON.stringify(input.body);
|
|
48
|
+
}
|
|
49
|
+
const res = await this.fetchImpl(url, { method: input.method, headers, body });
|
|
50
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
51
|
+
const text = await res.text();
|
|
52
|
+
if (contentType.includes("json") || (text.startsWith("{") || text.startsWith("["))) {
|
|
53
|
+
try {
|
|
54
|
+
return { status: res.status, ok: res.ok, contentType, json: JSON.parse(text) };
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
/* fall through to text */
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { status: res.status, ok: res.ok, contentType, text };
|
|
61
|
+
}
|
|
62
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { OmniaClient, DEFAULT_BASE_URL } from "./client.js";
|
|
2
|
+
/** The client under the product's name; `OmniaClient` stays exported for existing code. */
|
|
3
|
+
export { OmniaClient as ErrorbarClient } from "./client.js";
|
|
4
|
+
export type { ClientOptions, ApiResponse } from "./client.js";
|
|
5
|
+
export { createServer, selectOperations, inputShapeFor, descriptionFor } from "./server.js";
|
|
6
|
+
export type { ServerOptions } from "./server.js";
|
|
7
|
+
export { OPERATIONS } from "./manifest.js";
|
|
8
|
+
export type { Operation, Param, Scope } from "./manifest-types.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { OmniaClient, DEFAULT_BASE_URL } from "./client.js";
|
|
2
|
+
/** The client under the product's name; `OmniaClient` stays exported for existing code. */
|
|
3
|
+
export { OmniaClient as ErrorbarClient } from "./client.js";
|
|
4
|
+
export { createServer, selectOperations, inputShapeFor, descriptionFor } from "./server.js";
|
|
5
|
+
export { OPERATIONS } from "./manifest.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** One parameter of an operation — path, query, or body field. */
|
|
2
|
+
export interface Param {
|
|
3
|
+
name: string;
|
|
4
|
+
type: "string" | "integer" | "number" | "boolean" | "object" | "array";
|
|
5
|
+
required?: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
enum?: readonly string[];
|
|
8
|
+
default?: unknown;
|
|
9
|
+
/** For arrays: the element type (objects allowed, described in `description`). */
|
|
10
|
+
items?: "string" | "integer" | "number" | "boolean" | "object";
|
|
11
|
+
}
|
|
12
|
+
export type Scope = "read" | "evals:write" | "aliases:write" | "platform:write";
|
|
13
|
+
/** One public API operation, exposed as one MCP tool. */
|
|
14
|
+
export interface Operation {
|
|
15
|
+
/** MCP tool name: snake_case verb_noun, unique. */
|
|
16
|
+
name: string;
|
|
17
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
18
|
+
/** Path relative to the API root, `{param}` placeholders for path params. */
|
|
19
|
+
path: string;
|
|
20
|
+
summary: string;
|
|
21
|
+
/** API-key scope the platform requires for this call. */
|
|
22
|
+
scope: Scope;
|
|
23
|
+
pathParams?: Param[];
|
|
24
|
+
query?: Param[];
|
|
25
|
+
body?: Param[];
|
|
26
|
+
responseSummary: string;
|
|
27
|
+
notes?: string;
|
|
28
|
+
/** True when the call spends wallet credit or starts billable compute. */
|
|
29
|
+
spends?: boolean;
|
|
30
|
+
/** True when the endpoint may return a non-JSON body (CSV/JSONL export). */
|
|
31
|
+
raw?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|