@lushly-dev/afd-server 0.6.0 → 2.0.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/README.md +320 -14
- package/dist/bootstrap/afd-context.d.ts +11 -2
- package/dist/bootstrap/afd-context.d.ts.map +1 -1
- package/dist/bootstrap/afd-context.js +56 -11
- package/dist/bootstrap/afd-context.js.map +1 -1
- package/dist/bootstrap/afd-docs.d.ts +6 -3
- package/dist/bootstrap/afd-docs.d.ts.map +1 -1
- package/dist/bootstrap/afd-docs.js +14 -9
- package/dist/bootstrap/afd-docs.js.map +1 -1
- package/dist/bootstrap/afd-help.d.ts +6 -3
- package/dist/bootstrap/afd-help.d.ts.map +1 -1
- package/dist/bootstrap/afd-help.js +10 -8
- package/dist/bootstrap/afd-help.js.map +1 -1
- package/dist/bootstrap/afd-schema.d.ts +8 -4
- package/dist/bootstrap/afd-schema.d.ts.map +1 -1
- package/dist/bootstrap/afd-schema.js +55 -42
- package/dist/bootstrap/afd-schema.js.map +1 -1
- package/dist/bootstrap/described-command.d.ts +32 -0
- package/dist/bootstrap/described-command.d.ts.map +1 -0
- package/dist/bootstrap/described-command.js +12 -0
- package/dist/bootstrap/described-command.js.map +1 -0
- package/dist/bootstrap/index.d.ts +1 -0
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/json-schema-to-ts.d.ts +27 -0
- package/dist/bootstrap/json-schema-to-ts.d.ts.map +1 -0
- package/dist/bootstrap/json-schema-to-ts.js +154 -0
- package/dist/bootstrap/json-schema-to-ts.js.map +1 -0
- package/dist/bootstrap/registry.d.ts +17 -6
- package/dist/bootstrap/registry.d.ts.map +1 -1
- package/dist/bootstrap/registry.js +32 -5
- package/dist/bootstrap/registry.js.map +1 -1
- package/dist/command-names.d.ts +19 -0
- package/dist/command-names.d.ts.map +1 -0
- package/dist/command-names.js +33 -0
- package/dist/command-names.js.map +1 -0
- package/dist/command-routing.d.ts +47 -0
- package/dist/command-routing.d.ts.map +1 -0
- package/dist/command-routing.js +75 -0
- package/dist/command-routing.js.map +1 -0
- package/dist/context-scope.d.ts +26 -0
- package/dist/context-scope.d.ts.map +1 -0
- package/dist/context-scope.js +31 -0
- package/dist/context-scope.js.map +1 -0
- package/dist/define.d.ts +42 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +41 -0
- package/dist/define.js.map +1 -0
- package/dist/direct-registry.d.ts +103 -0
- package/dist/direct-registry.d.ts.map +1 -0
- package/dist/direct-registry.js +102 -0
- package/dist/direct-registry.js.map +1 -0
- package/dist/execution.d.ts +9 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +105 -321
- package/dist/execution.js.map +1 -1
- package/dist/http-handler.d.ts +24 -17
- package/dist/http-handler.d.ts.map +1 -1
- package/dist/http-handler.js +282 -253
- package/dist/http-handler.js.map +1 -1
- package/dist/http-security.d.ts +23 -0
- package/dist/http-security.d.ts.map +1 -0
- package/dist/http-security.js +101 -0
- package/dist/http-security.js.map +1 -0
- package/dist/http-sessions.d.ts +33 -0
- package/dist/http-sessions.d.ts.map +1 -0
- package/dist/http-sessions.js +65 -0
- package/dist/http-sessions.js.map +1 -0
- package/dist/http-sse.d.ts +30 -0
- package/dist/http-sse.d.ts.map +1 -0
- package/dist/http-sse.js +70 -0
- package/dist/http-sse.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/json-rpc.d.ts +56 -0
- package/dist/json-rpc.d.ts.map +1 -0
- package/dist/json-rpc.js +73 -0
- package/dist/json-rpc.js.map +1 -0
- package/dist/lazy-tools.d.ts +2 -12
- package/dist/lazy-tools.d.ts.map +1 -1
- package/dist/lazy-tools.js +9 -14
- package/dist/lazy-tools.js.map +1 -1
- package/dist/meta-tools.d.ts +122 -0
- package/dist/meta-tools.d.ts.map +1 -0
- package/dist/meta-tools.js +156 -0
- package/dist/meta-tools.js.map +1 -0
- package/dist/middleware.d.ts +34 -7
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +82 -40
- package/dist/middleware.js.map +1 -1
- package/dist/schema.d.ts +27 -6
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +17 -12
- package/dist/schema.js.map +1 -1
- package/dist/server-types.d.ts +100 -13
- package/dist/server-types.d.ts.map +1 -1
- package/dist/server-types.js.map +1 -1
- package/dist/server.d.ts +10 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +165 -48
- package/dist/server.js.map +1 -1
- package/dist/tool-router.d.ts +6 -5
- package/dist/tool-router.d.ts.map +1 -1
- package/dist/tool-router.js +104 -120
- package/dist/tool-router.js.map +1 -1
- package/dist/tools.d.ts +10 -420
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +99 -208
- package/dist/tools.js.map +1 -1
- package/package.json +13 -8
package/dist/server.d.ts
CHANGED
|
@@ -4,9 +4,17 @@
|
|
|
4
4
|
* This module provides the `createMcpServer` factory that wires together
|
|
5
5
|
* execution, tool routing, and transport layers into a single MCP server.
|
|
6
6
|
*/
|
|
7
|
-
import type { McpServer, McpServerOptions } from './server-types.js';
|
|
8
|
-
export type { CommandMiddleware, ContextConfig, McpServer, McpServerOptions, McpTransport, } from './server-types.js';
|
|
7
|
+
import type { McpHandler, McpHandlerOptions, McpServer, McpServerOptions } from './server-types.js';
|
|
8
|
+
export type { CommandMiddleware, ContextConfig, CreateRequestContext, McpHandler, McpHandlerOptions, McpServer, McpServerOptions, McpTransport, } from './server-types.js';
|
|
9
9
|
export { isStdinPiped } from './server-types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create an embeddable Node HTTP handler for MCP endpoints.
|
|
12
|
+
*
|
|
13
|
+
* Unlike `createMcpServer()`, this does not create or start an HTTP server.
|
|
14
|
+
* The caller owns the server lifecycle and can attach the returned handler to
|
|
15
|
+
* any Node HTTP host that accepts `(req, res) => Promise<void>`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createMcpHandler(options: McpHandlerOptions): McpHandler;
|
|
10
18
|
/**
|
|
11
19
|
* Create an MCP server from Zod-defined commands.
|
|
12
20
|
*
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuBH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKpG,YAAY,EACX,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAuJjD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAGvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA8JpE"}
|
package/dist/server.js
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
* execution, tool routing, and transport layers into a single MCP server.
|
|
6
6
|
*/
|
|
7
7
|
import { createServer } from 'node:http';
|
|
8
|
+
import { isMcpExposed } from '@lushly-dev/afd-core';
|
|
8
9
|
import { Server as McpSdkServer } from '@modelcontextprotocol/sdk/server/index.js';
|
|
9
10
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
10
11
|
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
11
|
-
import {
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { createAfdContextEnterCommand, createAfdContextExitCommand, createAfdContextListCommand, createContextState, } from './bootstrap/afd-context.js';
|
|
14
|
+
import { getBootstrapCommands } from './bootstrap/registry.js';
|
|
15
|
+
import { assertValidCommandNames } from './command-names.js';
|
|
16
|
+
import { filterByContext } from './command-routing.js';
|
|
17
|
+
import { resolveContextState } from './context-scope.js';
|
|
12
18
|
import { createExecutionEngine } from './execution.js';
|
|
13
19
|
import { createHttpHandler } from './http-handler.js';
|
|
20
|
+
import { createSessionStore } from './http-sessions.js';
|
|
21
|
+
import { defineCommand } from './schema.js';
|
|
14
22
|
import { isStdinPiped } from './server-types.js';
|
|
15
23
|
import { createToolRouter } from './tool-router.js';
|
|
16
24
|
import { getToolsList } from './tools.js';
|
|
@@ -19,6 +27,128 @@ export { isStdinPiped } from './server-types.js';
|
|
|
19
27
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
20
28
|
// SERVER FACTORY
|
|
21
29
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
30
|
+
function createSharedHttpRuntime(options) {
|
|
31
|
+
const { name, version, commands, port = 3100, host = 'localhost', devMode = false, cors = devMode, middleware = [], onCommand, onError, toolStrategy = 'grouped', groupByFn, contexts, bootstrap = false, } = options;
|
|
32
|
+
assertValidCommandNames(commands, { bootstrap, contexts: Boolean(contexts?.length) });
|
|
33
|
+
// stdio serves one client, so it uses this single state. HTTP callers each get a session
|
|
34
|
+
// state (or none), bound to their command context by the HTTP handler.
|
|
35
|
+
const contextState = contexts?.length ? createContextState() : undefined;
|
|
36
|
+
const sessions = contextState
|
|
37
|
+
? createSessionStore({
|
|
38
|
+
maxSessions: options.maxSessions,
|
|
39
|
+
idleTimeoutMs: options.sessionIdleTimeoutMs,
|
|
40
|
+
})
|
|
41
|
+
: undefined;
|
|
42
|
+
const registeredCommands = [...commands];
|
|
43
|
+
if (contextState && contexts) {
|
|
44
|
+
const getContexts = () => [...contexts];
|
|
45
|
+
const builtins = [
|
|
46
|
+
defineCommand({
|
|
47
|
+
...createAfdContextListCommand(getContexts, contextState),
|
|
48
|
+
input: z.object({}),
|
|
49
|
+
expose: { mcp: true },
|
|
50
|
+
}),
|
|
51
|
+
defineCommand({
|
|
52
|
+
...createAfdContextEnterCommand(getContexts, contextState),
|
|
53
|
+
input: z.object({ context: z.string().min(1) }),
|
|
54
|
+
expose: { mcp: true },
|
|
55
|
+
}),
|
|
56
|
+
defineCommand({
|
|
57
|
+
...createAfdContextExitCommand(contextState),
|
|
58
|
+
input: z.object({}),
|
|
59
|
+
expose: { mcp: true },
|
|
60
|
+
}),
|
|
61
|
+
];
|
|
62
|
+
for (const command of builtins) {
|
|
63
|
+
if (registeredCommands.some((existing) => existing.name === command.name)) {
|
|
64
|
+
throw new Error(`Reserved context command name: ${command.name}`);
|
|
65
|
+
}
|
|
66
|
+
registeredCommands.push(command);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (bootstrap) {
|
|
70
|
+
// afd-help/afd-docs/afd-schema describe what a remote agent can see and call:
|
|
71
|
+
// MCP-exposed commands in the active context (built-ins included).
|
|
72
|
+
// The caller's context state: the HTTP session's, or the single stdio state.
|
|
73
|
+
const describe = (context) => filterByContext(remoteCommands, resolveContextState(context, contextState)?.getActive());
|
|
74
|
+
registeredCommands.push(...getBootstrapCommands(describe));
|
|
75
|
+
}
|
|
76
|
+
const commandMap = new Map();
|
|
77
|
+
for (const cmd of registeredCommands) {
|
|
78
|
+
commandMap.set(cmd.name, cmd);
|
|
79
|
+
}
|
|
80
|
+
const engine = createExecutionEngine({
|
|
81
|
+
commandMap,
|
|
82
|
+
middleware,
|
|
83
|
+
devMode,
|
|
84
|
+
onCommand,
|
|
85
|
+
onError,
|
|
86
|
+
});
|
|
87
|
+
const remoteCommands = registeredCommands.filter((command) => isMcpExposed(command));
|
|
88
|
+
const remoteEngine = createExecutionEngine({
|
|
89
|
+
commandMap: new Map(remoteCommands.map((command) => [command.name, command])),
|
|
90
|
+
middleware,
|
|
91
|
+
devMode,
|
|
92
|
+
onCommand,
|
|
93
|
+
onError,
|
|
94
|
+
contextState,
|
|
95
|
+
});
|
|
96
|
+
const exposedCommandNames = new Set(remoteCommands.map((c) => c.name));
|
|
97
|
+
const mutationNames = new Set(remoteCommands.filter((command) => command.mutation === true).map((command) => command.name));
|
|
98
|
+
const routeToolCall = createToolRouter({
|
|
99
|
+
executeCommand: remoteEngine.executeCommand,
|
|
100
|
+
executeBatch: remoteEngine.executeBatch,
|
|
101
|
+
executePipeline: remoteEngine.executePipeline,
|
|
102
|
+
commands: remoteCommands,
|
|
103
|
+
toolStrategy,
|
|
104
|
+
groupByFn,
|
|
105
|
+
devMode,
|
|
106
|
+
allCommands: remoteCommands,
|
|
107
|
+
exposedCommandNames,
|
|
108
|
+
contextState,
|
|
109
|
+
});
|
|
110
|
+
const boundGetToolsList = (context = {}) => getToolsList(remoteCommands, toolStrategy, groupByFn, resolveContextState(context, contextState)?.getActive());
|
|
111
|
+
const { handler, dispose } = createHttpHandler({
|
|
112
|
+
name,
|
|
113
|
+
version,
|
|
114
|
+
host,
|
|
115
|
+
port,
|
|
116
|
+
cors,
|
|
117
|
+
devMode,
|
|
118
|
+
allowedHosts: options.allowedHosts,
|
|
119
|
+
allowedOrigins: options.allowedOrigins,
|
|
120
|
+
maxBodyBytes: options.maxBodyBytes,
|
|
121
|
+
maxSseConnections: options.maxSseConnections,
|
|
122
|
+
getToolsList: boundGetToolsList,
|
|
123
|
+
routeToolCall,
|
|
124
|
+
executeCommand: remoteEngine.executeCommand,
|
|
125
|
+
executeBatch: remoteEngine.executeBatch,
|
|
126
|
+
executeStream: remoteEngine.executeStream,
|
|
127
|
+
isMutation: (commandName) => mutationNames.has(commandName),
|
|
128
|
+
sessions,
|
|
129
|
+
createContext: options.createContext,
|
|
130
|
+
onError,
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
engine,
|
|
134
|
+
routeToolCall,
|
|
135
|
+
getToolsList: boundGetToolsList,
|
|
136
|
+
handler,
|
|
137
|
+
dispose,
|
|
138
|
+
url: `http://${host}:${port}`,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Create an embeddable Node HTTP handler for MCP endpoints.
|
|
143
|
+
*
|
|
144
|
+
* Unlike `createMcpServer()`, this does not create or start an HTTP server.
|
|
145
|
+
* The caller owns the server lifecycle and can attach the returned handler to
|
|
146
|
+
* any Node HTTP host that accepts `(req, res) => Promise<void>`.
|
|
147
|
+
*/
|
|
148
|
+
export function createMcpHandler(options) {
|
|
149
|
+
const runtime = createSharedHttpRuntime(options);
|
|
150
|
+
return Object.assign(runtime.handler, { dispose: runtime.dispose });
|
|
151
|
+
}
|
|
22
152
|
/**
|
|
23
153
|
* Create an MCP server from Zod-defined commands.
|
|
24
154
|
*
|
|
@@ -37,14 +167,14 @@ export { isStdinPiped } from './server-types.js';
|
|
|
37
167
|
* ```
|
|
38
168
|
*/
|
|
39
169
|
export function createMcpServer(options) {
|
|
40
|
-
const { name, version, commands, port = 3100, host = 'localhost', devMode = false, cors = devMode, transport = 'auto',
|
|
41
|
-
// ── Context state (when contexts are configured) ─────────────────────────
|
|
42
|
-
const contextState = contexts?.length ? createContextState() : undefined;
|
|
170
|
+
const { name, version, commands, port = 3100, host = 'localhost', devMode = false, cors = devMode, transport = 'auto', middleware = [], onCommand, onError, toolStrategy = 'grouped', groupByFn, contexts, } = options;
|
|
43
171
|
// ── Transport resolution ────────────────────────────────────────────────
|
|
172
|
+
// Removed in 2.0. Fail loudly: silently ignoring it would switch `stdio: false` servers to
|
|
173
|
+
// auto-detection, which picks stdio whenever stdin is piped.
|
|
174
|
+
if ('stdio' in options) {
|
|
175
|
+
throw new Error('createMcpServer: the stdio option was removed in 2.0. Use transport: "stdio", "http" or "auto" instead.');
|
|
176
|
+
}
|
|
44
177
|
function resolveTransport() {
|
|
45
|
-
if (stdio !== undefined) {
|
|
46
|
-
return stdio ? 'stdio' : 'http';
|
|
47
|
-
}
|
|
48
178
|
if (transport === 'auto') {
|
|
49
179
|
return isStdinPiped() ? 'stdio' : 'http';
|
|
50
180
|
}
|
|
@@ -53,33 +183,24 @@ export function createMcpServer(options) {
|
|
|
53
183
|
const resolvedTransport = resolveTransport();
|
|
54
184
|
const useStdio = resolvedTransport === 'stdio';
|
|
55
185
|
const useHttp = resolvedTransport === 'http';
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
186
|
+
const autoDetected = transport === 'auto';
|
|
187
|
+
// ── Shared execution/runtime wiring ─────────────────────────────────────
|
|
188
|
+
const sharedRuntime = createSharedHttpRuntime({
|
|
189
|
+
...options,
|
|
190
|
+
name,
|
|
191
|
+
version,
|
|
192
|
+
commands,
|
|
193
|
+
port,
|
|
194
|
+
host,
|
|
65
195
|
devMode,
|
|
196
|
+
cors,
|
|
197
|
+
middleware,
|
|
66
198
|
onCommand,
|
|
67
199
|
onError,
|
|
68
|
-
});
|
|
69
|
-
const exposedCommandNames = new Set(commands.map((c) => c.name));
|
|
70
|
-
const routeToolCall = createToolRouter({
|
|
71
|
-
executeCommand: engine.executeCommand,
|
|
72
|
-
executeBatch: engine.executeBatch,
|
|
73
|
-
executePipeline: engine.executePipeline,
|
|
74
|
-
commands,
|
|
75
200
|
toolStrategy,
|
|
76
201
|
groupByFn,
|
|
77
|
-
|
|
78
|
-
allCommands: commands,
|
|
79
|
-
exposedCommandNames,
|
|
80
|
-
contextState,
|
|
202
|
+
contexts,
|
|
81
203
|
});
|
|
82
|
-
const boundGetToolsList = () => getToolsList(commands, toolStrategy, groupByFn, contextState?.getActive());
|
|
83
204
|
// ── Server state ────────────────────────────────────────────────────────
|
|
84
205
|
let httpServer = null;
|
|
85
206
|
let mcpSdkServer = null;
|
|
@@ -93,34 +214,27 @@ export function createMcpServer(options) {
|
|
|
93
214
|
if (useStdio) {
|
|
94
215
|
mcpSdkServer = new McpSdkServer({ name, version }, { capabilities: { tools: {} } });
|
|
95
216
|
mcpSdkServer.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
96
|
-
tools:
|
|
217
|
+
tools: sharedRuntime.getToolsList(),
|
|
97
218
|
}));
|
|
98
|
-
mcpSdkServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
219
|
+
mcpSdkServer.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
99
220
|
// Spread into anonymous object for MCP SDK index signature compatibility
|
|
100
|
-
return {
|
|
221
|
+
return {
|
|
222
|
+
...(await sharedRuntime.routeToolCall(request.params.name, request.params.arguments ?? {}, { signal: extra.signal, interface: 'mcp' })),
|
|
223
|
+
};
|
|
101
224
|
});
|
|
102
225
|
const stdioTransport = new StdioServerTransport();
|
|
103
226
|
await mcpSdkServer.connect(stdioTransport);
|
|
104
227
|
isRunning = true;
|
|
228
|
+
// stdout carries MCP frames, so the notice goes to stderr.
|
|
229
|
+
console.error(autoDetected
|
|
230
|
+
? `[${name}] MCP transport: stdio (auto-detected because stdin is not a TTY; set transport: 'http' to serve HTTP)`
|
|
231
|
+
: `[${name}] MCP transport: stdio`);
|
|
105
232
|
if (!useHttp)
|
|
106
233
|
return;
|
|
107
234
|
}
|
|
108
235
|
// HTTP transport
|
|
109
236
|
if (useHttp) {
|
|
110
|
-
|
|
111
|
-
name,
|
|
112
|
-
version,
|
|
113
|
-
host,
|
|
114
|
-
port,
|
|
115
|
-
cors,
|
|
116
|
-
devMode,
|
|
117
|
-
getToolsList: boundGetToolsList,
|
|
118
|
-
routeToolCall,
|
|
119
|
-
executeCommand: engine.executeCommand,
|
|
120
|
-
executeBatch: engine.executeBatch,
|
|
121
|
-
executeStream: engine.executeStream,
|
|
122
|
-
});
|
|
123
|
-
httpServer = createServer(handler);
|
|
237
|
+
httpServer = createServer(sharedRuntime.handler);
|
|
124
238
|
await new Promise((resolve, reject) => {
|
|
125
239
|
httpServer?.on('error', reject);
|
|
126
240
|
httpServer?.listen(port, host, () => {
|
|
@@ -128,6 +242,7 @@ export function createMcpServer(options) {
|
|
|
128
242
|
resolve();
|
|
129
243
|
});
|
|
130
244
|
});
|
|
245
|
+
console.error(`[${name}] MCP transport: http at ${sharedRuntime.url}${autoDetected ? ' (auto-detected because stdin is a TTY)' : ''}`);
|
|
131
246
|
}
|
|
132
247
|
},
|
|
133
248
|
async stop() {
|
|
@@ -138,6 +253,8 @@ export function createMcpServer(options) {
|
|
|
138
253
|
mcpSdkServer = null;
|
|
139
254
|
}
|
|
140
255
|
if (httpServer) {
|
|
256
|
+
sharedRuntime.dispose();
|
|
257
|
+
httpServer.closeAllConnections();
|
|
141
258
|
await new Promise((resolve, reject) => {
|
|
142
259
|
httpServer?.close((err) => {
|
|
143
260
|
if (err)
|
|
@@ -151,7 +268,7 @@ export function createMcpServer(options) {
|
|
|
151
268
|
isRunning = false;
|
|
152
269
|
},
|
|
153
270
|
getUrl() {
|
|
154
|
-
return useHttp ?
|
|
271
|
+
return useHttp ? sharedRuntime.url : 'stdio://';
|
|
155
272
|
},
|
|
156
273
|
getCommands() {
|
|
157
274
|
return commands;
|
|
@@ -159,8 +276,8 @@ export function createMcpServer(options) {
|
|
|
159
276
|
getTransport() {
|
|
160
277
|
return resolvedTransport;
|
|
161
278
|
},
|
|
162
|
-
execute: engine.executeCommand,
|
|
163
|
-
executePipeline: engine.executePipeline,
|
|
279
|
+
execute: sharedRuntime.engine.executeCommand,
|
|
280
|
+
executePipeline: sharedRuntime.engine.executePipeline,
|
|
164
281
|
};
|
|
165
282
|
}
|
|
166
283
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAA6B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAE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ACZ,IAAI,IAAI,4BAA4B,aAAa,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,EAAE,EAAE,CACvH,CAAC;YACH,CAAC;QACF,CAAC;QAED,KAAK,CAAC,IAAI;YACT,IAAI,CAAC,SAAS;gBAAE,OAAO;YAEvB,IAAI,YAAY,EAAE,CAAC;gBAClB,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;gBAC3B,YAAY,GAAG,IAAI,CAAC;YACrB,CAAC;YAED,IAAI,UAAU,EAAE,CAAC;gBAChB,aAAa,CAAC,OAAO,EAAE,CAAC;gBACxB,UAAU,CAAC,mBAAmB,EAAE,CAAC;gBACjC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC3C,UAAU,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;wBACzB,IAAI,GAAG;4BAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;4BAChB,OAAO,EAAE,CAAC;oBAChB,CAAC,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC;gBACH,UAAU,GAAG,IAAI,CAAC;YACnB,CAAC;YAED,SAAS,GAAG,KAAK,CAAC;QACnB,CAAC;QAED,MAAM;YACL,OAAO,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC;QACjD,CAAC;QAED,WAAW;YACV,OAAO,QAAQ,CAAC;QACjB,CAAC;QAED,YAAY;YACX,OAAO,iBAAiB,CAAC;QAC1B,CAAC;QAED,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,cAAc;QAC5C,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,eAAe;KACrD,CAAC;AACH,CAAC"}
|
package/dist/tool-router.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* Used by both stdio and HTTP transports to eliminate routing duplication.
|
|
6
6
|
*/
|
|
7
7
|
import type { BatchRequest, BatchResult, CommandContext, CommandResult, PipelineRequest, PipelineResult } from '@lushly-dev/afd-core';
|
|
8
|
+
import type { ContextState } from './bootstrap/afd-context.js';
|
|
9
|
+
import { type GroupByFn } from './command-routing.js';
|
|
8
10
|
import type { ZodCommandDefinition } from './schema.js';
|
|
9
11
|
export interface ToolCallResult {
|
|
10
12
|
content: Array<{
|
|
@@ -19,18 +21,17 @@ export interface ToolRouterDeps {
|
|
|
19
21
|
executePipeline: (request: PipelineRequest, context?: CommandContext) => Promise<PipelineResult>;
|
|
20
22
|
commands: ZodCommandDefinition[];
|
|
21
23
|
toolStrategy: 'individual' | 'grouped' | 'lazy';
|
|
22
|
-
groupByFn?:
|
|
24
|
+
groupByFn?: GroupByFn;
|
|
23
25
|
devMode: boolean;
|
|
24
26
|
/** All registered commands, including those outside the commands array */
|
|
25
27
|
allCommands?: ZodCommandDefinition[];
|
|
26
28
|
/** Set of command names exposed via the server's commands array */
|
|
27
29
|
exposedCommandNames?: Set<string>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
30
|
+
/** Context state used when the call context carries none (stdio and tests). */
|
|
31
|
+
contextState?: ContextState;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Create a tool call router that dispatches to the appropriate execution function.
|
|
34
35
|
*/
|
|
35
|
-
export declare function createToolRouter(deps: ToolRouterDeps): (toolName: string, args: unknown) => Promise<ToolCallResult>;
|
|
36
|
+
export declare function createToolRouter(deps: ToolRouterDeps): (toolName: string, args: unknown, callContext?: CommandContext) => Promise<ToolCallResult>;
|
|
36
37
|
//# sourceMappingURL=tool-router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-router.d.ts","sourceRoot":"","sources":["../src/tool-router.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,MAAM,sBAAsB,CAAC;
|
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