fastmcp 1.23.0 → 1.23.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.
- package/dist/FastMCP.d.ts +165 -165
- package/dist/FastMCP.js +275 -275
- package/dist/FastMCP.js.map +1 -1
- package/dist/bin/fastmcp.js +9 -9
- package/dist/bin/fastmcp.js.map +1 -1
- package/eslint.config.ts +14 -0
- package/jsr.json +1 -1
- package/package.json +6 -1
- package/src/FastMCP.test.ts +398 -396
- package/src/FastMCP.ts +498 -498
- package/src/bin/fastmcp.ts +7 -7
- package/src/examples/addition.ts +25 -24
- package/eslint.config.js +0 -3
package/dist/FastMCP.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
3
|
import { AudioContent, Root, ClientCapabilities, CreateMessageRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
3
4
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { StrictEventEmitter } from 'strict-event-emitter-types';
|
|
6
5
|
import { EventEmitter } from 'events';
|
|
7
|
-
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
8
6
|
import http from 'http';
|
|
7
|
+
import { StrictEventEmitter } from 'strict-event-emitter-types';
|
|
8
|
+
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
type SSEServer = {
|
|
11
11
|
close: () => Promise<void>;
|
|
@@ -19,49 +19,43 @@ type FastMCPEvents<T extends FastMCPSessionAuth> = {
|
|
|
19
19
|
}) => void;
|
|
20
20
|
};
|
|
21
21
|
type FastMCPSessionEvents = {
|
|
22
|
-
rootsChanged: (event: {
|
|
23
|
-
roots: Root[];
|
|
24
|
-
}) => void;
|
|
25
22
|
error: (event: {
|
|
26
23
|
error: Error;
|
|
27
24
|
}) => void;
|
|
25
|
+
rootsChanged: (event: {
|
|
26
|
+
roots: Root[];
|
|
27
|
+
}) => void;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* Generates an image content object from a URL, file path, or buffer.
|
|
31
31
|
*/
|
|
32
32
|
declare const imageContent: (input: {
|
|
33
|
-
|
|
33
|
+
buffer: Buffer;
|
|
34
34
|
} | {
|
|
35
35
|
path: string;
|
|
36
36
|
} | {
|
|
37
|
-
|
|
37
|
+
url: string;
|
|
38
38
|
}) => Promise<ImageContent>;
|
|
39
39
|
declare const audioContent: (input: {
|
|
40
|
-
|
|
40
|
+
buffer: Buffer;
|
|
41
41
|
} | {
|
|
42
42
|
path: string;
|
|
43
43
|
} | {
|
|
44
|
-
|
|
44
|
+
url: string;
|
|
45
45
|
}) => Promise<AudioContent>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
type Context<T extends FastMCPSessionAuth> = {
|
|
47
|
+
log: {
|
|
48
|
+
debug: (message: string, data?: SerializableValue) => void;
|
|
49
|
+
error: (message: string, data?: SerializableValue) => void;
|
|
50
|
+
info: (message: string, data?: SerializableValue) => void;
|
|
51
|
+
warn: (message: string, data?: SerializableValue) => void;
|
|
52
|
+
};
|
|
53
|
+
reportProgress: (progress: Progress) => Promise<void>;
|
|
54
|
+
session: T | undefined;
|
|
55
|
+
};
|
|
49
56
|
type Extra = unknown;
|
|
50
57
|
type Extras = Record<string, Extra>;
|
|
51
|
-
declare class UnexpectedStateError extends FastMCPError {
|
|
52
|
-
extras?: Extras;
|
|
53
|
-
constructor(message: string, extras?: Extras);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* An error that is meant to be surfaced to the user.
|
|
57
|
-
*/
|
|
58
|
-
declare class UserError extends UnexpectedStateError {
|
|
59
|
-
}
|
|
60
|
-
type ToolParameters = StandardSchemaV1;
|
|
61
58
|
type Literal = boolean | null | number | string | undefined;
|
|
62
|
-
type SerializableValue = Literal | SerializableValue[] | {
|
|
63
|
-
[key: string]: SerializableValue;
|
|
64
|
-
};
|
|
65
59
|
type Progress = {
|
|
66
60
|
/**
|
|
67
61
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
@@ -72,126 +66,82 @@ type Progress = {
|
|
|
72
66
|
*/
|
|
73
67
|
total?: number;
|
|
74
68
|
};
|
|
75
|
-
type
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
log: {
|
|
79
|
-
debug: (message: string, data?: SerializableValue) => void;
|
|
80
|
-
error: (message: string, data?: SerializableValue) => void;
|
|
81
|
-
info: (message: string, data?: SerializableValue) => void;
|
|
82
|
-
warn: (message: string, data?: SerializableValue) => void;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
69
|
+
type SerializableValue = {
|
|
70
|
+
[key: string]: SerializableValue;
|
|
71
|
+
} | Literal | SerializableValue[];
|
|
85
72
|
type TextContent = {
|
|
86
|
-
type: "text";
|
|
87
73
|
text: string;
|
|
74
|
+
type: "text";
|
|
88
75
|
};
|
|
76
|
+
type ToolParameters = StandardSchemaV1;
|
|
77
|
+
declare abstract class FastMCPError extends Error {
|
|
78
|
+
constructor(message?: string);
|
|
79
|
+
}
|
|
80
|
+
declare class UnexpectedStateError extends FastMCPError {
|
|
81
|
+
extras?: Extras;
|
|
82
|
+
constructor(message: string, extras?: Extras);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* An error that is meant to be surfaced to the user.
|
|
86
|
+
*/
|
|
87
|
+
declare class UserError extends UnexpectedStateError {
|
|
88
|
+
}
|
|
89
89
|
type ImageContent = {
|
|
90
|
-
type: "image";
|
|
91
90
|
data: string;
|
|
92
91
|
mimeType: string;
|
|
92
|
+
type: "image";
|
|
93
93
|
};
|
|
94
|
-
type Content =
|
|
94
|
+
type Content = ImageContent | TextContent;
|
|
95
95
|
type ContentResult = {
|
|
96
96
|
content: Content[];
|
|
97
97
|
isError?: boolean;
|
|
98
98
|
};
|
|
99
99
|
type Completion = {
|
|
100
|
-
values: string[];
|
|
101
|
-
total?: number;
|
|
102
100
|
hasMore?: boolean;
|
|
101
|
+
total?: number;
|
|
102
|
+
values: string[];
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
*/
|
|
108
|
-
type ToolAnnotations = {
|
|
109
|
-
/**
|
|
110
|
-
* A human-readable title for the tool, useful for UI display
|
|
111
|
-
*/
|
|
112
|
-
title?: string;
|
|
113
|
-
/**
|
|
114
|
-
* If true, indicates the tool does not modify its environment
|
|
115
|
-
* @default false
|
|
116
|
-
*/
|
|
117
|
-
readOnlyHint?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* If true, the tool may perform destructive updates
|
|
120
|
-
* Only meaningful when readOnlyHint is false
|
|
121
|
-
* @default true
|
|
122
|
-
*/
|
|
123
|
-
destructiveHint?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* If true, calling the tool repeatedly with the same arguments has no additional effect
|
|
126
|
-
* Only meaningful when readOnlyHint is false
|
|
127
|
-
* @default false
|
|
128
|
-
*/
|
|
129
|
-
idempotentHint?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* If true, the tool may interact with an "open world" of external entities
|
|
132
|
-
* @default true
|
|
133
|
-
*/
|
|
134
|
-
openWorldHint?: boolean;
|
|
135
|
-
};
|
|
136
|
-
type Tool<T extends FastMCPSessionAuth, Params extends ToolParameters = ToolParameters> = {
|
|
137
|
-
name: string;
|
|
104
|
+
type ArgumentValueCompleter = (value: string) => Promise<Completion>;
|
|
105
|
+
type InputPrompt<Arguments extends InputPromptArgument[] = InputPromptArgument[], Args = PromptArgumentsToObject<Arguments>> = {
|
|
106
|
+
arguments?: InputPromptArgument[];
|
|
138
107
|
description?: string;
|
|
139
|
-
|
|
140
|
-
annotations?: ToolAnnotations;
|
|
141
|
-
execute: (args: StandardSchemaV1.InferOutput<Params>, context: Context<T>) => Promise<string | ContentResult | TextContent | ImageContent | AudioContent>;
|
|
142
|
-
};
|
|
143
|
-
type ResourceResult = {
|
|
144
|
-
text: string;
|
|
145
|
-
} | {
|
|
146
|
-
blob: string;
|
|
147
|
-
};
|
|
148
|
-
type InputResourceTemplateArgument = Readonly<{
|
|
108
|
+
load: (args: Args) => Promise<string>;
|
|
149
109
|
name: string;
|
|
150
|
-
|
|
110
|
+
};
|
|
111
|
+
type InputPromptArgument = Readonly<{
|
|
151
112
|
complete?: ArgumentValueCompleter;
|
|
152
|
-
}>;
|
|
153
|
-
type ResourceTemplateArgument = Readonly<{
|
|
154
|
-
name: string;
|
|
155
113
|
description?: string;
|
|
156
|
-
|
|
157
|
-
}>;
|
|
158
|
-
type ResourceTemplate<Arguments extends ResourceTemplateArgument[] = ResourceTemplateArgument[]> = {
|
|
159
|
-
uriTemplate: string;
|
|
114
|
+
enum?: string[];
|
|
160
115
|
name: string;
|
|
161
|
-
|
|
162
|
-
|
|
116
|
+
required?: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
type InputResourceTemplate<Arguments extends ResourceTemplateArgument[] = ResourceTemplateArgument[]> = {
|
|
163
119
|
arguments: Arguments;
|
|
164
|
-
|
|
120
|
+
description?: string;
|
|
165
121
|
load: (args: ResourceTemplateArgumentsToObject<Arguments>) => Promise<ResourceResult>;
|
|
166
|
-
|
|
167
|
-
type ResourceTemplateArgumentsToObject<T extends {
|
|
122
|
+
mimeType?: string;
|
|
168
123
|
name: string;
|
|
169
|
-
}[]> = {
|
|
170
|
-
[K in T[number]["name"]]: string;
|
|
171
|
-
};
|
|
172
|
-
type InputResourceTemplate<Arguments extends ResourceTemplateArgument[] = ResourceTemplateArgument[]> = {
|
|
173
124
|
uriTemplate: string;
|
|
174
|
-
name: string;
|
|
175
|
-
description?: string;
|
|
176
|
-
mimeType?: string;
|
|
177
|
-
arguments: Arguments;
|
|
178
|
-
load: (args: ResourceTemplateArgumentsToObject<Arguments>) => Promise<ResourceResult>;
|
|
179
125
|
};
|
|
180
|
-
type
|
|
181
|
-
|
|
182
|
-
name: string;
|
|
126
|
+
type InputResourceTemplateArgument = Readonly<{
|
|
127
|
+
complete?: ArgumentValueCompleter;
|
|
183
128
|
description?: string;
|
|
184
|
-
mimeType?: string;
|
|
185
|
-
load: () => Promise<ResourceResult | ResourceResult[]>;
|
|
186
|
-
complete?: (name: string, value: string) => Promise<Completion>;
|
|
187
|
-
};
|
|
188
|
-
type ArgumentValueCompleter = (value: string) => Promise<Completion>;
|
|
189
|
-
type InputPromptArgument = Readonly<{
|
|
190
129
|
name: string;
|
|
130
|
+
}>;
|
|
131
|
+
type LoggingLevel = "alert" | "critical" | "debug" | "emergency" | "error" | "info" | "notice" | "warning";
|
|
132
|
+
type Prompt<Arguments extends PromptArgument[] = PromptArgument[], Args = PromptArgumentsToObject<Arguments>> = {
|
|
133
|
+
arguments?: PromptArgument[];
|
|
134
|
+
complete?: (name: string, value: string) => Promise<Completion>;
|
|
191
135
|
description?: string;
|
|
192
|
-
|
|
136
|
+
load: (args: Args) => Promise<string>;
|
|
137
|
+
name: string;
|
|
138
|
+
};
|
|
139
|
+
type PromptArgument = Readonly<{
|
|
193
140
|
complete?: ArgumentValueCompleter;
|
|
141
|
+
description?: string;
|
|
194
142
|
enum?: string[];
|
|
143
|
+
name: string;
|
|
144
|
+
required?: boolean;
|
|
195
145
|
}>;
|
|
196
146
|
type PromptArgumentsToObject<T extends {
|
|
197
147
|
name: string;
|
|
@@ -201,91 +151,141 @@ type PromptArgumentsToObject<T extends {
|
|
|
201
151
|
name: K;
|
|
202
152
|
}>["required"] extends true ? string : string | undefined;
|
|
203
153
|
};
|
|
204
|
-
type
|
|
205
|
-
name: string
|
|
154
|
+
type Resource = {
|
|
155
|
+
complete?: (name: string, value: string) => Promise<Completion>;
|
|
206
156
|
description?: string;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
};
|
|
210
|
-
type PromptArgument = Readonly<{
|
|
157
|
+
load: () => Promise<ResourceResult | ResourceResult[]>;
|
|
158
|
+
mimeType?: string;
|
|
211
159
|
name: string;
|
|
160
|
+
uri: string;
|
|
161
|
+
};
|
|
162
|
+
type ResourceResult = {
|
|
163
|
+
blob: string;
|
|
164
|
+
} | {
|
|
165
|
+
text: string;
|
|
166
|
+
};
|
|
167
|
+
type ResourceTemplate<Arguments extends ResourceTemplateArgument[] = ResourceTemplateArgument[]> = {
|
|
168
|
+
arguments: Arguments;
|
|
169
|
+
complete?: (name: string, value: string) => Promise<Completion>;
|
|
212
170
|
description?: string;
|
|
213
|
-
|
|
171
|
+
load: (args: ResourceTemplateArgumentsToObject<Arguments>) => Promise<ResourceResult>;
|
|
172
|
+
mimeType?: string;
|
|
173
|
+
name: string;
|
|
174
|
+
uriTemplate: string;
|
|
175
|
+
};
|
|
176
|
+
type ResourceTemplateArgument = Readonly<{
|
|
214
177
|
complete?: ArgumentValueCompleter;
|
|
215
|
-
enum?: string[];
|
|
216
|
-
}>;
|
|
217
|
-
type Prompt<Arguments extends PromptArgument[] = PromptArgument[], Args = PromptArgumentsToObject<Arguments>> = {
|
|
218
|
-
arguments?: PromptArgument[];
|
|
219
|
-
complete?: (name: string, value: string) => Promise<Completion>;
|
|
220
178
|
description?: string;
|
|
221
|
-
load: (args: Args) => Promise<string>;
|
|
222
179
|
name: string;
|
|
180
|
+
}>;
|
|
181
|
+
type ResourceTemplateArgumentsToObject<T extends {
|
|
182
|
+
name: string;
|
|
183
|
+
}[]> = {
|
|
184
|
+
[K in T[number]["name"]]: string;
|
|
223
185
|
};
|
|
224
186
|
type ServerOptions<T extends FastMCPSessionAuth> = {
|
|
225
|
-
name: string;
|
|
226
|
-
version: `${number}.${number}.${number}`;
|
|
227
187
|
authenticate?: Authenticate<T>;
|
|
228
188
|
instructions?: string;
|
|
189
|
+
name: string;
|
|
190
|
+
version: `${number}.${number}.${number}`;
|
|
191
|
+
};
|
|
192
|
+
type Tool<T extends FastMCPSessionAuth, Params extends ToolParameters = ToolParameters> = {
|
|
193
|
+
annotations?: ToolAnnotations;
|
|
194
|
+
description?: string;
|
|
195
|
+
execute: (args: StandardSchemaV1.InferOutput<Params>, context: Context<T>) => Promise<AudioContent | ContentResult | ImageContent | string | TextContent>;
|
|
196
|
+
name: string;
|
|
197
|
+
parameters?: Params;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Tool annotations as defined in MCP Specification (2025-03-26)
|
|
201
|
+
* These provide hints about a tool's behavior.
|
|
202
|
+
*/
|
|
203
|
+
type ToolAnnotations = {
|
|
204
|
+
/**
|
|
205
|
+
* If true, the tool may perform destructive updates
|
|
206
|
+
* Only meaningful when readOnlyHint is false
|
|
207
|
+
* @default true
|
|
208
|
+
*/
|
|
209
|
+
destructiveHint?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* If true, calling the tool repeatedly with the same arguments has no additional effect
|
|
212
|
+
* Only meaningful when readOnlyHint is false
|
|
213
|
+
* @default false
|
|
214
|
+
*/
|
|
215
|
+
idempotentHint?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* If true, the tool may interact with an "open world" of external entities
|
|
218
|
+
* @default true
|
|
219
|
+
*/
|
|
220
|
+
openWorldHint?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* If true, indicates the tool does not modify its environment
|
|
223
|
+
* @default false
|
|
224
|
+
*/
|
|
225
|
+
readOnlyHint?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* A human-readable title for the tool, useful for UI display
|
|
228
|
+
*/
|
|
229
|
+
title?: string;
|
|
229
230
|
};
|
|
230
|
-
type LoggingLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency";
|
|
231
231
|
declare const FastMCPSessionEventEmitterBase: {
|
|
232
232
|
new (): StrictEventEmitter<EventEmitter, FastMCPSessionEvents>;
|
|
233
233
|
};
|
|
234
|
-
|
|
235
|
-
}
|
|
234
|
+
type FastMCPSessionAuth = Record<string, unknown> | undefined;
|
|
236
235
|
type SamplingResponse = {
|
|
236
|
+
content: AudioContent | ImageContent | TextContent;
|
|
237
237
|
model: string;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
content: TextContent | ImageContent | AudioContent;
|
|
238
|
+
role: "assistant" | "user";
|
|
239
|
+
stopReason?: "endTurn" | "maxTokens" | "stopSequence" | string;
|
|
241
240
|
};
|
|
242
|
-
|
|
241
|
+
declare class FastMCPSessionEventEmitter extends FastMCPSessionEventEmitterBase {
|
|
242
|
+
}
|
|
243
243
|
declare class FastMCPSession<T extends FastMCPSessionAuth = FastMCPSessionAuth> extends FastMCPSessionEventEmitter {
|
|
244
244
|
#private;
|
|
245
|
-
|
|
245
|
+
get clientCapabilities(): ClientCapabilities | null;
|
|
246
|
+
get loggingLevel(): LoggingLevel;
|
|
247
|
+
get roots(): Root[];
|
|
248
|
+
get server(): Server;
|
|
249
|
+
constructor({ auth, instructions, name, prompts, resources, resourcesTemplates, tools, version, }: {
|
|
246
250
|
auth?: T;
|
|
247
|
-
name: string;
|
|
248
|
-
version: string;
|
|
249
251
|
instructions?: string;
|
|
250
|
-
|
|
252
|
+
name: string;
|
|
253
|
+
prompts: Prompt[];
|
|
251
254
|
resources: Resource[];
|
|
252
255
|
resourcesTemplates: InputResourceTemplate[];
|
|
253
|
-
|
|
256
|
+
tools: Tool<T>[];
|
|
257
|
+
version: string;
|
|
254
258
|
});
|
|
259
|
+
close(): Promise<void>;
|
|
260
|
+
connect(transport: Transport): Promise<void>;
|
|
261
|
+
requestSampling(message: z.infer<typeof CreateMessageRequestSchema>["params"]): Promise<SamplingResponse>;
|
|
262
|
+
private addPrompt;
|
|
255
263
|
private addResource;
|
|
256
264
|
private addResourceTemplate;
|
|
257
|
-
private addPrompt;
|
|
258
|
-
get clientCapabilities(): ClientCapabilities | null;
|
|
259
|
-
get server(): Server;
|
|
260
|
-
requestSampling(message: z.infer<typeof CreateMessageRequestSchema>["params"]): Promise<SamplingResponse>;
|
|
261
|
-
connect(transport: Transport): Promise<void>;
|
|
262
|
-
get roots(): Root[];
|
|
263
|
-
close(): Promise<void>;
|
|
264
|
-
private setupErrorHandling;
|
|
265
|
-
get loggingLevel(): LoggingLevel;
|
|
266
265
|
private setupCompleteHandlers;
|
|
267
|
-
private
|
|
266
|
+
private setupErrorHandling;
|
|
268
267
|
private setupLoggingHandlers;
|
|
269
|
-
private
|
|
268
|
+
private setupPromptHandlers;
|
|
270
269
|
private setupResourceHandlers;
|
|
271
270
|
private setupResourceTemplateHandlers;
|
|
272
|
-
private
|
|
271
|
+
private setupRootsHandlers;
|
|
272
|
+
private setupToolHandlers;
|
|
273
273
|
}
|
|
274
274
|
declare const FastMCPEventEmitterBase: {
|
|
275
275
|
new (): StrictEventEmitter<EventEmitter, FastMCPEvents<FastMCPSessionAuth>>;
|
|
276
276
|
};
|
|
277
|
+
type Authenticate<T> = (request: http.IncomingMessage) => Promise<T>;
|
|
277
278
|
declare class FastMCPEventEmitter extends FastMCPEventEmitterBase {
|
|
278
279
|
}
|
|
279
|
-
type Authenticate<T> = (request: http.IncomingMessage) => Promise<T>;
|
|
280
280
|
declare class FastMCP<T extends Record<string, unknown> | undefined = undefined> extends FastMCPEventEmitter {
|
|
281
281
|
#private;
|
|
282
282
|
options: ServerOptions<T>;
|
|
283
|
-
constructor(options: ServerOptions<T>);
|
|
284
283
|
get sessions(): FastMCPSession<T>[];
|
|
284
|
+
constructor(options: ServerOptions<T>);
|
|
285
285
|
/**
|
|
286
|
-
* Adds a
|
|
286
|
+
* Adds a prompt to the server.
|
|
287
287
|
*/
|
|
288
|
-
|
|
288
|
+
addPrompt<const Args extends InputPromptArgument[]>(prompt: InputPrompt<Args>): void;
|
|
289
289
|
/**
|
|
290
290
|
* Adds a resource to the server.
|
|
291
291
|
*/
|
|
@@ -295,20 +295,20 @@ declare class FastMCP<T extends Record<string, unknown> | undefined = undefined>
|
|
|
295
295
|
*/
|
|
296
296
|
addResourceTemplate<const Args extends InputResourceTemplateArgument[]>(resource: InputResourceTemplate<Args>): void;
|
|
297
297
|
/**
|
|
298
|
-
* Adds a
|
|
298
|
+
* Adds a tool to the server.
|
|
299
299
|
*/
|
|
300
|
-
|
|
300
|
+
addTool<Params extends ToolParameters>(tool: Tool<T, Params>): void;
|
|
301
301
|
/**
|
|
302
302
|
* Starts the server.
|
|
303
303
|
*/
|
|
304
304
|
start(options?: {
|
|
305
|
-
transportType: "stdio";
|
|
306
|
-
} | {
|
|
307
|
-
transportType: "sse";
|
|
308
305
|
sse: {
|
|
309
306
|
endpoint: `/${string}`;
|
|
310
307
|
port: number;
|
|
311
308
|
};
|
|
309
|
+
transportType: "sse";
|
|
310
|
+
} | {
|
|
311
|
+
transportType: "stdio";
|
|
312
312
|
}): Promise<void>;
|
|
313
313
|
/**
|
|
314
314
|
* Stops the server.
|