mcp-twake-ai 0.3.2 → 0.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.
package/build/proxy.js ADDED
@@ -0,0 +1,405 @@
1
+ import { StreamableHTTPClientTransport, StreamableHTTPError } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { NotOurServer, proves } from './proof.js';
4
+ import { isJSONRPCNotification, isJSONRPCRequest } from '@modelcontextprotocol/sdk/types.js';
5
+ /** The one message of the MCP handshake the proxy sends itself, when it opens a session on its own. */
6
+ const INITIALIZED = { jsonrpc: '2.0', method: 'notifications/initialized' };
7
+ /** How long a session opened again may take to answer the replayed initialize before the relay goes on without it. */
8
+ const REPLAY_MS = 10_000;
9
+ /** True for the 404 the shared server answers once its idle sweep has closed our session ("initialize again"). */
10
+ function sessionGone(error) {
11
+ return error instanceof StreamableHTTPError && error.code === 404;
12
+ }
13
+ /**
14
+ * True when our server is no longer there, and the request never reached it: nothing listens on its port any more, or
15
+ * what listens there now turns our token down (another start, with a token of its own). A connection reset is not one:
16
+ * the server may have run the request before it went (the SDK dispatches it before it answers), and sent again, a
17
+ * message would be posted twice.
18
+ */
19
+ function serverGone(error) {
20
+ // what listens there could not prove it holds our token: the request was not sent
21
+ if (error instanceof NotOurServer)
22
+ return true;
23
+ if (error instanceof StreamableHTTPError)
24
+ return error.code === 401;
25
+ const cause = error instanceof Error ? error.cause : undefined;
26
+ return error instanceof TypeError && cause?.code === 'ECONNREFUSED';
27
+ }
28
+ /** The id of the request a POST carries, when it carries one (not a notification, not an answer, not a batch). */
29
+ function requestIdOf(init) {
30
+ if (typeof init?.body !== 'string')
31
+ return undefined;
32
+ try {
33
+ const message = JSON.parse(init.body);
34
+ return isJSONRPCRequest(message) ? message.id : undefined;
35
+ }
36
+ catch {
37
+ return undefined;
38
+ }
39
+ }
40
+ function isInitialize(message) {
41
+ return isJSONRPCRequest(message) && message.method === 'initialize';
42
+ }
43
+ /** The notification that completes the handshake: the agent sends it once, after the server answered its initialize. */
44
+ function isInitialized(message) {
45
+ return 'method' in message && !('id' in message) && message.method === 'notifications/initialized';
46
+ }
47
+ /** The request a `notifications/cancelled` of the agent gives up on. */
48
+ function cancelledId(message) {
49
+ if (!isJSONRPCNotification(message) || message.method !== 'notifications/cancelled')
50
+ return undefined;
51
+ const id = message.params?.requestId;
52
+ return typeof id === 'string' || typeof id === 'number' ? id : undefined;
53
+ }
54
+ /** A JSON-RPC error for a request the relay could not pass on: the agent gets an answer instead of waiting for ever. */
55
+ function failure(message, error) {
56
+ if (!isJSONRPCRequest(message))
57
+ return undefined;
58
+ const text = error instanceof Error ? error.message : String(error);
59
+ return { jsonrpc: '2.0', id: message.id, error: { code: -32603, message: `The shared server could not be reached: ${text}` } };
60
+ }
61
+ /**
62
+ * Relays JSON-RPC between an agent's stdio and one session of the shared backend, message by message, as they are.
63
+ *
64
+ * Nothing is rebuilt method by method: `notifications/cancelled`, progress, `ping`, `logging/setLevel` and whatever MCP
65
+ * adds next cross both ways, and the agent's own `initialize` goes upstream, so the server sees the capabilities of the
66
+ * client it really talks to, not those of the relay.
67
+ *
68
+ * The server closes a session that stays idle for 6 h and answers 404 "Session not found: initialize again" after that:
69
+ * the relay then replays the agent's `initialize` and the message that failed. An approval request still reaches the
70
+ * client that made the call, since every client has a session of its own.
71
+ */
72
+ class Relay {
73
+ stdio;
74
+ options;
75
+ upstream;
76
+ /** the agent's initialize, replayed when the server has closed our session */
77
+ initialize;
78
+ /** the answer to an initialize the relay sent: it is ours, unless it is the agent's own */
79
+ pending;
80
+ /** messages are passed on one at a time, in the order the agent wrote them (a request, then its cancellation) */
81
+ steps = Promise.resolve();
82
+ opened = false;
83
+ /** the relay has completed the handshake: the agent's own `notifications/initialized` has nothing left to say */
84
+ handed = false;
85
+ replays = 0;
86
+ /** where the server is: it changes when ours went and another one was found */
87
+ url;
88
+ token;
89
+ /** resolved with the exit code when the relay cannot go on: no server could be found any more */
90
+ ended;
91
+ end = () => { };
92
+ /** the agent's requests sent upstream and not answered yet: each gets an answer, from the server or from the relay */
93
+ inflight = new Set();
94
+ /** the stream that carries the answer to each request in flight: closed when the agent cancels the request */
95
+ streams = new Map();
96
+ constructor(stdio, options) {
97
+ this.stdio = stdio;
98
+ this.options = options;
99
+ this.url = options.url;
100
+ this.token = options.token;
101
+ this.ended = new Promise((resolve) => (this.end = resolve));
102
+ stdio.onmessage = (message) => this.enqueue(message);
103
+ }
104
+ /** The agent may write while an earlier message still waits for the server: keep the order, never wait for the agent. */
105
+ enqueue(message) {
106
+ this.steps = this.steps.then(() => this.forward(message)).catch((error) => this.report(message, error));
107
+ }
108
+ async forward(message) {
109
+ if (isInitialize(message))
110
+ this.initialize = message;
111
+ // the relay completed the handshake itself: the agent's message would be a second `initialized`, which the spec forbids
112
+ if (this.handed && isInitialized(message)) {
113
+ this.handed = false;
114
+ return;
115
+ }
116
+ for (let again = false;;) {
117
+ const opens = this.upstream === undefined;
118
+ if (opens)
119
+ await this.open(isInitialize(message) ? message : undefined);
120
+ // the message that opened the session has been sent by open()
121
+ if (!opens || !isInitialize(message)) {
122
+ try {
123
+ if (isJSONRPCRequest(message))
124
+ this.inflight.add(message.id);
125
+ await this.upstream?.send(message);
126
+ // the agent gave up on that request: no answer goes to it any more, from the server or from the relay
127
+ const cancelled = cancelledId(message);
128
+ if (cancelled !== undefined)
129
+ this.forget(cancelled);
130
+ return;
131
+ }
132
+ catch (error) {
133
+ if (again || !(sessionGone(error) || (serverGone(error) && this.options.reconnect)))
134
+ throw error;
135
+ again = true;
136
+ if (sessionGone(error)) {
137
+ await this.closeUpstream();
138
+ this.log(`the shared server closed its session: opening another one`);
139
+ }
140
+ else {
141
+ this.log(`the shared server is gone: looking for the next one`);
142
+ const left = this.detachUpstream();
143
+ const was = { url: this.url, token: this.token };
144
+ await this.findServer().finally(async () => {
145
+ // the same server after all (its port refused for a moment): the session left behind is closed there,
146
+ // best effort and 2 s at most, instead of waiting for the server's 6-hour sweep
147
+ if (left && this.url === was.url && this.token === was.token) {
148
+ await Promise.race([left.terminateSession().catch(() => { }), new Promise((resolve) => setTimeout(resolve, 2_000))]);
149
+ }
150
+ await left?.close().catch(() => { });
151
+ });
152
+ }
153
+ }
154
+ }
155
+ else {
156
+ return;
157
+ }
158
+ }
159
+ }
160
+ /** Opens one session, the first one from the agent's own initialize, the next ones from a replay of it. */
161
+ async open(forward) {
162
+ const opening = forward ?? this.replay();
163
+ const deadline = this.opened ? Date.now() : Date.now() + (this.options.readyMs ?? 30_000);
164
+ for (;;) {
165
+ const token = this.token;
166
+ const transport = new StreamableHTTPClientTransport(new URL(this.url), {
167
+ requestInit: { headers: { authorization: `Bearer ${token}` } },
168
+ fetch: (url, init) => this.watchedFetch(url, init, token),
169
+ });
170
+ transport.onmessage = (message) => this.fromUpstream(message);
171
+ transport.onerror = (error) => this.report(undefined, error);
172
+ try {
173
+ await transport.start();
174
+ const answered = this.expectAnswer(opening.id, forward === undefined);
175
+ // the agent's own initialize is a request in flight: it gets an answer, from the server or an error
176
+ if (forward)
177
+ this.inflight.add(forward.id);
178
+ await transport.send(opening);
179
+ // the server needs its handshake complete before anything else: an approval prompt would not find us otherwise
180
+ const answer = await answered;
181
+ if (forward && answer === undefined)
182
+ throw new Error('the shared server did not answer the initialize');
183
+ // the version the server agreed on goes with every later request of this session, as the spec wants
184
+ const version = answer?.result?.protocolVersion;
185
+ if (typeof version === 'string')
186
+ transport.setProtocolVersion(version);
187
+ await transport.send(INITIALIZED);
188
+ this.handed = true;
189
+ }
190
+ catch (error) {
191
+ transport.onmessage = undefined;
192
+ transport.onerror = undefined;
193
+ // its stream is left behind with this transport: its end says nothing about the next try
194
+ this.streams.delete(opening.id);
195
+ await transport.close().catch(() => { });
196
+ this.pending = undefined;
197
+ // the backend is listening but may still be settling: the first client waits a little, the others do not
198
+ if (Date.now() >= deadline)
199
+ throw error;
200
+ await new Promise((resolve) => setTimeout(resolve, 200));
201
+ continue;
202
+ }
203
+ this.upstream = transport;
204
+ this.opened = true;
205
+ this.options.onSession?.(transport.sessionId);
206
+ return;
207
+ }
208
+ }
209
+ /** Moves to the server `run` finds now, or ends the relay when there is none: the message still gets its error. */
210
+ async findServer() {
211
+ try {
212
+ const found = await this.options.reconnect();
213
+ this.url = found.url;
214
+ this.token = found.token;
215
+ }
216
+ catch (error) {
217
+ this.end(1);
218
+ throw error;
219
+ }
220
+ }
221
+ /** the agent's initialize, under an id of our own, to open a session the server closed behind our back. */
222
+ replay() {
223
+ const initialize = this.initialize ?? {
224
+ jsonrpc: '2.0',
225
+ id: 0,
226
+ method: 'initialize',
227
+ params: { protocolVersion: '2025-06-18', capabilities: {}, clientInfo: { name: this.options.name, version: this.options.version } },
228
+ };
229
+ return { ...initialize, id: `mcp-twake-ai-replay-${++this.replays}` };
230
+ }
231
+ /**
232
+ * Waits for the server's answer to an initialize, undefined when none came in time: the relay's own is dropped, the
233
+ * agent's is passed on.
234
+ */
235
+ expectAnswer(id, ours) {
236
+ return new Promise((resolve) => {
237
+ const timer = setTimeout(() => resolve(undefined), REPLAY_MS);
238
+ this.pending = {
239
+ id,
240
+ ours,
241
+ answered: (message) => {
242
+ clearTimeout(timer);
243
+ resolve(message);
244
+ },
245
+ };
246
+ });
247
+ }
248
+ /**
249
+ * fetch, with an eye on the stream that carries the answer to a request: when it ends, or breaks, before the answer
250
+ * came (the server stopped, crashed, closed the session), the request is answered with an error instead of never.
251
+ */
252
+ async watchedFetch(url, init, token) {
253
+ // every request, the token and the agent's message in it, goes only to a server that proved it holds the token: the
254
+ // server may have gone since the last one, and another account of this machine listen on its port
255
+ const endpoint = new URL(url);
256
+ endpoint.search = '';
257
+ if (!(await proves(endpoint.href, token)))
258
+ throw new NotOurServer(endpoint.href);
259
+ const response = await fetch(url, init);
260
+ const id = requestIdOf(init);
261
+ if (id === undefined || !response.body || !response.headers.get('content-type')?.includes('text/event-stream'))
262
+ return response;
263
+ const reader = response.body.getReader();
264
+ const stream = { close: () => void reader.cancel().catch(() => { }) };
265
+ this.streams.set(id, stream);
266
+ // the SDK reads what came before the end first: give it that moment, then look whether the answer was among it;
267
+ // only the stream of this request now counts (a try that failed, a cancelled request, leave theirs behind)
268
+ const ended = () => void setTimeout(() => {
269
+ if (this.streams.get(id) !== stream)
270
+ return;
271
+ this.streams.delete(id);
272
+ this.unanswered(id);
273
+ }, 100);
274
+ const body = new ReadableStream({
275
+ async pull(controller) {
276
+ try {
277
+ const { value, done } = await reader.read();
278
+ if (done) {
279
+ controller.close();
280
+ ended();
281
+ }
282
+ else
283
+ controller.enqueue(value);
284
+ }
285
+ catch (error) {
286
+ controller.error(error);
287
+ ended();
288
+ }
289
+ },
290
+ cancel(reason) {
291
+ ended();
292
+ return reader.cancel(reason);
293
+ },
294
+ });
295
+ return new Response(body, { status: response.status, statusText: response.statusText, headers: response.headers });
296
+ }
297
+ unanswered(id) {
298
+ if (!this.inflight.delete(id))
299
+ return;
300
+ // the initialize that opens a session: open() tries again, or answers the agent with its error
301
+ if (this.pending?.id === id) {
302
+ const waiting = this.pending;
303
+ this.pending = undefined;
304
+ waiting.answered(undefined);
305
+ return;
306
+ }
307
+ this.send({ jsonrpc: '2.0', id, error: { code: -32603, message: 'The shared server went away before it answered: the call may or may not have run.' } });
308
+ }
309
+ /** A request the agent cancelled: out of the requests in flight, and its stream closed. */
310
+ forget(id) {
311
+ this.inflight.delete(id);
312
+ const stream = this.streams.get(id);
313
+ this.streams.delete(id);
314
+ stream?.close();
315
+ }
316
+ fromUpstream(message) {
317
+ if (('result' in message || 'error' in message) && 'id' in message && message.id !== undefined && message.id !== null)
318
+ this.inflight.delete(message.id);
319
+ if (this.pending && 'id' in message && message.id === this.pending.id) {
320
+ const waiting = this.pending;
321
+ this.pending = undefined;
322
+ waiting.answered(message);
323
+ // the answer to an initialize the relay sent is its own: the agent answered its own long ago
324
+ if (waiting.ours)
325
+ return;
326
+ }
327
+ this.send(message);
328
+ }
329
+ send(message) {
330
+ this.stdio.send(message).catch((error) => this.report(undefined, error));
331
+ }
332
+ report(message, error) {
333
+ this.log(error instanceof Error ? error.message : String(error));
334
+ // answered here: no stream carries an answer to it
335
+ if (message && isJSONRPCRequest(message))
336
+ this.inflight.delete(message.id);
337
+ const answer = message ? failure(message, error) : undefined;
338
+ if (answer)
339
+ this.send(answer);
340
+ }
341
+ log(line) {
342
+ (this.options.log ?? ((text) => process.stderr.write(`mcp-twake-ai: ${text}\n`)))(line);
343
+ }
344
+ async closeUpstream() {
345
+ await this.detachUpstream()?.close().catch(() => { });
346
+ }
347
+ /** Lets go of the session: nothing more is read from it, and it is not recorded any more. */
348
+ detachUpstream() {
349
+ const upstream = this.upstream;
350
+ this.upstream = undefined;
351
+ this.options.onSession?.(undefined);
352
+ if (upstream) {
353
+ // a server that is gone has nothing more to say: its stream's last error is no news
354
+ upstream.onmessage = undefined;
355
+ upstream.onerror = undefined;
356
+ }
357
+ return upstream;
358
+ }
359
+ /** Ends this client's session on the server, then the relay: the backend closes with its last client. */
360
+ async close() {
361
+ await this.steps.catch(() => { });
362
+ const upstream = this.upstream;
363
+ this.upstream = undefined;
364
+ this.options.onSession?.(undefined);
365
+ if (!upstream)
366
+ return;
367
+ // DELETE: the server closes this session at once, instead of waiting for its idle sweep
368
+ await upstream.terminateSession().catch(() => { });
369
+ await upstream.close().catch(() => { });
370
+ }
371
+ }
372
+ /**
373
+ * Bridges an agent's stdio to one MCP session of the shared backend until the agent closes its side of the pipe (0), or
374
+ * until no server can be found any more (1): the agent then sees its server exit, and starts it again.
375
+ */
376
+ export async function proxyShared(options) {
377
+ const stdio = new StdioServerTransport();
378
+ const relay = new Relay(stdio, options);
379
+ await stdio.start();
380
+ // an agent may stop its server with a signal instead of closing stdin: the session is ended all the same, so that
381
+ // the shared server does not keep it (it exits once it has none)
382
+ const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
383
+ let onSignal;
384
+ const signalled = new Promise((resolve) => {
385
+ onSignal = () => resolve(0);
386
+ for (const signal of signals)
387
+ process.on(signal, onSignal);
388
+ });
389
+ const code = await Promise.race([
390
+ new Promise((resolve) => {
391
+ process.stdin.once('end', () => resolve(0));
392
+ process.stdin.once('close', () => resolve(0));
393
+ }),
394
+ relay.ended,
395
+ signalled,
396
+ ]);
397
+ for (const signal of signals)
398
+ process.off(signal, onSignal);
399
+ // the DELETE is best effort, and bounded: a server that does not answer must not keep the agent waiting
400
+ await Promise.race([relay.close(), new Promise((resolve) => setTimeout(resolve, 2_000).unref())]);
401
+ // stdin is no longer read: a relay that ended while the agent still holds the pipe lets the process exit
402
+ await stdio.close();
403
+ return code;
404
+ }
405
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACxH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAA4D,MAAM,oCAAoC,CAAC;AAEvJ,uGAAuG;AACvG,MAAM,WAAW,GAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;AAE5F,sHAAsH;AACtH,MAAM,SAAS,GAAG,MAAM,CAAC;AAuBzB,kHAAkH;AAClH,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,YAAY,mBAAmB,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;AACpE,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,kFAAkF;IAClF,IAAI,KAAK,YAAY,YAAY;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,KAAK,YAAY,mBAAmB;QAAE,OAAO,KAAK,CAAC,IAAI,KAAK,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