@contextvm/sdk 0.3.0 → 0.3.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.
|
@@ -5,8 +5,11 @@ type ClientPubkey = string;
|
|
|
5
5
|
* Options for configuring the NostrMCPGateway.
|
|
6
6
|
*/
|
|
7
7
|
export interface NostrMCPGatewayOptions {
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The MCP client transport (e.g., StdioClientTransport) to connect to the original MCP server.
|
|
10
|
+
* Required unless `createMcpClientTransport` is provided.
|
|
11
|
+
*/
|
|
12
|
+
mcpClientTransport?: Transport;
|
|
10
13
|
/** Options for configuring the Nostr server transport */
|
|
11
14
|
nostrTransportOptions: NostrServerTransportOptions;
|
|
12
15
|
/**
|
|
@@ -21,14 +24,9 @@ export interface NostrMCPGatewayOptions {
|
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* The main gateway class that orchestrates communication between Nostr clients
|
|
24
|
-
* and a local MCP server.
|
|
25
|
-
* events and forwarding them to the
|
|
26
|
-
*
|
|
27
|
-
* NostrServerTransport, making this a simple message forwarder.
|
|
28
|
-
* @param options - Configuration options for the gateway
|
|
29
|
-
* @param options.mcpClientTransport - The MCP client transport (e.g., StdioServerTransport)
|
|
30
|
-
* used to connect to and communicate with the original MCP server
|
|
31
|
-
* @param options.nostrTransportOptions - Configuration options for the Nostr server transport
|
|
27
|
+
* and a local MCP server. Acts as a bridge, receiving MCP requests via Nostr
|
|
28
|
+
* events and forwarding them to the MCP server. Supports both single-client
|
|
29
|
+
* and per-client transport modes for stateful MCP connections.
|
|
32
30
|
*/
|
|
33
31
|
export declare class NostrMCPGateway {
|
|
34
32
|
private readonly mcpClientTransport;
|
|
@@ -41,12 +39,19 @@ export declare class NostrMCPGateway {
|
|
|
41
39
|
private readonly handleServerErrorBound;
|
|
42
40
|
private readonly handleServerCloseBound;
|
|
43
41
|
private isRunning;
|
|
42
|
+
/**
|
|
43
|
+
* @param options - Configuration options for the gateway
|
|
44
|
+
*/
|
|
44
45
|
constructor(options: NostrMCPGatewayOptions);
|
|
45
46
|
/**
|
|
46
47
|
* Sets up event handlers for both transports.
|
|
47
48
|
*/
|
|
48
49
|
private setupEventHandlers;
|
|
49
50
|
private getOrCreateClientTransport;
|
|
51
|
+
/**
|
|
52
|
+
* Closes and cleans up the MCP transport for a specific client.
|
|
53
|
+
* Handles both active transports and in-flight creation promises.
|
|
54
|
+
*/
|
|
50
55
|
private closeClientTransport;
|
|
51
56
|
private closeTransportForEviction;
|
|
52
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAMhD,KAAK,YAAY,GAAG,MAAM,CAAC;AAM3B;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,yDAAyD;IACzD,qBAAqB,EAAE,2BAA2B,CAAC;IAEnD;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,GAAG,EAAE;QAC/B,YAAY,EAAE,YAAY,CAAC;KAC5B,KAAK,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAErC,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAwB;IAC3D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;IAC5D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAE3B;IACd,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAE1B;IACd,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAyB;IAC/D,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;IAChE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAa;IACpD,OAAO,CAAC,SAAS,CAAS;IAE1B;;OAEG;gBACS,OAAO,EAAE,sBAAsB;IAyC3C;;OAEG;IACH,OAAO,CAAC,kBAAkB;YA8DZ,0BAA0B;IAsDxC;;;OAGG;YACW,oBAAoB;YA6BpB,yBAAyB;IAwBvC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BnC;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAuClC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;;OAGG;IACI,QAAQ,IAAI,OAAO;CAG3B"}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
import { isInitializeRequest, } from '@modelcontextprotocol/sdk/types.js';
|
|
1
2
|
import { NostrServerTransport, } from '../transport/nostr-server-transport.js';
|
|
2
3
|
import { createLogger } from '../core/utils/logger.js';
|
|
3
4
|
import { LruCache } from '../core/utils/lru-cache.js';
|
|
4
5
|
const logger = createLogger('gateway');
|
|
5
6
|
/**
|
|
6
7
|
* The main gateway class that orchestrates communication between Nostr clients
|
|
7
|
-
* and a local MCP server.
|
|
8
|
-
* events and forwarding them to the
|
|
9
|
-
*
|
|
10
|
-
* NostrServerTransport, making this a simple message forwarder.
|
|
11
|
-
* @param options - Configuration options for the gateway
|
|
12
|
-
* @param options.mcpClientTransport - The MCP client transport (e.g., StdioServerTransport)
|
|
13
|
-
* used to connect to and communicate with the original MCP server
|
|
14
|
-
* @param options.nostrTransportOptions - Configuration options for the Nostr server transport
|
|
8
|
+
* and a local MCP server. Acts as a bridge, receiving MCP requests via Nostr
|
|
9
|
+
* events and forwarding them to the MCP server. Supports both single-client
|
|
10
|
+
* and per-client transport modes for stateful MCP connections.
|
|
15
11
|
*/
|
|
16
12
|
export class NostrMCPGateway {
|
|
13
|
+
/**
|
|
14
|
+
* @param options - Configuration options for the gateway
|
|
15
|
+
*/
|
|
17
16
|
constructor(options) {
|
|
18
17
|
var _a;
|
|
19
18
|
this.isRunning = false;
|
|
20
19
|
this.mcpClientTransport = options.mcpClientTransport;
|
|
21
20
|
this.createMcpClientTransport = options.createMcpClientTransport;
|
|
21
|
+
if (!this.mcpClientTransport && !this.createMcpClientTransport) {
|
|
22
|
+
throw new Error('NostrMCPGateway requires either mcpClientTransport (single-client mode) or createMcpClientTransport (per-client mode)');
|
|
23
|
+
}
|
|
22
24
|
this.handleNostrErrorBound = this.handleNostrError.bind(this);
|
|
23
25
|
this.handleNostrCloseBound = this.handleNostrClose.bind(this);
|
|
24
26
|
this.handleServerErrorBound = this.handleServerError.bind(this);
|
|
@@ -53,33 +55,52 @@ export class NostrMCPGateway {
|
|
|
53
55
|
// Internal transport messages (e.g., announcement traffic) should not be sent to an MCP server.
|
|
54
56
|
return;
|
|
55
57
|
}
|
|
58
|
+
if (!this.mcpClientTransport) {
|
|
59
|
+
throw new Error('mcpClientTransport is required when not using per-client mode');
|
|
60
|
+
}
|
|
56
61
|
logger.debug('Received message from Nostr:', message);
|
|
57
62
|
this.mcpClientTransport.send(message).catch(this.handleServerErrorBound);
|
|
58
63
|
};
|
|
59
|
-
this.nostrServerTransport.onmessageWithContext = (message, ctx) => {
|
|
64
|
+
this.nostrServerTransport.onmessageWithContext = async (message, ctx) => {
|
|
65
|
+
// Close existing transport on re-initialization to prevent "already initialized"
|
|
66
|
+
// errors with stateful transports (e.g., Streamable HTTP).
|
|
67
|
+
if (isInitializeRequest(message)) {
|
|
68
|
+
await this.closeClientTransport(ctx.clientPubkey);
|
|
69
|
+
}
|
|
60
70
|
logger.debug('Received message from Nostr (context):', {
|
|
61
71
|
clientPubkey: ctx.clientPubkey,
|
|
62
72
|
message,
|
|
63
73
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.
|
|
74
|
+
try {
|
|
75
|
+
const transport = await this.getOrCreateClientTransport(ctx.clientPubkey);
|
|
76
|
+
await transport.send(message);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
this.handleServerErrorBound(error instanceof Error ? error : new Error(String(error)));
|
|
80
|
+
}
|
|
67
81
|
};
|
|
68
82
|
this.nostrServerTransport.onerror = this.handleNostrErrorBound;
|
|
69
83
|
this.nostrServerTransport.onclose = this.handleNostrCloseBound;
|
|
70
84
|
// Forward messages from the MCP server to the Nostr transport, handling any potential errors.
|
|
71
|
-
this.mcpClientTransport
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
if (this.mcpClientTransport) {
|
|
86
|
+
this.mcpClientTransport.onmessage = (message) => {
|
|
87
|
+
logger.debug('Received message from MCP server:', message);
|
|
88
|
+
this.nostrServerTransport
|
|
89
|
+
.send(message)
|
|
90
|
+
.catch(this.handleNostrErrorBound);
|
|
91
|
+
};
|
|
92
|
+
this.mcpClientTransport.onerror = this.handleServerErrorBound;
|
|
93
|
+
this.mcpClientTransport.onclose = this.handleServerCloseBound;
|
|
94
|
+
}
|
|
77
95
|
}
|
|
78
96
|
async getOrCreateClientTransport(clientPubkey) {
|
|
79
97
|
var _a, _b, _c;
|
|
80
98
|
const createMcpClientTransport = this.createMcpClientTransport;
|
|
81
99
|
const clientTransports = this.clientTransports;
|
|
82
100
|
if (!createMcpClientTransport || !clientTransports) {
|
|
101
|
+
if (!this.mcpClientTransport) {
|
|
102
|
+
throw new Error('mcpClientTransport is required when not using per-client mode');
|
|
103
|
+
}
|
|
83
104
|
return this.mcpClientTransport;
|
|
84
105
|
}
|
|
85
106
|
const existing = clientTransports.get(clientPubkey);
|
|
@@ -115,6 +136,10 @@ export class NostrMCPGateway {
|
|
|
115
136
|
(_c = this.clientTransportPromises) === null || _c === void 0 ? void 0 : _c.delete(clientPubkey);
|
|
116
137
|
}
|
|
117
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Closes and cleans up the MCP transport for a specific client.
|
|
141
|
+
* Handles both active transports and in-flight creation promises.
|
|
142
|
+
*/
|
|
118
143
|
async closeClientTransport(clientPubkey) {
|
|
119
144
|
var _a, _b;
|
|
120
145
|
if (!this.clientTransports) {
|
|
@@ -170,6 +195,9 @@ export class NostrMCPGateway {
|
|
|
170
195
|
try {
|
|
171
196
|
// Start both transports
|
|
172
197
|
if (!this.createMcpClientTransport) {
|
|
198
|
+
if (!this.mcpClientTransport) {
|
|
199
|
+
throw new Error('mcpClientTransport is required when not using per-client mode');
|
|
200
|
+
}
|
|
173
201
|
await this.mcpClientTransport.start();
|
|
174
202
|
}
|
|
175
203
|
await this.nostrServerTransport.start();
|
|
@@ -203,6 +231,9 @@ export class NostrMCPGateway {
|
|
|
203
231
|
await Promise.all(closePromises);
|
|
204
232
|
}
|
|
205
233
|
else {
|
|
234
|
+
if (!this.mcpClientTransport) {
|
|
235
|
+
throw new Error('mcpClientTransport is required when not using per-client mode');
|
|
236
|
+
}
|
|
206
237
|
await this.mcpClientTransport.close();
|
|
207
238
|
}
|
|
208
239
|
this.isRunning = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAEpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,oBAAoB,GAErB,MAAM,wCAAwC,CAAC;A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