@atbash/cli 0.5.11 → 0.5.13
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/README.md +15 -6
- package/dist/commands/connect.d.ts +28 -7
- package/dist/commands/connect.js +230 -68
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/introspect-mcp.d.ts +74 -0
- package/dist/commands/introspect-mcp.js +215 -0
- package/dist/commands/introspect-mcp.js.map +1 -0
- package/dist/commands/minimal-mcp-client.d.ts +33 -0
- package/dist/commands/minimal-mcp-client.js +391 -0
- package/dist/commands/minimal-mcp-client.js.map +1 -0
- package/package.json +10 -4
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MinimalMcpClient = exports.SUPPORTED_PROTOCOL_VERSIONS = void 0;
|
|
4
|
+
exports.defaultChildEnv = defaultChildEnv;
|
|
5
|
+
exports.isLoopbackHost = isLoopbackHost;
|
|
6
|
+
/**
|
|
7
|
+
* Minimal MCP client — a deliberately NARROW, fail-closed implementation of only
|
|
8
|
+
* the metadata calls Atbash needs. It is NOT a general MCP client.
|
|
9
|
+
*
|
|
10
|
+
* WHY THIS EXISTS
|
|
11
|
+
* The official @modelcontextprotocol/sdk drags a full server HTTP stack (express,
|
|
12
|
+
* cors, body-parser, express-rate-limit, …) into what is a CLIENT-ONLY CLI — ~80
|
|
13
|
+
* transitive packages for a tool whose whole pitch is supply-chain hygiene. We only
|
|
14
|
+
* ever call five metadata methods, so we own exactly that slice and nothing more.
|
|
15
|
+
*
|
|
16
|
+
* SUPPORTED (and nothing else):
|
|
17
|
+
* - initialize + notifications/initialized (lifecycle)
|
|
18
|
+
* - tools/list, resources/list, prompts/list (metadata only — never tools/call)
|
|
19
|
+
* - transports: stdio (newline-delimited JSON-RPC) and Streamable HTTP (JSON or
|
|
20
|
+
* a single SSE response), with mcp-session-id.
|
|
21
|
+
*
|
|
22
|
+
* FAIL CLOSED: unknown transport → error; a server protocol version we don't
|
|
23
|
+
* support → error; oversized/hung/malformed → error. Never executes a tool. Uses
|
|
24
|
+
* spawn(command, args, { shell: false }) — no shell. No HTTP redirects. Response
|
|
25
|
+
* size + time + buffered-bytes are all hard-capped.
|
|
26
|
+
*
|
|
27
|
+
* The official SDK is retained as a DEV dependency and used as the compatibility
|
|
28
|
+
* oracle in differential tests (test/mcp-differential.test.js) — parity is proven
|
|
29
|
+
* against it, but it is not shipped at runtime.
|
|
30
|
+
*/
|
|
31
|
+
const child_process_1 = require("child_process");
|
|
32
|
+
/** MCP protocol versions this narrow client understands. We send the newest and
|
|
33
|
+
* fail closed if the server insists on one outside this set. */
|
|
34
|
+
exports.SUPPORTED_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
35
|
+
const CLIENT_PROTOCOL_VERSION = exports.SUPPORTED_PROTOCOL_VERSIONS[0];
|
|
36
|
+
const CLIENT_INFO = { name: "atbash-cli-introspect", version: "1.0.0" };
|
|
37
|
+
const MAX_STDIO_BUFFER = 8 * 1024 * 1024; // 8MB of unframed stdout → treat as hostile
|
|
38
|
+
const MAX_HTTP_BYTES = 8 * 1024 * 1024;
|
|
39
|
+
const MAX_STDERR_KEEP = 2 * 1024; // keep a little stderr for error messages only
|
|
40
|
+
/**
|
|
41
|
+
* The environment a spawned MCP server gets when its config does NOT declare one.
|
|
42
|
+
* `spawn(cmd, args, { env: undefined })` inherits the ENTIRE parent environment —
|
|
43
|
+
* every API key in the operator's shell — so we never rely on that default. This
|
|
44
|
+
* allowlist mirrors the official SDK's `getDefaultEnvironment()`: enough for a
|
|
45
|
+
* normal server to start, and nothing else.
|
|
46
|
+
*/
|
|
47
|
+
const DEFAULT_ENV_KEYS = process.platform === "win32"
|
|
48
|
+
? ["APPDATA", "HOMEDRIVE", "HOMEPATH", "LOCALAPPDATA", "PATH", "PROCESSOR_ARCHITECTURE", "SYSTEMDRIVE", "SYSTEMROOT", "TEMP", "USERNAME", "USERPROFILE"]
|
|
49
|
+
: ["HOME", "LOGNAME", "PATH", "SHELL", "USER"];
|
|
50
|
+
/** Build the minimal child environment from an allowlist of the parent's vars. */
|
|
51
|
+
function defaultChildEnv(source = process.env) {
|
|
52
|
+
const env = {};
|
|
53
|
+
for (const key of DEFAULT_ENV_KEYS) {
|
|
54
|
+
const value = source[key];
|
|
55
|
+
// A function-shaped value is a classic shell-import injection vector (Shellshock);
|
|
56
|
+
// it is never something a server legitimately needs inherited.
|
|
57
|
+
if (typeof value === "string" && !value.startsWith("()"))
|
|
58
|
+
env[key] = value;
|
|
59
|
+
}
|
|
60
|
+
return env;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Exact loopback test. A PREFIX match (`/^(localhost|127\.)/`) is not sufficient:
|
|
64
|
+
* `localhost.evil.example` and `127.evil.example` are ordinary public hostnames
|
|
65
|
+
* that would pass it and win an unencrypted connection.
|
|
66
|
+
*/
|
|
67
|
+
function isLoopbackHost(hostname) {
|
|
68
|
+
const host = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
69
|
+
if (host === "localhost" || host === "::1" || host === "0:0:0:0:0:0:0:1")
|
|
70
|
+
return true;
|
|
71
|
+
// 127.0.0.0/8 — four real octets, no trailing labels.
|
|
72
|
+
const octets = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(host);
|
|
73
|
+
return !!octets && octets[1] === "127" && octets.slice(1).every((o) => Number(o) <= 255);
|
|
74
|
+
}
|
|
75
|
+
// ── stdio transport ──────────────────────────────────────────────────────────
|
|
76
|
+
class StdioConnection {
|
|
77
|
+
constructor(command, args, env) {
|
|
78
|
+
this.buf = "";
|
|
79
|
+
this.pending = new Map();
|
|
80
|
+
this.nextId = 1;
|
|
81
|
+
this.stderr = "";
|
|
82
|
+
this.exited = null;
|
|
83
|
+
this.fatal = null;
|
|
84
|
+
// shell:false is load-bearing — never let a configured "command" string be
|
|
85
|
+
// interpreted by a shell. args are passed as a separate argv array.
|
|
86
|
+
// env is ALWAYS explicit: `undefined` would hand the child the whole parent
|
|
87
|
+
// environment, so an unconfigured server gets the narrow allowlist instead.
|
|
88
|
+
this.child = (0, child_process_1.spawn)(command, args, { shell: false, env: env ?? defaultChildEnv(), stdio: ["pipe", "pipe", "pipe"] });
|
|
89
|
+
this.child.stdout.setEncoding("utf8");
|
|
90
|
+
this.child.stderr.setEncoding("utf8");
|
|
91
|
+
this.child.stdout.on("data", (chunk) => this.onStdout(chunk));
|
|
92
|
+
this.child.stderr.on("data", (chunk) => { if (this.stderr.length < MAX_STDERR_KEEP)
|
|
93
|
+
this.stderr += chunk; });
|
|
94
|
+
this.child.on("error", (e) => this.failAll(new Error(`spawn failed: ${e.message}`)));
|
|
95
|
+
this.child.on("exit", (code, signal) => {
|
|
96
|
+
this.exited = { code, signal };
|
|
97
|
+
this.failAll(new Error(`server exited (code ${code ?? "null"}${signal ? `, signal ${signal}` : ""})${this.stderr ? `: ${this.stderr.trim().slice(0, 160)}` : ""}`));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
onStdout(chunk) {
|
|
101
|
+
this.buf += chunk;
|
|
102
|
+
if (this.buf.length > MAX_STDIO_BUFFER) {
|
|
103
|
+
this.failAll(new Error("stdout exceeded buffer cap without a complete message"));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Newline-delimited JSON-RPC: parse each complete line, keep the partial tail.
|
|
107
|
+
let nl;
|
|
108
|
+
while ((nl = this.buf.indexOf("\n")) !== -1) {
|
|
109
|
+
const line = this.buf.slice(0, nl).trim();
|
|
110
|
+
this.buf = this.buf.slice(nl + 1);
|
|
111
|
+
if (!line)
|
|
112
|
+
continue;
|
|
113
|
+
let msg;
|
|
114
|
+
try {
|
|
115
|
+
msg = JSON.parse(line);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
continue;
|
|
119
|
+
} // ignore non-JSON log lines
|
|
120
|
+
// Only responses carry an id we issued. Notifications (no id) are ignored.
|
|
121
|
+
if (msg.id === undefined || msg.id === null)
|
|
122
|
+
continue;
|
|
123
|
+
const id = typeof msg.id === "number" ? msg.id : Number(msg.id);
|
|
124
|
+
const waiter = this.pending.get(id);
|
|
125
|
+
if (!waiter)
|
|
126
|
+
continue;
|
|
127
|
+
this.pending.delete(id);
|
|
128
|
+
if (msg.error)
|
|
129
|
+
waiter.reject(new Error(`rpc error ${msg.error.code ?? ""}: ${msg.error.message ?? "unknown"}`.trim()));
|
|
130
|
+
else
|
|
131
|
+
waiter.resolve(msg.result);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
failAll(e) {
|
|
135
|
+
this.fatal = this.fatal ?? e;
|
|
136
|
+
for (const { reject } of this.pending.values())
|
|
137
|
+
reject(e);
|
|
138
|
+
this.pending.clear();
|
|
139
|
+
}
|
|
140
|
+
request(method, params, timeoutMs) {
|
|
141
|
+
if (this.fatal)
|
|
142
|
+
return Promise.reject(this.fatal);
|
|
143
|
+
const id = this.nextId++;
|
|
144
|
+
const payload = JSON.stringify({ jsonrpc: "2.0", id, method, params }) + "\n";
|
|
145
|
+
return new Promise((resolve, reject) => {
|
|
146
|
+
const timer = setTimeout(() => { this.pending.delete(id); reject(new Error(`timed out after ${timeoutMs}ms waiting for ${method}`)); }, timeoutMs);
|
|
147
|
+
this.pending.set(id, {
|
|
148
|
+
resolve: (v) => { clearTimeout(timer); resolve(v); },
|
|
149
|
+
reject: (e) => { clearTimeout(timer); reject(e); },
|
|
150
|
+
});
|
|
151
|
+
try {
|
|
152
|
+
this.child.stdin.write(payload);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
clearTimeout(timer);
|
|
156
|
+
this.pending.delete(id);
|
|
157
|
+
reject(e instanceof Error ? e : new Error(String(e)));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
notify(method, params) {
|
|
162
|
+
if (this.fatal)
|
|
163
|
+
return Promise.reject(this.fatal);
|
|
164
|
+
try {
|
|
165
|
+
this.child.stdin.write(JSON.stringify({ jsonrpc: "2.0", method, params }) + "\n");
|
|
166
|
+
}
|
|
167
|
+
catch { /* best effort */ }
|
|
168
|
+
return Promise.resolve();
|
|
169
|
+
}
|
|
170
|
+
// stdio frames carry no headers — the version negotiated at initialize governs
|
|
171
|
+
// the whole process lifetime, so there is nothing to echo per message.
|
|
172
|
+
setProtocolVersion() { }
|
|
173
|
+
async close() {
|
|
174
|
+
this.failAll(new Error("connection closed"));
|
|
175
|
+
if (this.exited)
|
|
176
|
+
return;
|
|
177
|
+
try {
|
|
178
|
+
this.child.stdin.end();
|
|
179
|
+
}
|
|
180
|
+
catch { /* ignore */ }
|
|
181
|
+
this.child.kill("SIGTERM");
|
|
182
|
+
// Escalate to SIGKILL if it doesn't exit promptly, so a stuck server can't linger.
|
|
183
|
+
await new Promise((resolve) => {
|
|
184
|
+
const t = setTimeout(() => { try {
|
|
185
|
+
this.child.kill("SIGKILL");
|
|
186
|
+
}
|
|
187
|
+
catch { /* ignore */ } resolve(); }, 2000);
|
|
188
|
+
this.child.on("exit", () => { clearTimeout(t); resolve(); });
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// ── Streamable HTTP transport ────────────────────────────────────────────────
|
|
193
|
+
class HttpConnection {
|
|
194
|
+
constructor(url) {
|
|
195
|
+
this.url = url;
|
|
196
|
+
this.nextId = 1;
|
|
197
|
+
}
|
|
198
|
+
setProtocolVersion(version) { this.protocolVersion = version; }
|
|
199
|
+
async request(method, params, timeoutMs) {
|
|
200
|
+
const id = this.nextId++;
|
|
201
|
+
const res = await this.post({ jsonrpc: "2.0", id, method, params }, timeoutMs);
|
|
202
|
+
if (res.error)
|
|
203
|
+
throw new Error(`rpc error ${res.error.code ?? ""}: ${res.error.message ?? "unknown"}`.trim());
|
|
204
|
+
return res.result;
|
|
205
|
+
}
|
|
206
|
+
async notify(method, params) {
|
|
207
|
+
// Notifications get no response; a 202 is expected. Best-effort, short timeout.
|
|
208
|
+
try {
|
|
209
|
+
await this.post({ jsonrpc: "2.0", method, params }, 5000, true);
|
|
210
|
+
}
|
|
211
|
+
catch { /* best effort */ }
|
|
212
|
+
}
|
|
213
|
+
async post(body, timeoutMs, notification = false) {
|
|
214
|
+
const ctrl = new AbortController();
|
|
215
|
+
const timer = setTimeout(() => ctrl.abort(), timeoutMs);
|
|
216
|
+
try {
|
|
217
|
+
const headers = {
|
|
218
|
+
"content-type": "application/json",
|
|
219
|
+
accept: "application/json, text/event-stream",
|
|
220
|
+
};
|
|
221
|
+
if (this.sessionId)
|
|
222
|
+
headers["mcp-session-id"] = this.sessionId;
|
|
223
|
+
// Required from MCP 2025-06-18 onward on every request AFTER initialize.
|
|
224
|
+
// Servers that enforce it reject the request outright; servers that don't
|
|
225
|
+
// silently assume 2025-03-26, which would negotiate us down.
|
|
226
|
+
if (this.protocolVersion)
|
|
227
|
+
headers["mcp-protocol-version"] = this.protocolVersion;
|
|
228
|
+
const resp = await fetch(this.url, { method: "POST", headers, body: JSON.stringify(body), signal: ctrl.signal, redirect: "error" });
|
|
229
|
+
const sid = resp.headers.get("mcp-session-id");
|
|
230
|
+
if (sid)
|
|
231
|
+
this.sessionId = sid;
|
|
232
|
+
if (notification)
|
|
233
|
+
return {}; // don't parse a 202/empty notification ack
|
|
234
|
+
if (!resp.ok)
|
|
235
|
+
throw new Error(`HTTP ${resp.status}`);
|
|
236
|
+
const ctype = resp.headers.get("content-type") ?? "";
|
|
237
|
+
if (ctype.includes("text/event-stream"))
|
|
238
|
+
return await this.readSse(resp, Number(body.id));
|
|
239
|
+
// plain application/json response
|
|
240
|
+
const text = await this.readBounded(resp);
|
|
241
|
+
return JSON.parse(text);
|
|
242
|
+
}
|
|
243
|
+
finally {
|
|
244
|
+
clearTimeout(timer);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/** Read an SSE stream until the JSON-RPC response with our id arrives (server may
|
|
248
|
+
* interleave notifications first). Bounded by bytes; caller bounds by time. */
|
|
249
|
+
async readSse(resp, wantId) {
|
|
250
|
+
if (!resp.body)
|
|
251
|
+
throw new Error("empty SSE body");
|
|
252
|
+
const reader = resp.body.getReader();
|
|
253
|
+
const decoder = new TextDecoder();
|
|
254
|
+
let buf = "";
|
|
255
|
+
let total = 0;
|
|
256
|
+
for (;;) {
|
|
257
|
+
const { done, value } = await reader.read();
|
|
258
|
+
if (done)
|
|
259
|
+
break;
|
|
260
|
+
total += value?.byteLength ?? 0;
|
|
261
|
+
if (total > MAX_HTTP_BYTES) {
|
|
262
|
+
try {
|
|
263
|
+
await reader.cancel();
|
|
264
|
+
}
|
|
265
|
+
catch { /* ignore */ }
|
|
266
|
+
throw new Error("SSE stream exceeded size cap");
|
|
267
|
+
}
|
|
268
|
+
buf += decoder.decode(value, { stream: true });
|
|
269
|
+
// SSE events are separated by a blank line; each event may have data: lines.
|
|
270
|
+
let sep;
|
|
271
|
+
while ((sep = buf.indexOf("\n\n")) !== -1) {
|
|
272
|
+
const event = buf.slice(0, sep);
|
|
273
|
+
buf = buf.slice(sep + 2);
|
|
274
|
+
const data = event.split(/\r?\n/).filter((l) => l.startsWith("data:")).map((l) => l.slice(5).trim()).join("");
|
|
275
|
+
if (!data)
|
|
276
|
+
continue;
|
|
277
|
+
let msg;
|
|
278
|
+
try {
|
|
279
|
+
msg = JSON.parse(data);
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (msg.id !== undefined && msg.id !== null && Number(msg.id) === wantId) {
|
|
285
|
+
try {
|
|
286
|
+
await reader.cancel();
|
|
287
|
+
}
|
|
288
|
+
catch { /* ignore */ }
|
|
289
|
+
return msg;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
throw new Error("SSE stream ended before a matching response");
|
|
294
|
+
}
|
|
295
|
+
async readBounded(resp) {
|
|
296
|
+
if (!resp.body)
|
|
297
|
+
return "";
|
|
298
|
+
const reader = resp.body.getReader();
|
|
299
|
+
const decoder = new TextDecoder();
|
|
300
|
+
let out = "";
|
|
301
|
+
let total = 0;
|
|
302
|
+
for (;;) {
|
|
303
|
+
const { done, value } = await reader.read();
|
|
304
|
+
if (done)
|
|
305
|
+
break;
|
|
306
|
+
total += value?.byteLength ?? 0;
|
|
307
|
+
if (total > MAX_HTTP_BYTES) {
|
|
308
|
+
try {
|
|
309
|
+
await reader.cancel();
|
|
310
|
+
}
|
|
311
|
+
catch { /* ignore */ }
|
|
312
|
+
throw new Error("response exceeded size cap");
|
|
313
|
+
}
|
|
314
|
+
out += decoder.decode(value, { stream: true });
|
|
315
|
+
}
|
|
316
|
+
return out;
|
|
317
|
+
}
|
|
318
|
+
/** Release the negotiated session server-side. Without this, every introspection
|
|
319
|
+
* run leaves an orphaned session on the server until its own timeout expires. */
|
|
320
|
+
async close() {
|
|
321
|
+
if (!this.sessionId)
|
|
322
|
+
return; // no session was negotiated — nothing to release
|
|
323
|
+
const ctrl = new AbortController();
|
|
324
|
+
const timer = setTimeout(() => ctrl.abort(), 3000);
|
|
325
|
+
try {
|
|
326
|
+
const headers = { "mcp-session-id": this.sessionId };
|
|
327
|
+
if (this.protocolVersion)
|
|
328
|
+
headers["mcp-protocol-version"] = this.protocolVersion;
|
|
329
|
+
const resp = await fetch(this.url, { method: "DELETE", headers, signal: ctrl.signal, redirect: "error" });
|
|
330
|
+
// 405 is explicitly allowed by the spec for servers that don't support it.
|
|
331
|
+
await resp.body?.cancel().catch(() => { });
|
|
332
|
+
}
|
|
333
|
+
catch { /* teardown is best-effort; a failed DELETE must not fail the scan */ }
|
|
334
|
+
finally {
|
|
335
|
+
clearTimeout(timer);
|
|
336
|
+
this.sessionId = undefined;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/** The narrow client: connect (initialize handshake) then list metadata. */
|
|
341
|
+
class MinimalMcpClient {
|
|
342
|
+
constructor(spec) {
|
|
343
|
+
this.connected = false;
|
|
344
|
+
if (spec.url && spec.url.trim()) {
|
|
345
|
+
let u;
|
|
346
|
+
try {
|
|
347
|
+
u = new URL(spec.url);
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
throw new Error("invalid server url");
|
|
351
|
+
}
|
|
352
|
+
if (u.protocol !== "https:" && !isLoopbackHost(u.hostname))
|
|
353
|
+
throw new Error("refusing non-HTTPS remote MCP endpoint");
|
|
354
|
+
this.conn = new HttpConnection(u);
|
|
355
|
+
}
|
|
356
|
+
else if (spec.command && spec.command.trim()) {
|
|
357
|
+
this.conn = new StdioConnection(spec.command, spec.args ?? [], spec.env);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
throw new Error("no url or command to reach the server");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
async connect(timeoutMs) {
|
|
364
|
+
const result = (await this.conn.request("initialize", {
|
|
365
|
+
protocolVersion: CLIENT_PROTOCOL_VERSION,
|
|
366
|
+
capabilities: {},
|
|
367
|
+
clientInfo: CLIENT_INFO,
|
|
368
|
+
}, timeoutMs));
|
|
369
|
+
// Fail closed on a protocol version we don't understand.
|
|
370
|
+
const serverVersion = typeof result?.protocolVersion === "string" ? result.protocolVersion : undefined;
|
|
371
|
+
if (serverVersion && !exports.SUPPORTED_PROTOCOL_VERSIONS.includes(serverVersion)) {
|
|
372
|
+
throw new Error(`unsupported MCP protocol version: ${serverVersion}`);
|
|
373
|
+
}
|
|
374
|
+
// Lock in the negotiated version BEFORE any further traffic — the
|
|
375
|
+
// `notifications/initialized` message already has to carry it over HTTP.
|
|
376
|
+
this.conn.setProtocolVersion(serverVersion ?? CLIENT_PROTOCOL_VERSION);
|
|
377
|
+
await this.conn.notify("notifications/initialized", {});
|
|
378
|
+
this.connected = true;
|
|
379
|
+
}
|
|
380
|
+
async list(method, timeoutMs) {
|
|
381
|
+
if (!this.connected)
|
|
382
|
+
throw new Error("not connected");
|
|
383
|
+
return (await this.conn.request(method, {}, timeoutMs));
|
|
384
|
+
}
|
|
385
|
+
listTools(timeoutMs) { return this.list("tools/list", timeoutMs); }
|
|
386
|
+
listResources(timeoutMs) { return this.list("resources/list", timeoutMs); }
|
|
387
|
+
listPrompts(timeoutMs) { return this.list("prompts/list", timeoutMs); }
|
|
388
|
+
async close() { await this.conn.close(); }
|
|
389
|
+
}
|
|
390
|
+
exports.MinimalMcpClient = MinimalMcpClient;
|
|
391
|
+
//# sourceMappingURL=minimal-mcp-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimal-mcp-client.js","sourceRoot":"","sources":["../../src/commands/minimal-mcp-client.ts"],"names":[],"mappings":";;;AAiDA,0CASC;AAOD,wCAMC;AAvED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iDAA2E;AAE3E;iEACiE;AACpD,QAAA,2BAA2B,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AAC/F,MAAM,uBAAuB,GAAG,mCAA2B,CAAC,CAAC,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,4CAA4C;AACtF,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,+CAA+C;AAEjF;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO;IACnD,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,wBAAwB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC;IACxJ,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,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CA2CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atbash/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "Atbash CLI — control boundary before the last irreversible step in an agent workflow",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://atbash.ai",
|
|
@@ -24,18 +24,24 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"
|
|
27
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
28
|
+
"build": "npm run clean && tsc",
|
|
29
|
+
"test": "node -r ts-node/register --test test/*.test.js",
|
|
28
30
|
"dev": "ts-node src/bin/atbash.ts",
|
|
29
31
|
"release": "npm version patch --no-git-tag-version && npm run build && npx npm@10 publish --access public"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@atbash/sdk": "^0.
|
|
34
|
+
"@atbash/sdk": "^0.6.2",
|
|
35
|
+
"@iarna/toml": "2.2.5",
|
|
33
36
|
"chalk": "^4.1.2",
|
|
34
37
|
"commander": "^12.0.0",
|
|
38
|
+
"jsonc-parser": "3.3.1",
|
|
35
39
|
"omelette": "^0.4.17",
|
|
36
|
-
"ora": "^5.4.1"
|
|
40
|
+
"ora": "^5.4.1",
|
|
41
|
+
"yaml": "2.9.0"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
44
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
39
45
|
"@types/node": "^20.0.0",
|
|
40
46
|
"ts-node": "^10.9.2",
|
|
41
47
|
"typescript": "^5.4.0"
|