@outfitter/mcp 0.4.1 → 0.4.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/README.md +1 -1
- package/dist/actions.d.ts +3 -3
- package/dist/actions.js +3 -3
- package/dist/core-tools.d.ts +3 -3
- package/dist/index.d.ts +176 -176
- package/dist/logging.d.ts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.js +2 -2
- package/dist/shared/@outfitter/{mcp-2vqyt1fj.d.ts → mcp-5b5726ga.d.ts} +1 -1
- package/dist/shared/@outfitter/{mcp-a0cgfsnw.d.ts → mcp-5jcgb033.d.ts} +1 -1
- package/dist/shared/@outfitter/{mcp-h2twz77x.d.ts → mcp-fks4zt1z.d.ts} +161 -161
- package/dist/shared/@outfitter/{mcp-jk0ka9hw.d.ts → mcp-s3gfhcdk.d.ts} +4 -4
- package/dist/shared/@outfitter/{mcp-dwd800vf.d.ts → mcp-zb3p61y9.d.ts} +14 -14
- package/dist/shared/@outfitter/{mcp-ktapzh9d.js → mcp-zmc7ht6z.js} +1 -1
- package/dist/transport.d.ts +3 -3
- package/dist/types.d.ts +2 -2
- package/package.json +6 -5
- package/dist/shared/@outfitter/{mcp-nmp5wf0w.js → mcp-hh12tqfg.js} +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -42,21 +42,6 @@ declare function shouldEmitLog(messageLevel: McpLogLevel, threshold: McpLogLevel
|
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
interface McpServerOptions {
|
|
45
|
-
/**
|
|
46
|
-
* Server name, used in MCP protocol handshake.
|
|
47
|
-
* Should be a short, descriptive identifier.
|
|
48
|
-
*/
|
|
49
|
-
name: string;
|
|
50
|
-
/**
|
|
51
|
-
* Server version (semver format recommended).
|
|
52
|
-
* Sent to clients during initialization.
|
|
53
|
-
*/
|
|
54
|
-
version: string;
|
|
55
|
-
/**
|
|
56
|
-
* Optional logger instance for server logging.
|
|
57
|
-
* If not provided, the server uses the Outfitter logger factory defaults.
|
|
58
|
-
*/
|
|
59
|
-
logger?: Logger;
|
|
60
45
|
/**
|
|
61
46
|
* Default MCP log level for client-facing log forwarding.
|
|
62
47
|
*
|
|
@@ -70,6 +55,21 @@ interface McpServerOptions {
|
|
|
70
55
|
* The MCP client can always override via `logging/setLevel`.
|
|
71
56
|
*/
|
|
72
57
|
defaultLogLevel?: McpLogLevel | null;
|
|
58
|
+
/**
|
|
59
|
+
* Optional logger instance for server logging.
|
|
60
|
+
* If not provided, the server uses the Outfitter logger factory defaults.
|
|
61
|
+
*/
|
|
62
|
+
logger?: Logger;
|
|
63
|
+
/**
|
|
64
|
+
* Server name, used in MCP protocol handshake.
|
|
65
|
+
* Should be a short, descriptive identifier.
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* Server version (semver format recommended).
|
|
70
|
+
* Sent to clients during initialization.
|
|
71
|
+
*/
|
|
72
|
+
version: string;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Behavioral hints for MCP tools.
|
|
@@ -80,14 +80,14 @@ interface McpServerOptions {
|
|
|
80
80
|
* @see https://spec.modelcontextprotocol.io/specification/2025-03-26/server/tools/#annotations
|
|
81
81
|
*/
|
|
82
82
|
interface ToolAnnotations {
|
|
83
|
-
/** When true, the tool does not modify any state. */
|
|
84
|
-
readOnlyHint?: boolean;
|
|
85
83
|
/** When true, the tool may perform destructive operations (e.g., deleting data). */
|
|
86
84
|
destructiveHint?: boolean;
|
|
87
85
|
/** When true, calling the tool multiple times with the same input has the same effect. */
|
|
88
86
|
idempotentHint?: boolean;
|
|
89
87
|
/** When true, the tool may interact with external systems beyond the server. */
|
|
90
88
|
openWorldHint?: boolean;
|
|
89
|
+
/** When true, the tool does not modify any state. */
|
|
90
|
+
readOnlyHint?: boolean;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Common annotation presets for MCP tools.
|
|
@@ -182,51 +182,51 @@ interface ToolDefinition<
|
|
|
182
182
|
TError extends OutfitterError = OutfitterError
|
|
183
183
|
> {
|
|
184
184
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
185
|
+
* Optional behavioral annotations for the tool.
|
|
186
|
+
* Helps clients understand tool behavior without invoking it.
|
|
187
187
|
*/
|
|
188
|
-
|
|
188
|
+
annotations?: ToolAnnotations;
|
|
189
|
+
/**
|
|
190
|
+
* Whether the tool should be deferred for tool search.
|
|
191
|
+
* Defaults to true for domain tools; core tools set this to false.
|
|
192
|
+
*/
|
|
193
|
+
deferLoading?: boolean;
|
|
189
194
|
/**
|
|
190
195
|
* Human-readable description of what the tool does.
|
|
191
196
|
* Shown to clients and used by LLMs to understand tool capabilities.
|
|
192
197
|
*/
|
|
193
198
|
description: string;
|
|
194
199
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
200
|
+
* Handler function that processes the tool invocation.
|
|
201
|
+
* Receives validated input and HandlerContext, returns Result.
|
|
197
202
|
*/
|
|
198
|
-
|
|
203
|
+
handler: Handler<TInput, TOutput, TError>;
|
|
199
204
|
/**
|
|
200
205
|
* Zod schema for validating and parsing input.
|
|
201
206
|
* The schema defines the expected input structure.
|
|
202
207
|
*/
|
|
203
208
|
inputSchema: z.ZodType<TInput>;
|
|
204
209
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*/
|
|
208
|
-
annotations?: ToolAnnotations;
|
|
209
|
-
/**
|
|
210
|
-
* Handler function that processes the tool invocation.
|
|
211
|
-
* Receives validated input and HandlerContext, returns Result.
|
|
210
|
+
* Unique tool name (kebab-case recommended).
|
|
211
|
+
* Used by clients to invoke the tool.
|
|
212
212
|
*/
|
|
213
|
-
|
|
213
|
+
name: string;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Serialized tool information for MCP protocol.
|
|
217
217
|
* This is the format sent to clients during tool listing.
|
|
218
218
|
*/
|
|
219
219
|
interface SerializedTool {
|
|
220
|
-
/**
|
|
221
|
-
|
|
220
|
+
/** Behavioral annotations for the tool */
|
|
221
|
+
annotations?: ToolAnnotations;
|
|
222
|
+
/** MCP tool-search hint: whether tool is deferred */
|
|
223
|
+
defer_loading?: boolean;
|
|
222
224
|
/** Tool description */
|
|
223
225
|
description: string;
|
|
224
226
|
/** JSON Schema representation of the input schema */
|
|
225
227
|
inputSchema: Record<string, unknown>;
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
/** Behavioral annotations for the tool */
|
|
229
|
-
annotations?: ToolAnnotations;
|
|
228
|
+
/** Tool name */
|
|
229
|
+
name: string;
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
232
232
|
* Annotations for content items (resource content, prompt messages).
|
|
@@ -250,27 +250,27 @@ interface ContentAnnotations {
|
|
|
250
250
|
* Text content returned from a resource read.
|
|
251
251
|
*/
|
|
252
252
|
interface TextResourceContent {
|
|
253
|
-
/** Resource URI */
|
|
254
|
-
uri: string;
|
|
255
|
-
/** Text content */
|
|
256
|
-
text: string;
|
|
257
|
-
/** Optional MIME type */
|
|
258
|
-
mimeType?: string;
|
|
259
253
|
/** Optional content annotations */
|
|
260
254
|
annotations?: ContentAnnotations;
|
|
255
|
+
/** Optional MIME type */
|
|
256
|
+
mimeType?: string;
|
|
257
|
+
/** Text content */
|
|
258
|
+
text: string;
|
|
259
|
+
/** Resource URI */
|
|
260
|
+
uri: string;
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Binary (base64-encoded) content returned from a resource read.
|
|
264
264
|
*/
|
|
265
265
|
interface BlobResourceContent {
|
|
266
|
-
/**
|
|
267
|
-
|
|
266
|
+
/** Optional content annotations */
|
|
267
|
+
annotations?: ContentAnnotations;
|
|
268
268
|
/** Base64-encoded binary content */
|
|
269
269
|
blob: string;
|
|
270
270
|
/** Optional MIME type */
|
|
271
271
|
mimeType?: string;
|
|
272
|
-
/**
|
|
273
|
-
|
|
272
|
+
/** Resource URI */
|
|
273
|
+
uri: string;
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* Content returned from reading a resource.
|
|
@@ -305,31 +305,31 @@ type ResourceReadHandler = (uri: string, ctx: HandlerContext) => Promise<Result<
|
|
|
305
305
|
* ```
|
|
306
306
|
*/
|
|
307
307
|
interface ResourceDefinition {
|
|
308
|
-
/**
|
|
309
|
-
* Unique resource URI.
|
|
310
|
-
* Must be a valid URI (file://, https://, custom://, etc.).
|
|
311
|
-
*/
|
|
312
|
-
uri: string;
|
|
313
|
-
/**
|
|
314
|
-
* Human-readable resource name.
|
|
315
|
-
* Displayed to users in resource listings.
|
|
316
|
-
*/
|
|
317
|
-
name: string;
|
|
318
308
|
/**
|
|
319
309
|
* Optional description of the resource.
|
|
320
310
|
* Provides additional context about the resource contents.
|
|
321
311
|
*/
|
|
322
312
|
description?: string;
|
|
323
313
|
/**
|
|
314
|
+
* Optional handler for reading the resource content.
|
|
315
|
+
* If not provided, the resource is metadata-only.
|
|
316
|
+
*/
|
|
317
|
+
handler?: ResourceReadHandler;
|
|
318
|
+
/**
|
|
324
319
|
* Optional MIME type of the resource content.
|
|
325
320
|
* Helps clients understand how to process the resource.
|
|
326
321
|
*/
|
|
327
322
|
mimeType?: string;
|
|
328
323
|
/**
|
|
329
|
-
*
|
|
330
|
-
*
|
|
324
|
+
* Human-readable resource name.
|
|
325
|
+
* Displayed to users in resource listings.
|
|
331
326
|
*/
|
|
332
|
-
|
|
327
|
+
name: string;
|
|
328
|
+
/**
|
|
329
|
+
* Unique resource URI.
|
|
330
|
+
* Must be a valid URI (file://, https://, custom://, etc.).
|
|
331
|
+
*/
|
|
332
|
+
uri: string;
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Handler for reading a resource template's content.
|
|
@@ -358,29 +358,29 @@ type ResourceTemplateReadHandler = (uri: string, variables: Record<string, strin
|
|
|
358
358
|
* ```
|
|
359
359
|
*/
|
|
360
360
|
interface ResourceTemplateDefinition {
|
|
361
|
-
/** URI template with `{param}` placeholders (RFC 6570 Level 1). */
|
|
362
|
-
uriTemplate: string;
|
|
363
|
-
/** Human-readable name for the template. */
|
|
364
|
-
name: string;
|
|
365
|
-
/** Optional description. */
|
|
366
|
-
description?: string;
|
|
367
|
-
/** Optional MIME type. */
|
|
368
|
-
mimeType?: string;
|
|
369
361
|
/** Optional completion handlers keyed by parameter name. */
|
|
370
362
|
complete?: Record<string, CompletionHandler>;
|
|
363
|
+
/** Optional description. */
|
|
364
|
+
description?: string;
|
|
371
365
|
/** Handler for reading matched resources. */
|
|
372
366
|
handler: ResourceTemplateReadHandler;
|
|
367
|
+
/** Optional MIME type. */
|
|
368
|
+
mimeType?: string;
|
|
369
|
+
/** Human-readable name for the template. */
|
|
370
|
+
name: string;
|
|
371
|
+
/** URI template with `{param}` placeholders (RFC 6570 Level 1). */
|
|
372
|
+
uriTemplate: string;
|
|
373
373
|
}
|
|
374
374
|
/**
|
|
375
375
|
* Result of a completion request.
|
|
376
376
|
*/
|
|
377
377
|
interface CompletionResult {
|
|
378
|
-
/** Completion values */
|
|
379
|
-
values: string[];
|
|
380
|
-
/** Total number of available values (for pagination) */
|
|
381
|
-
total?: number;
|
|
382
378
|
/** Whether there are more values */
|
|
383
379
|
hasMore?: boolean;
|
|
380
|
+
/** Total number of available values (for pagination) */
|
|
381
|
+
total?: number;
|
|
382
|
+
/** Completion values */
|
|
383
|
+
values: string[];
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
386
|
* Handler for generating completions.
|
|
@@ -400,43 +400,43 @@ type CompletionRef = {
|
|
|
400
400
|
* Argument definition for a prompt.
|
|
401
401
|
*/
|
|
402
402
|
interface PromptArgument {
|
|
403
|
-
/**
|
|
404
|
-
|
|
403
|
+
/** Optional completion handler for this argument */
|
|
404
|
+
complete?: CompletionHandler;
|
|
405
405
|
/** Human-readable description */
|
|
406
406
|
description?: string;
|
|
407
|
+
/** Argument name */
|
|
408
|
+
name: string;
|
|
407
409
|
/** Whether this argument is required */
|
|
408
410
|
required?: boolean;
|
|
409
|
-
/** Optional completion handler for this argument */
|
|
410
|
-
complete?: CompletionHandler;
|
|
411
411
|
}
|
|
412
412
|
/**
|
|
413
413
|
* Content block within a prompt message.
|
|
414
414
|
*/
|
|
415
415
|
interface PromptMessageContent {
|
|
416
|
-
/** Content type */
|
|
417
|
-
type: "text";
|
|
418
|
-
/** Text content */
|
|
419
|
-
text: string;
|
|
420
416
|
/** Optional content annotations */
|
|
421
417
|
annotations?: ContentAnnotations;
|
|
418
|
+
/** Text content */
|
|
419
|
+
text: string;
|
|
420
|
+
/** Content type */
|
|
421
|
+
type: "text";
|
|
422
422
|
}
|
|
423
423
|
/**
|
|
424
424
|
* A message in a prompt response.
|
|
425
425
|
*/
|
|
426
426
|
interface PromptMessage {
|
|
427
|
-
/** Message role */
|
|
428
|
-
role: "user" | "assistant";
|
|
429
427
|
/** Message content */
|
|
430
428
|
content: PromptMessageContent;
|
|
429
|
+
/** Message role */
|
|
430
|
+
role: "user" | "assistant";
|
|
431
431
|
}
|
|
432
432
|
/**
|
|
433
433
|
* Result returned from getting a prompt.
|
|
434
434
|
*/
|
|
435
435
|
interface PromptResult {
|
|
436
|
-
/** Prompt messages */
|
|
437
|
-
messages: PromptMessage[];
|
|
438
436
|
/** Optional description override */
|
|
439
437
|
description?: string;
|
|
438
|
+
/** Prompt messages */
|
|
439
|
+
messages: PromptMessage[];
|
|
440
440
|
}
|
|
441
441
|
/**
|
|
442
442
|
* Handler for generating prompt messages.
|
|
@@ -462,14 +462,14 @@ type PromptHandler = (args: Record<string, string | undefined>) => Promise<Resul
|
|
|
462
462
|
* ```
|
|
463
463
|
*/
|
|
464
464
|
interface PromptDefinition {
|
|
465
|
-
/** Unique prompt name */
|
|
466
|
-
name: string;
|
|
467
|
-
/** Human-readable description */
|
|
468
|
-
description?: string;
|
|
469
465
|
/** Prompt arguments */
|
|
470
466
|
arguments: PromptArgument[];
|
|
467
|
+
/** Human-readable description */
|
|
468
|
+
description?: string;
|
|
471
469
|
/** Handler to generate messages */
|
|
472
470
|
handler: PromptHandler;
|
|
471
|
+
/** Unique prompt name */
|
|
472
|
+
name: string;
|
|
473
473
|
}
|
|
474
474
|
declare const McpErrorBase: TaggedErrorClass<"McpError", {
|
|
475
475
|
message: string;
|
|
@@ -507,12 +507,12 @@ declare class McpError extends McpErrorBase {
|
|
|
507
507
|
* Options for invoking a tool.
|
|
508
508
|
*/
|
|
509
509
|
interface InvokeToolOptions {
|
|
510
|
-
/** Abort signal for cancellation */
|
|
511
|
-
signal?: AbortSignal;
|
|
512
|
-
/** Custom request ID (auto-generated if not provided) */
|
|
513
|
-
requestId?: string;
|
|
514
510
|
/** Progress token from client for tracking progress */
|
|
515
511
|
progressToken?: string | number;
|
|
512
|
+
/** Custom request ID (auto-generated if not provided) */
|
|
513
|
+
requestId?: string;
|
|
514
|
+
/** Abort signal for cancellation */
|
|
515
|
+
signal?: AbortSignal;
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
518
|
* MCP Server instance.
|
|
@@ -534,44 +534,12 @@ interface InvokeToolOptions {
|
|
|
534
534
|
* ```
|
|
535
535
|
*/
|
|
536
536
|
interface McpServer {
|
|
537
|
-
/** Server name */
|
|
538
|
-
readonly name: string;
|
|
539
|
-
/** Server version */
|
|
540
|
-
readonly version: string;
|
|
541
|
-
/**
|
|
542
|
-
* Register a tool with the server.
|
|
543
|
-
* @param tool - Tool definition to register
|
|
544
|
-
*/
|
|
545
|
-
registerTool<
|
|
546
|
-
TInput,
|
|
547
|
-
TOutput,
|
|
548
|
-
TError extends OutfitterError
|
|
549
|
-
>(tool: ToolDefinition<TInput, TOutput, TError>): void;
|
|
550
|
-
/**
|
|
551
|
-
* Register a resource with the server.
|
|
552
|
-
* @param resource - Resource definition to register
|
|
553
|
-
*/
|
|
554
|
-
registerResource(resource: ResourceDefinition): void;
|
|
555
|
-
/**
|
|
556
|
-
* Get all registered tools.
|
|
557
|
-
* @returns Array of serialized tool information
|
|
558
|
-
*/
|
|
559
|
-
getTools(): SerializedTool[];
|
|
560
|
-
/**
|
|
561
|
-
* Register a resource template with the server.
|
|
562
|
-
* @param template - Resource template definition to register
|
|
563
|
-
*/
|
|
564
|
-
registerResourceTemplate(template: ResourceTemplateDefinition): void;
|
|
565
|
-
/**
|
|
566
|
-
* Get all registered resources.
|
|
567
|
-
* @returns Array of resource definitions
|
|
568
|
-
*/
|
|
569
|
-
getResources(): ResourceDefinition[];
|
|
570
537
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
538
|
+
* Bind the SDK server instance for notifications.
|
|
539
|
+
* Called internally by the transport layer.
|
|
540
|
+
* @param sdkServer - The MCP SDK Server instance
|
|
573
541
|
*/
|
|
574
|
-
|
|
542
|
+
bindSdkServer?(sdkServer: any): void;
|
|
575
543
|
/**
|
|
576
544
|
* Complete an argument value.
|
|
577
545
|
* @param ref - Reference to the prompt or resource template
|
|
@@ -581,10 +549,12 @@ interface McpServer {
|
|
|
581
549
|
*/
|
|
582
550
|
complete(ref: CompletionRef, argumentName: string, value: string): Promise<Result<CompletionResult, InstanceType<typeof McpError>>>;
|
|
583
551
|
/**
|
|
584
|
-
*
|
|
585
|
-
* @param
|
|
552
|
+
* Get a specific prompt's messages.
|
|
553
|
+
* @param name - Prompt name
|
|
554
|
+
* @param args - Prompt arguments
|
|
555
|
+
* @returns Result with prompt result or McpError
|
|
586
556
|
*/
|
|
587
|
-
|
|
557
|
+
getPrompt(name: string, args: Record<string, string | undefined>): Promise<Result<PromptResult, InstanceType<typeof McpError>>>;
|
|
588
558
|
/**
|
|
589
559
|
* Get all registered prompts.
|
|
590
560
|
* @returns Array of prompt definitions (without handlers)
|
|
@@ -595,18 +565,20 @@ interface McpServer {
|
|
|
595
565
|
arguments: PromptArgument[];
|
|
596
566
|
}>;
|
|
597
567
|
/**
|
|
598
|
-
* Get
|
|
599
|
-
* @
|
|
600
|
-
* @param args - Prompt arguments
|
|
601
|
-
* @returns Result with prompt result or McpError
|
|
568
|
+
* Get all registered resources.
|
|
569
|
+
* @returns Array of resource definitions
|
|
602
570
|
*/
|
|
603
|
-
|
|
571
|
+
getResources(): ResourceDefinition[];
|
|
604
572
|
/**
|
|
605
|
-
*
|
|
606
|
-
* @
|
|
607
|
-
* @returns Result with resource content or McpError
|
|
573
|
+
* Get all registered resource templates.
|
|
574
|
+
* @returns Array of resource template definitions
|
|
608
575
|
*/
|
|
609
|
-
|
|
576
|
+
getResourceTemplates(): ResourceTemplateDefinition[];
|
|
577
|
+
/**
|
|
578
|
+
* Get all registered tools.
|
|
579
|
+
* @returns Array of serialized tool information
|
|
580
|
+
*/
|
|
581
|
+
getTools(): SerializedTool[];
|
|
610
582
|
/**
|
|
611
583
|
* Invoke a tool by name.
|
|
612
584
|
* @param name - Tool name
|
|
@@ -615,16 +587,16 @@ interface McpServer {
|
|
|
615
587
|
* @returns Result with tool output or McpError
|
|
616
588
|
*/
|
|
617
589
|
invokeTool<T = unknown>(name: string, input: unknown, options?: InvokeToolOptions): Promise<Result<T, InstanceType<typeof McpError>>>;
|
|
590
|
+
/** Server name */
|
|
591
|
+
readonly name: string;
|
|
618
592
|
/**
|
|
619
|
-
*
|
|
620
|
-
* @param uri - Resource URI to subscribe to
|
|
593
|
+
* Notify connected clients that the prompt list has changed.
|
|
621
594
|
*/
|
|
622
|
-
|
|
595
|
+
notifyPromptsChanged(): void;
|
|
623
596
|
/**
|
|
624
|
-
*
|
|
625
|
-
* @param uri - Resource URI to unsubscribe from
|
|
597
|
+
* Notify connected clients that the resource list has changed.
|
|
626
598
|
*/
|
|
627
|
-
|
|
599
|
+
notifyResourcesChanged(): void;
|
|
628
600
|
/**
|
|
629
601
|
* Notify connected clients that a specific resource has been updated.
|
|
630
602
|
* Only emits for subscribed URIs.
|
|
@@ -636,19 +608,35 @@ interface McpServer {
|
|
|
636
608
|
*/
|
|
637
609
|
notifyToolsChanged(): void;
|
|
638
610
|
/**
|
|
639
|
-
*
|
|
611
|
+
* Read a resource by URI.
|
|
612
|
+
* @param uri - Resource URI
|
|
613
|
+
* @returns Result with resource content or McpError
|
|
640
614
|
*/
|
|
641
|
-
|
|
615
|
+
readResource(uri: string): Promise<Result<ResourceContent[], InstanceType<typeof McpError>>>;
|
|
642
616
|
/**
|
|
643
|
-
*
|
|
617
|
+
* Register a prompt with the server.
|
|
618
|
+
* @param prompt - Prompt definition to register
|
|
644
619
|
*/
|
|
645
|
-
|
|
620
|
+
registerPrompt(prompt: PromptDefinition): void;
|
|
646
621
|
/**
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
* @param level - MCP log level string
|
|
622
|
+
* Register a resource with the server.
|
|
623
|
+
* @param resource - Resource definition to register
|
|
650
624
|
*/
|
|
651
|
-
|
|
625
|
+
registerResource(resource: ResourceDefinition): void;
|
|
626
|
+
/**
|
|
627
|
+
* Register a resource template with the server.
|
|
628
|
+
* @param template - Resource template definition to register
|
|
629
|
+
*/
|
|
630
|
+
registerResourceTemplate(template: ResourceTemplateDefinition): void;
|
|
631
|
+
/**
|
|
632
|
+
* Register a tool with the server.
|
|
633
|
+
* @param tool - Tool definition to register
|
|
634
|
+
*/
|
|
635
|
+
registerTool<
|
|
636
|
+
TInput,
|
|
637
|
+
TOutput,
|
|
638
|
+
TError extends OutfitterError
|
|
639
|
+
>(tool: ToolDefinition<TInput, TOutput, TError>): void;
|
|
652
640
|
/**
|
|
653
641
|
* Send a log message to connected clients.
|
|
654
642
|
* Filters by the client-requested log level threshold.
|
|
@@ -660,11 +648,11 @@ interface McpServer {
|
|
|
660
648
|
*/
|
|
661
649
|
sendLogMessage(level: McpLogLevel, data: unknown, loggerName?: string): void;
|
|
662
650
|
/**
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
* @param
|
|
651
|
+
* Set the client-requested log level.
|
|
652
|
+
* Only log messages at or above this level will be forwarded.
|
|
653
|
+
* @param level - MCP log level string
|
|
666
654
|
*/
|
|
667
|
-
|
|
655
|
+
setLogLevel?(level: string): void;
|
|
668
656
|
/**
|
|
669
657
|
* Start the MCP server.
|
|
670
658
|
* Begins listening for client connections.
|
|
@@ -675,6 +663,18 @@ interface McpServer {
|
|
|
675
663
|
* Closes all connections and cleans up resources.
|
|
676
664
|
*/
|
|
677
665
|
stop(): Promise<void>;
|
|
666
|
+
/**
|
|
667
|
+
* Subscribe to updates for a resource URI.
|
|
668
|
+
* @param uri - Resource URI to subscribe to
|
|
669
|
+
*/
|
|
670
|
+
subscribe(uri: string): void;
|
|
671
|
+
/**
|
|
672
|
+
* Unsubscribe from updates for a resource URI.
|
|
673
|
+
* @param uri - Resource URI to unsubscribe from
|
|
674
|
+
*/
|
|
675
|
+
unsubscribe(uri: string): void;
|
|
676
|
+
/** Server version */
|
|
677
|
+
readonly version: string;
|
|
678
678
|
}
|
|
679
679
|
/**
|
|
680
680
|
* Reporter for sending progress updates to clients.
|
|
@@ -693,10 +693,10 @@ interface ProgressReporter {
|
|
|
693
693
|
* Includes MCP-specific information in addition to standard HandlerContext.
|
|
694
694
|
*/
|
|
695
695
|
interface McpHandlerContext extends HandlerContext {
|
|
696
|
-
/** The name of the tool being invoked */
|
|
697
|
-
toolName?: string;
|
|
698
696
|
/** Progress reporter, present when client provides a progressToken */
|
|
699
697
|
progress?: ProgressReporter;
|
|
698
|
+
/** The name of the tool being invoked */
|
|
699
|
+
toolName?: string;
|
|
700
700
|
}
|
|
701
701
|
/**
|
|
702
702
|
* Adapt a handler with a domain error type for use with MCP tools.
|
|
@@ -732,23 +732,23 @@ interface DocsToolInput {
|
|
|
732
732
|
section?: DocsSection | undefined;
|
|
733
733
|
}
|
|
734
734
|
interface DocsToolEntry {
|
|
735
|
-
name: string;
|
|
736
|
-
summary?: string;
|
|
737
735
|
examples?: Array<{
|
|
738
736
|
input: Record<string, unknown>;
|
|
739
737
|
description?: string;
|
|
740
738
|
}>;
|
|
739
|
+
name: string;
|
|
740
|
+
summary?: string;
|
|
741
741
|
}
|
|
742
742
|
interface DocsToolResponse {
|
|
743
|
-
overview?: string;
|
|
744
|
-
tools?: DocsToolEntry[];
|
|
745
743
|
examples?: Array<{
|
|
746
744
|
name?: string;
|
|
747
745
|
description?: string;
|
|
748
746
|
input?: Record<string, unknown>;
|
|
749
747
|
output?: unknown;
|
|
750
748
|
}>;
|
|
749
|
+
overview?: string;
|
|
751
750
|
schemas?: Record<string, unknown>;
|
|
751
|
+
tools?: DocsToolEntry[];
|
|
752
752
|
}
|
|
753
753
|
interface DocsToolOptions {
|
|
754
754
|
/** Optional override for the docs tool description. */
|
|
@@ -767,10 +767,10 @@ interface ConfigToolInput {
|
|
|
767
767
|
}
|
|
768
768
|
interface ConfigToolResponse {
|
|
769
769
|
action: ConfigAction;
|
|
770
|
+
config?: Record<string, unknown>;
|
|
771
|
+
found?: boolean;
|
|
770
772
|
key?: string;
|
|
771
773
|
value?: unknown;
|
|
772
|
-
found?: boolean;
|
|
773
|
-
config?: Record<string, unknown>;
|
|
774
774
|
}
|
|
775
775
|
interface ConfigStore {
|
|
776
776
|
get(key: string): {
|
|
@@ -780,8 +780,8 @@ interface ConfigStore {
|
|
|
780
780
|
value: unknown;
|
|
781
781
|
found: boolean;
|
|
782
782
|
}>;
|
|
783
|
-
set(key: string, value: unknown): void | Promise<void>;
|
|
784
783
|
list(): Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
784
|
+
set(key: string, value: unknown): void | Promise<void>;
|
|
785
785
|
}
|
|
786
786
|
interface ConfigToolOptions {
|
|
787
787
|
/** Optional override for the config tool description. */
|
|
@@ -793,16 +793,16 @@ interface ConfigToolOptions {
|
|
|
793
793
|
}
|
|
794
794
|
declare function defineConfigTool(options?: ConfigToolOptions): ToolDefinition<ConfigToolInput, ConfigToolResponse>;
|
|
795
795
|
interface QueryToolInput {
|
|
796
|
-
q?: string | undefined;
|
|
797
|
-
query?: string | undefined;
|
|
798
|
-
limit?: number | undefined;
|
|
799
796
|
cursor?: string | undefined;
|
|
800
797
|
filters?: Record<string, unknown> | undefined;
|
|
798
|
+
limit?: number | undefined;
|
|
799
|
+
q?: string | undefined;
|
|
800
|
+
query?: string | undefined;
|
|
801
801
|
}
|
|
802
802
|
interface QueryToolResponse<T = unknown> {
|
|
803
|
-
results: T[];
|
|
804
|
-
nextCursor?: string;
|
|
805
803
|
_meta?: Record<string, unknown>;
|
|
804
|
+
nextCursor?: string;
|
|
805
|
+
results: T[];
|
|
806
806
|
}
|
|
807
807
|
interface QueryToolOptions<T = unknown> {
|
|
808
808
|
/** Optional override for the query tool description. */
|
|
@@ -812,8 +812,8 @@ interface QueryToolOptions<T = unknown> {
|
|
|
812
812
|
}
|
|
813
813
|
declare function defineQueryTool<T = unknown>(options?: QueryToolOptions<T>): ToolDefinition<QueryToolInput, QueryToolResponse<T>>;
|
|
814
814
|
interface CoreToolsOptions {
|
|
815
|
-
docs?: DocsToolOptions;
|
|
816
815
|
config?: ConfigToolOptions;
|
|
816
|
+
docs?: DocsToolOptions;
|
|
817
817
|
query?: QueryToolOptions;
|
|
818
818
|
}
|
|
819
819
|
type NormalizedQueryInput = Required<Pick<QueryToolInput, "q">> & Omit<QueryToolInput, "q">;
|
|
@@ -922,9 +922,9 @@ declare function defineResourceTemplate(definition: ResourceTemplateDefinition):
|
|
|
922
922
|
* @returns The same prompt definition
|
|
923
923
|
*/
|
|
924
924
|
declare function definePrompt(definition: PromptDefinition): PromptDefinition;
|
|
925
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index";
|
|
926
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio";
|
|
927
|
-
import { CallToolResult } from "@modelcontextprotocol/sdk/types";
|
|
925
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
926
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
927
|
+
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
928
928
|
type McpToolResponse = CallToolResult;
|
|
929
929
|
/**
|
|
930
930
|
* Wrap a handler success value into an MCP CallToolResult.
|
package/dist/logging.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { McpLogLevel, mapLogLevelToMcp, shouldEmitLog } from "./shared/@outfitter/mcp-cqpyer9m";
|
|
1
|
+
import { McpLogLevel, mapLogLevelToMcp, shouldEmitLog } from "./shared/@outfitter/mcp-cqpyer9m.js";
|
|
2
2
|
export { shouldEmitLog, mapLogLevelToMcp, McpLogLevel };
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/mcp-83zvbna8";
|
|
1
|
+
import { JsonSchema, zodToJsonSchema } from "./shared/@outfitter/mcp-83zvbna8.js";
|
|
2
2
|
export { zodToJsonSchema, JsonSchema };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMcpServer, definePrompt, defineResource, defineResourceTemplate, defineTool } from "./shared/@outfitter/mcp-
|
|
2
|
-
import "./shared/@outfitter/mcp-
|
|
3
|
-
import "./shared/@outfitter/mcp-cqpyer9m";
|
|
1
|
+
import { createMcpServer, definePrompt, defineResource, defineResourceTemplate, defineTool } from "./shared/@outfitter/mcp-5b5726ga.js";
|
|
2
|
+
import "./shared/@outfitter/mcp-fks4zt1z.js";
|
|
3
|
+
import "./shared/@outfitter/mcp-cqpyer9m.js";
|
|
4
4
|
export { defineTool, defineResourceTemplate, defineResource, definePrompt, createMcpServer };
|
package/dist/server.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
defineResource,
|
|
6
6
|
defineResourceTemplate,
|
|
7
7
|
defineTool
|
|
8
|
-
} from "./shared/@outfitter/mcp-
|
|
8
|
+
} from "./shared/@outfitter/mcp-hh12tqfg.js";
|
|
9
9
|
import"./shared/@outfitter/mcp-fjtxsa0x.js";
|
|
10
|
-
import"./shared/@outfitter/mcp-9m5hs2z0.js";
|
|
11
10
|
import"./shared/@outfitter/mcp-zy7b487d.js";
|
|
11
|
+
import"./shared/@outfitter/mcp-9m5hs2z0.js";
|
|
12
12
|
export {
|
|
13
13
|
defineTool,
|
|
14
14
|
defineResourceTemplate,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer, McpServerOptions, PromptDefinition, ResourceDefinition, ResourceTemplateDefinition, ToolDefinition } from "./mcp-
|
|
1
|
+
import { McpServer, McpServerOptions, PromptDefinition, ResourceDefinition, ResourceTemplateDefinition, ToolDefinition } from "./mcp-fks4zt1z.js";
|
|
2
2
|
import { OutfitterError } from "@outfitter/contracts";
|
|
3
3
|
/**
|
|
4
4
|
* Create an MCP server instance.
|