@vurb/core 3.2.2 → 3.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/dist/cli/templates/constants.d.ts +1 -1
- package/dist/cli/templates/constants.d.ts.map +1 -1
- package/dist/cli/templates/constants.js +1 -1
- package/dist/cli/templates/constants.js.map +1 -1
- package/dist/cli/templates/core.d.ts.map +1 -1
- package/dist/cli/templates/core.js +9 -82
- package/dist/cli/templates/core.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/startServer.d.ts +22 -1
- package/dist/server/startServer.d.ts.map +1 -1
- package/dist/server/startServer.js +98 -5
- package/dist/server/startServer.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Template Constants — Version pins for generated package.json
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
|
-
export declare const CORE_VERSION = "^2.
|
|
5
|
+
export declare const CORE_VERSION = "^3.2.0";
|
|
6
6
|
export declare const TESTING_VERSION = "^1.0.0";
|
|
7
7
|
export declare const MCP_SDK_VERSION = "^1.12.1";
|
|
8
8
|
export declare const ZOD_VERSION = "^3.25.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,YAAY,WAAW,CAAC;AACrC,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,WAAW,YAAY,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Template Constants — Version pins for generated package.json
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
|
-
export const CORE_VERSION = '^2.
|
|
5
|
+
export const CORE_VERSION = '^3.2.0';
|
|
6
6
|
export const TESTING_VERSION = '^1.0.0';
|
|
7
7
|
export const MCP_SDK_VERSION = '^1.12.1';
|
|
8
8
|
export const ZOD_VERSION = '^3.25.1';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/cli/templates/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/cli/templates/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,2DAA2D;AAC3D,wBAAgB,MAAM,IAAI,MAAM,CAa/B;AAED,qEAAqE;AACrE,wBAAgB,SAAS,IAAI,MAAM,CA8BlC;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,2DAA2D;AAC3D,wBAAgB,MAAM,IAAI,MAAM,CAa/B;AAED,qEAAqE;AACrE,wBAAgB,SAAS,IAAI,MAAM,CA8BlC;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAgEtD"}
|
|
@@ -78,7 +78,7 @@ await startServer({
|
|
|
78
78
|
});
|
|
79
79
|
`;
|
|
80
80
|
}
|
|
81
|
-
// Streamable HTTP transport —
|
|
81
|
+
// Streamable HTTP transport — startServer handles all HTTP plumbing
|
|
82
82
|
return `/**
|
|
83
83
|
* Server Bootstrap — Vurb with Streamable HTTP Transport
|
|
84
84
|
*
|
|
@@ -86,10 +86,7 @@ await startServer({
|
|
|
86
86
|
* Drop a file, it becomes a tool.
|
|
87
87
|
*/
|
|
88
88
|
import { fileURLToPath } from 'node:url';
|
|
89
|
-
import {
|
|
90
|
-
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
91
|
-
import { createServer } from 'node:http';
|
|
92
|
-
import { autoDiscover, PromptRegistry } from '@vurb/core';
|
|
89
|
+
import { autoDiscover, PromptRegistry, startServer } from '@vurb/core';
|
|
93
90
|
import { createContext } from './context.js';
|
|
94
91
|
import { f } from './vurb.js';
|
|
95
92
|
import { GreetPrompt } from './prompts/greet.js';
|
|
@@ -102,84 +99,14 @@ const prompts = new PromptRegistry();
|
|
|
102
99
|
await autoDiscover(registry, fileURLToPath(new URL('./tools', import.meta.url)));
|
|
103
100
|
prompts.register(GreetPrompt);
|
|
104
101
|
|
|
105
|
-
// ──
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
registry.attachToServer(server, {
|
|
111
|
-
contextFactory: () => createContext(),
|
|
102
|
+
// ── Start ────────────────────────────────────────────────
|
|
103
|
+
await startServer({
|
|
104
|
+
name: '${config.name}',
|
|
105
|
+
registry,
|
|
112
106
|
prompts,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const PORT = Number(process.env['PORT'] ?? 3001);
|
|
117
|
-
const sessions = new Map<string, StreamableHTTPServerTransport>();
|
|
118
|
-
|
|
119
|
-
const httpServer = createServer(async (req, res) => {
|
|
120
|
-
try {
|
|
121
|
-
const url = new URL(req.url ?? '/', \`http://localhost:\${PORT}\`);
|
|
122
|
-
|
|
123
|
-
if (url.pathname !== '/mcp') {
|
|
124
|
-
res.writeHead(404).end();
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (req.method === 'POST') {
|
|
129
|
-
// Parse JSON body
|
|
130
|
-
const chunks: Buffer[] = [];
|
|
131
|
-
for await (const chunk of req) chunks.push(chunk as Buffer);
|
|
132
|
-
const body = JSON.parse(Buffer.concat(chunks).toString());
|
|
133
|
-
|
|
134
|
-
const sessionId = req.headers['mcp-session-id'] as string | undefined;
|
|
135
|
-
|
|
136
|
-
// Existing session — route to its transport
|
|
137
|
-
if (sessionId && sessions.has(sessionId)) {
|
|
138
|
-
const transport = sessions.get(sessionId)!;
|
|
139
|
-
await transport.handleRequest(req, res, body);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// New session — create transport
|
|
144
|
-
const transport = new StreamableHTTPServerTransport({
|
|
145
|
-
sessionIdGenerator: () => crypto.randomUUID(),
|
|
146
|
-
onsessioninitialized: (id) => {
|
|
147
|
-
sessions.set(id, transport);
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
transport.onclose = () => {
|
|
151
|
-
const id = [...sessions.entries()].find(([, t]) => t === transport)?.[0];
|
|
152
|
-
if (id) sessions.delete(id);
|
|
153
|
-
};
|
|
154
|
-
await server.connect(transport);
|
|
155
|
-
await transport.handleRequest(req, res, body);
|
|
156
|
-
} else if (req.method === 'GET') {
|
|
157
|
-
const sessionId = req.headers['mcp-session-id'] as string | undefined;
|
|
158
|
-
if (sessionId && sessions.has(sessionId)) {
|
|
159
|
-
const transport = sessions.get(sessionId)!;
|
|
160
|
-
await transport.handleRequest(req, res);
|
|
161
|
-
} else {
|
|
162
|
-
res.writeHead(400).end('Missing or invalid session');
|
|
163
|
-
}
|
|
164
|
-
} else if (req.method === 'DELETE') {
|
|
165
|
-
const sessionId = req.headers['mcp-session-id'] as string | undefined;
|
|
166
|
-
if (sessionId && sessions.has(sessionId)) {
|
|
167
|
-
const transport = sessions.get(sessionId)!;
|
|
168
|
-
await transport.handleRequest(req, res);
|
|
169
|
-
} else {
|
|
170
|
-
res.writeHead(400).end('Missing or invalid session');
|
|
171
|
-
}
|
|
172
|
-
} else {
|
|
173
|
-
res.writeHead(405).end();
|
|
174
|
-
}
|
|
175
|
-
} catch (err) {
|
|
176
|
-
console.error('[Vurb] Unhandled error in HTTP handler:', err);
|
|
177
|
-
if (!res.headersSent) res.writeHead(500).end();
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
httpServer.listen(PORT, () => {
|
|
182
|
-
console.error(\`⚡ Vurb server on http://localhost:\${PORT}/mcp\`);
|
|
107
|
+
contextFactory: () => createContext(),
|
|
108
|
+
transport: 'http',
|
|
109
|
+
port: Number(process.env['PORT'] ?? 3001),
|
|
183
110
|
});
|
|
184
111
|
`;
|
|
185
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/cli/templates/core.ts"],"names":[],"mappings":"AAQA,2DAA2D;AAC3D,MAAM,UAAU,MAAM;IAClB,OAAO;;;;;;;;;;;CAWV,CAAC;AACF,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,SAAS;IACrB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BV,CAAC;AACF,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,QAAQ,CAAC,MAAqB;IAC1C,IAAI,MAAM,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;QAC/B,oDAAoD;QACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;aAsBF,MAAM,CAAC,IAAI;;;;;CAKvB,CAAC;IACE,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/cli/templates/core.ts"],"names":[],"mappings":"AAQA,2DAA2D;AAC3D,MAAM,UAAU,MAAM;IAClB,OAAO;;;;;;;;;;;CAWV,CAAC;AACF,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,SAAS;IACrB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BV,CAAC;AACF,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,QAAQ,CAAC,MAAqB;IAC1C,IAAI,MAAM,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;QAC/B,oDAAoD;QACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;aAsBF,MAAM,CAAC,IAAI;;;;;CAKvB,CAAC;IACE,CAAC;IAED,oEAAoE;IACpE,OAAO;;;;;;;;;;;;;;;;;;;;;;aAsBE,MAAM,CAAC,IAAI;;;;;;;CAOvB,CAAC;AACF,CAAC"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export type { AutoDiscoverOptions } from './autoDiscover.js';
|
|
|
8
8
|
export { createDevServer, cacheBustUrl } from './DevServer.js';
|
|
9
9
|
export type { DevServerConfig, DevServer } from './DevServer.js';
|
|
10
10
|
export { startServer } from './startServer.js';
|
|
11
|
-
export type { StartServerOptions, StartServerResult } from './startServer.js';
|
|
11
|
+
export type { StartServerOptions, StartServerResult, ServerTransport } from './startServer.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,cAAc,EACd,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,GAC3D,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAA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AC"}
|
|
@@ -6,15 +6,22 @@
|
|
|
6
6
|
* 2. Attaches the tool registry with telemetry
|
|
7
7
|
* 3. Builds the topology for Inspector TUI auto-discovery
|
|
8
8
|
* 4. Starts the Telemetry Bus (IPC)
|
|
9
|
-
* 5. Connects the stdio
|
|
9
|
+
* 5. Connects the transport (stdio or Streamable HTTP)
|
|
10
|
+
*
|
|
11
|
+
* Supports both `stdio` and `http` transports:
|
|
12
|
+
* - `stdio` (default): connects via stdin/stdout
|
|
13
|
+
* - `http`: starts an HTTP server with session management
|
|
10
14
|
*
|
|
11
15
|
* @module
|
|
12
16
|
*/
|
|
17
|
+
import { type Server as HttpServer } from 'node:http';
|
|
13
18
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
14
19
|
import { type AttachOptions } from './ServerAttachment.js';
|
|
15
20
|
import { type TelemetryBusInstance } from '../observability/TelemetryBus.js';
|
|
16
21
|
import type { PromptRegistry } from '../prompt/PromptRegistry.js';
|
|
17
22
|
import type { ProgressSink } from '../core/execution/ProgressHelper.js';
|
|
23
|
+
/** Transport layer for the server. */
|
|
24
|
+
export type ServerTransport = 'stdio' | 'http';
|
|
18
25
|
/** Options for `startServer`. */
|
|
19
26
|
export interface StartServerOptions<TContext> {
|
|
20
27
|
/** Server display name (shown in MCP clients and Inspector). */
|
|
@@ -29,6 +36,18 @@ export interface StartServerOptions<TContext> {
|
|
|
29
36
|
readonly contextFactory?: (extra: unknown) => TContext | Promise<TContext>;
|
|
30
37
|
/** Enable Inspector TUI telemetry (default: true). */
|
|
31
38
|
readonly telemetry?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Transport layer: `'stdio'` (default) or `'http'` (Streamable HTTP).
|
|
41
|
+
*
|
|
42
|
+
* - `stdio` — connects via stdin/stdout (for Cursor, Claude Desktop)
|
|
43
|
+
* - `http` — starts an HTTP server with session management on `/mcp`
|
|
44
|
+
*/
|
|
45
|
+
readonly transport?: ServerTransport;
|
|
46
|
+
/**
|
|
47
|
+
* Port for the HTTP server (only used when `transport: 'http'`).
|
|
48
|
+
* @default 3001
|
|
49
|
+
*/
|
|
50
|
+
readonly port?: number;
|
|
32
51
|
/** Extra attach options (debug, tracing, zeroTrust, etc.). */
|
|
33
52
|
readonly attach?: Omit<AttachOptions<TContext>, 'contextFactory' | 'prompts' | 'telemetry'>;
|
|
34
53
|
}
|
|
@@ -53,6 +72,8 @@ export interface StartServerResult {
|
|
|
53
72
|
readonly server: InstanceType<typeof Server> | null;
|
|
54
73
|
/** The Telemetry Bus (if enabled). */
|
|
55
74
|
readonly bus?: TelemetryBusInstance;
|
|
75
|
+
/** The HTTP server instance (only present when `transport: 'http'`). */
|
|
76
|
+
readonly httpServer?: HttpServer;
|
|
56
77
|
/** Gracefully shut down everything. */
|
|
57
78
|
readonly close: () => Promise<void>;
|
|
58
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.d.ts","sourceRoot":"","sources":["../../src/server/startServer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"startServer.d.ts","sourceRoot":"","sources":["../../src/server/startServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAoC,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,OAAO,EAAkB,KAAK,aAAa,EAAwB,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAMxE,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,iCAAiC;AACjC,MAAM,WAAW,kBAAkB,CAAC,QAAQ;IACxC,gEAAgE;IAChE,Q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,cAAc,IAAI,MAAM,EAAE,CAAC;IAC3B,mBAAmB,IAAI,OAAO,CAAC;CAClC;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC;IACpD,sCAAsC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC;IACpC,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjC,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EACtC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACtC,OAAO,CAAC,iBAAiB,CAAC,CAwQ5B"}
|
|
@@ -6,12 +6,18 @@
|
|
|
6
6
|
* 2. Attaches the tool registry with telemetry
|
|
7
7
|
* 3. Builds the topology for Inspector TUI auto-discovery
|
|
8
8
|
* 4. Starts the Telemetry Bus (IPC)
|
|
9
|
-
* 5. Connects the stdio
|
|
9
|
+
* 5. Connects the transport (stdio or Streamable HTTP)
|
|
10
|
+
*
|
|
11
|
+
* Supports both `stdio` and `http` transports:
|
|
12
|
+
* - `stdio` (default): connects via stdin/stdout
|
|
13
|
+
* - `http`: starts an HTTP server with session management
|
|
10
14
|
*
|
|
11
15
|
* @module
|
|
12
16
|
*/
|
|
17
|
+
import { createServer as createHttpServer } from 'node:http';
|
|
13
18
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
14
19
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
20
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
15
21
|
import { attachToServer, _missingContextProxy } from './ServerAttachment.js';
|
|
16
22
|
import { createTelemetryBus } from '../observability/TelemetryBus.js';
|
|
17
23
|
// ============================================================================
|
|
@@ -38,7 +44,7 @@ import { createTelemetryBus } from '../observability/TelemetryBus.js';
|
|
|
38
44
|
* ```
|
|
39
45
|
*/
|
|
40
46
|
export async function startServer(options) {
|
|
41
|
-
const { name, version = '1.0.0', registry, prompts, contextFactory, telemetry = true, attach = {}, } = options;
|
|
47
|
+
const { name, version = '1.0.0', registry, prompts, contextFactory, telemetry = true, transport = 'stdio', port = 3001, attach = {}, } = options;
|
|
42
48
|
// ── Vinkius Cloud Edge Detection ─────────────────────────────────────
|
|
43
49
|
// When running inside a V8 Isolate, the host injects
|
|
44
50
|
// __vinkius_edge_interceptor into globalThis. If present:
|
|
@@ -176,9 +182,96 @@ export async function startServer(options) {
|
|
|
176
182
|
...(prompts ? { prompts } : {}),
|
|
177
183
|
...(bus ? { telemetry: bus.emit } : {}),
|
|
178
184
|
});
|
|
179
|
-
// 4. Connect
|
|
180
|
-
|
|
181
|
-
|
|
185
|
+
// 4. Connect Transport
|
|
186
|
+
if (transport === 'http') {
|
|
187
|
+
// ── Streamable HTTP Transport ────────────────────────
|
|
188
|
+
const sessions = new Map();
|
|
189
|
+
const httpServer = createHttpServer(async (req, res) => {
|
|
190
|
+
try {
|
|
191
|
+
const url = new URL(req.url ?? '/', `http://localhost:${port}`);
|
|
192
|
+
if (url.pathname !== '/mcp') {
|
|
193
|
+
res.writeHead(404).end();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (req.method === 'POST') {
|
|
197
|
+
const chunks = [];
|
|
198
|
+
for await (const chunk of req)
|
|
199
|
+
chunks.push(chunk);
|
|
200
|
+
const body = JSON.parse(Buffer.concat(chunks).toString());
|
|
201
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
202
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
203
|
+
const t = sessions.get(sessionId);
|
|
204
|
+
await t.handleRequest(req, res, body);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const t = new StreamableHTTPServerTransport({
|
|
208
|
+
sessionIdGenerator: () => crypto.randomUUID(),
|
|
209
|
+
onsessioninitialized: (id) => {
|
|
210
|
+
sessions.set(id, t);
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
t.onclose = () => {
|
|
214
|
+
const id = [...sessions.entries()].find(([, s]) => s === t)?.[0];
|
|
215
|
+
if (id)
|
|
216
|
+
sessions.delete(id);
|
|
217
|
+
};
|
|
218
|
+
await server.connect(t);
|
|
219
|
+
await t.handleRequest(req, res, body);
|
|
220
|
+
}
|
|
221
|
+
else if (req.method === 'GET') {
|
|
222
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
223
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
224
|
+
const t = sessions.get(sessionId);
|
|
225
|
+
await t.handleRequest(req, res);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
res.writeHead(400).end('Missing or invalid session');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (req.method === 'DELETE') {
|
|
232
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
233
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
234
|
+
const t = sessions.get(sessionId);
|
|
235
|
+
await t.handleRequest(req, res);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
res.writeHead(400).end('Missing or invalid session');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
res.writeHead(405).end();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
catch (err) {
|
|
246
|
+
console.error('[Vurb] Unhandled error in HTTP handler:', err);
|
|
247
|
+
if (!res.headersSent)
|
|
248
|
+
res.writeHead(500).end();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
httpServer.listen(port, () => {
|
|
252
|
+
process.stderr.write(`⚡ ${name} on http://localhost:${port}/mcp\n`);
|
|
253
|
+
});
|
|
254
|
+
async function close() {
|
|
255
|
+
if (bus)
|
|
256
|
+
await bus.close();
|
|
257
|
+
for (const t of sessions.values()) {
|
|
258
|
+
try {
|
|
259
|
+
await t.close();
|
|
260
|
+
}
|
|
261
|
+
catch { /* best effort */ }
|
|
262
|
+
}
|
|
263
|
+
sessions.clear();
|
|
264
|
+
await new Promise((resolve) => httpServer.close(() => resolve()));
|
|
265
|
+
await server.close();
|
|
266
|
+
}
|
|
267
|
+
const result = { server, httpServer, close };
|
|
268
|
+
if (bus)
|
|
269
|
+
result.bus = bus;
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
// ── Stdio Transport (default) ────────────────────────────
|
|
273
|
+
const stdioTransport = new StdioServerTransport();
|
|
274
|
+
await server.connect(stdioTransport);
|
|
182
275
|
process.stderr.write(`⚡ ${name} running on stdio\n`);
|
|
183
276
|
// 5. Close helper
|
|
184
277
|
async function close() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/server/startServer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/server/startServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAA6B,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,cAAc,EAAsB,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAA6B,MAAM,kCAAkC,CAAC;AA8EjG,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC7B,OAAqC;IAErC,MAAM,EACF,IAAI,EACJ,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the Model Context Protocol. Structured perception packages with Presenters, cognitive guardrails, self-healing errors, action consolidation, and tRPC-style type safety — so AI agents perceive and act on your data deterministically.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|