tmcp 1.19.1 → 1.19.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 +26 -0
- package/package.json +1 -1
- package/src/index.js +78 -209
- package/src/internal/internal.d.ts +8 -29
- package/src/types/index.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1484,6 +1484,32 @@ Common scenarios where `enabled` functions are useful:
|
|
|
1484
1484
|
5. **Time-based access**: Enable tools only during specific hours
|
|
1485
1485
|
6. **License restrictions**: Limit features based on subscription level
|
|
1486
1486
|
|
|
1487
|
+
## Dynamic Properties with Getters
|
|
1488
|
+
|
|
1489
|
+
Sometimes you need properties that are computed dynamically at list-time rather than registration-time. For example, you might want to serve different descriptions based on which client is connected.
|
|
1490
|
+
|
|
1491
|
+
`tmcp` preserves JavaScript getters on the configuration object, allowing you to define properties that are evaluated each time the capability is listed:
|
|
1492
|
+
|
|
1493
|
+
```javascript
|
|
1494
|
+
server.tool(
|
|
1495
|
+
{
|
|
1496
|
+
name: 'search',
|
|
1497
|
+
get description() {
|
|
1498
|
+
const client = server.ctx.sessionInfo?.clientInfo?.name;
|
|
1499
|
+
if (client === 'claude-code') {
|
|
1500
|
+
return 'Search the codebase for files, symbols, or text patterns';
|
|
1501
|
+
}
|
|
1502
|
+
return 'Search for information';
|
|
1503
|
+
},
|
|
1504
|
+
},
|
|
1505
|
+
() => {
|
|
1506
|
+
return { content: [{ type: 'text', text: 'Search results...' }] };
|
|
1507
|
+
},
|
|
1508
|
+
);
|
|
1509
|
+
```
|
|
1510
|
+
|
|
1511
|
+
The same pattern works for resources, templates, and prompts.
|
|
1512
|
+
|
|
1487
1513
|
## Contributing
|
|
1488
1514
|
|
|
1489
1515
|
Contributions are welcome! Please see our [contributing guidelines](../../CONTRIBUTING.md) for details.
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -666,10 +666,7 @@ export class McpServer {
|
|
|
666
666
|
const all_resources = [];
|
|
667
667
|
|
|
668
668
|
// Add static resources
|
|
669
|
-
for (const [
|
|
670
|
-
uri,
|
|
671
|
-
{ description, name, title, icons, mimeType, ...resource },
|
|
672
|
-
] of this.#resources) {
|
|
669
|
+
for (const [uri, resource] of this.#resources) {
|
|
673
670
|
if (!resource.template) {
|
|
674
671
|
if (
|
|
675
672
|
resource.enabled != null &&
|
|
@@ -677,12 +674,12 @@ export class McpServer {
|
|
|
677
674
|
)
|
|
678
675
|
continue;
|
|
679
676
|
all_resources.push({
|
|
680
|
-
name,
|
|
681
|
-
title: title || description,
|
|
682
|
-
description,
|
|
677
|
+
name: resource.name,
|
|
678
|
+
title: resource.title || resource.description,
|
|
679
|
+
description: resource.description,
|
|
683
680
|
uri,
|
|
684
|
-
mimeType,
|
|
685
|
-
icons,
|
|
681
|
+
mimeType: resource.mimeType,
|
|
682
|
+
icons: resource.icons,
|
|
686
683
|
});
|
|
687
684
|
} else if (resource.list_resources) {
|
|
688
685
|
if (
|
|
@@ -720,35 +717,22 @@ export class McpServer {
|
|
|
720
717
|
return {
|
|
721
718
|
resourceTemplates: (
|
|
722
719
|
await Promise.all(
|
|
723
|
-
[...this.#resources].map(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
(await safe_enabled(enabled)) === false
|
|
740
|
-
)
|
|
741
|
-
return null;
|
|
742
|
-
return {
|
|
743
|
-
name,
|
|
744
|
-
icons,
|
|
745
|
-
title: title || description,
|
|
746
|
-
description,
|
|
747
|
-
mimeType,
|
|
748
|
-
uriTemplate: uri,
|
|
749
|
-
};
|
|
750
|
-
},
|
|
751
|
-
),
|
|
720
|
+
[...this.#resources].map(async ([uri, resource]) => {
|
|
721
|
+
if (!resource.template) return null;
|
|
722
|
+
if (
|
|
723
|
+
resource.enabled != null &&
|
|
724
|
+
(await safe_enabled(resource.enabled)) === false
|
|
725
|
+
)
|
|
726
|
+
return null;
|
|
727
|
+
return {
|
|
728
|
+
name: resource.name,
|
|
729
|
+
icons: resource.icons,
|
|
730
|
+
title: resource.title || resource.description,
|
|
731
|
+
description: resource.description,
|
|
732
|
+
mimeType: resource.mimeType,
|
|
733
|
+
uriTemplate: uri,
|
|
734
|
+
};
|
|
735
|
+
}),
|
|
752
736
|
)
|
|
753
737
|
).filter((resource) => resource != null),
|
|
754
738
|
};
|
|
@@ -872,22 +856,7 @@ export class McpServer {
|
|
|
872
856
|
*/
|
|
873
857
|
tools(tools) {
|
|
874
858
|
for (const tool of tools) {
|
|
875
|
-
this.tool(
|
|
876
|
-
{
|
|
877
|
-
name: tool.name,
|
|
878
|
-
description: tool.description,
|
|
879
|
-
title: tool.title,
|
|
880
|
-
schema: tool.schema,
|
|
881
|
-
outputSchema: tool.outputSchema,
|
|
882
|
-
annotations: tool.annotations,
|
|
883
|
-
enabled: tool.enabled,
|
|
884
|
-
icons: tool.icons,
|
|
885
|
-
_meta: tool._meta,
|
|
886
|
-
},
|
|
887
|
-
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
888
|
-
// from showing in intellisense when declaring a tool inline
|
|
889
|
-
tool.execute,
|
|
890
|
-
);
|
|
859
|
+
this.tool(tool);
|
|
891
860
|
}
|
|
892
861
|
}
|
|
893
862
|
|
|
@@ -899,20 +868,7 @@ export class McpServer {
|
|
|
899
868
|
*/
|
|
900
869
|
prompts(prompts) {
|
|
901
870
|
for (const prompt of prompts) {
|
|
902
|
-
this.prompt(
|
|
903
|
-
{
|
|
904
|
-
name: prompt.name,
|
|
905
|
-
description: prompt.description,
|
|
906
|
-
title: prompt.title,
|
|
907
|
-
schema: prompt.schema,
|
|
908
|
-
complete: prompt.complete,
|
|
909
|
-
enabled: prompt.enabled,
|
|
910
|
-
icons: prompt.icons,
|
|
911
|
-
},
|
|
912
|
-
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
913
|
-
// from showing in intellisense when declaring a tool inline
|
|
914
|
-
prompt.execute,
|
|
915
|
-
);
|
|
871
|
+
this.prompt(prompt);
|
|
916
872
|
}
|
|
917
873
|
}
|
|
918
874
|
|
|
@@ -923,20 +879,7 @@ export class McpServer {
|
|
|
923
879
|
*/
|
|
924
880
|
resources(resources) {
|
|
925
881
|
for (const resource of resources) {
|
|
926
|
-
this.resource(
|
|
927
|
-
{
|
|
928
|
-
name: resource.name,
|
|
929
|
-
description: resource.description,
|
|
930
|
-
title: resource.title,
|
|
931
|
-
uri: resource.uri,
|
|
932
|
-
mimeType: resource.mimeType,
|
|
933
|
-
enabled: resource.enabled,
|
|
934
|
-
icons: resource.icons,
|
|
935
|
-
},
|
|
936
|
-
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
937
|
-
// from showing in intellisense when declaring a tool inline
|
|
938
|
-
resource.execute,
|
|
939
|
-
);
|
|
882
|
+
this.resource(resource);
|
|
940
883
|
}
|
|
941
884
|
}
|
|
942
885
|
|
|
@@ -947,22 +890,7 @@ export class McpServer {
|
|
|
947
890
|
*/
|
|
948
891
|
templates(templates) {
|
|
949
892
|
for (const template of templates) {
|
|
950
|
-
this.template(
|
|
951
|
-
{
|
|
952
|
-
name: template.name,
|
|
953
|
-
description: template.description,
|
|
954
|
-
title: template.title,
|
|
955
|
-
uri: template.uri,
|
|
956
|
-
mimeType: template.mimeType,
|
|
957
|
-
complete: template.complete,
|
|
958
|
-
list: template.list,
|
|
959
|
-
enabled: template.enabled,
|
|
960
|
-
icons: template.icons,
|
|
961
|
-
},
|
|
962
|
-
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
963
|
-
// from showing in intellisense when declaring a tool inline
|
|
964
|
-
template.execute,
|
|
965
|
-
);
|
|
893
|
+
this.template(template);
|
|
966
894
|
}
|
|
967
895
|
}
|
|
968
896
|
|
|
@@ -999,38 +927,18 @@ export class McpServer {
|
|
|
999
927
|
* @param {CreatedTool<TSchema, TOutputSchema> | ToolOptions<TSchema, TOutputSchema>} tool_or_options
|
|
1000
928
|
* @param {undefined | TSchema extends undefined ? (()=>Promise<CallToolResult<TOutputSchema extends undefined ? undefined : StandardSchemaV1.InferInput<TOutputSchema extends undefined ? never : TOutputSchema>>> | CallToolResult<TOutputSchema extends undefined ? undefined : StandardSchemaV1.InferInput<TOutputSchema extends undefined ? never : TOutputSchema>>) : ((input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<CallToolResult<TOutputSchema extends undefined ? undefined : StandardSchemaV1.InferInput<TOutputSchema extends undefined ? never : TOutputSchema>>> | CallToolResult<TOutputSchema extends undefined ? undefined : StandardSchemaV1.InferInput<TOutputSchema extends undefined ? never : TOutputSchema>>)} [execute]
|
|
1001
929
|
*/
|
|
1002
|
-
tool(
|
|
1003
|
-
{
|
|
1004
|
-
name,
|
|
1005
|
-
description,
|
|
1006
|
-
title,
|
|
1007
|
-
schema,
|
|
1008
|
-
outputSchema,
|
|
1009
|
-
annotations,
|
|
1010
|
-
enabled,
|
|
1011
|
-
icons,
|
|
1012
|
-
_meta,
|
|
1013
|
-
...tool_or_options
|
|
1014
|
-
},
|
|
1015
|
-
execute,
|
|
1016
|
-
) {
|
|
930
|
+
tool(tool_or_options, execute) {
|
|
1017
931
|
if ('execute' in tool_or_options) {
|
|
1018
932
|
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
1019
933
|
// from showing in intellisense when declaring a tool inline
|
|
1020
934
|
execute = tool_or_options.execute;
|
|
1021
935
|
}
|
|
1022
936
|
this.#notify_tools_list_changed();
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
outputSchema,
|
|
1029
|
-
execute: /** @type {NonNullable<typeof execute>} */ (execute),
|
|
1030
|
-
annotations,
|
|
1031
|
-
icons,
|
|
1032
|
-
_meta,
|
|
1033
|
-
});
|
|
937
|
+
const stored_tool = /** @type {Tool<any, any>} */ (tool_or_options);
|
|
938
|
+
stored_tool.execute = /** @type {NonNullable<typeof execute>} */ (
|
|
939
|
+
execute
|
|
940
|
+
);
|
|
941
|
+
this.#tools.set(tool_or_options.name, stored_tool);
|
|
1034
942
|
}
|
|
1035
943
|
|
|
1036
944
|
/**
|
|
@@ -1063,52 +971,43 @@ export class McpServer {
|
|
|
1063
971
|
* A prompt can also have a schema that defines the input it expects, the user will be prompted to enter the inputs you request. It can also have a complete function
|
|
1064
972
|
* for each input that will be used to provide completions for the user.
|
|
1065
973
|
* @template {StandardSchema | undefined} [TSchema=undefined]
|
|
1066
|
-
* @param {CreatedPrompt<TSchema> | PromptOptions<TSchema>}
|
|
974
|
+
* @param {CreatedPrompt<TSchema> | PromptOptions<TSchema>} prompt_or_options
|
|
1067
975
|
* @param {TSchema extends undefined ? (()=>Promise<GetPromptResult> | GetPromptResult) : (input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<GetPromptResult> | GetPromptResult} [execute]
|
|
1068
976
|
*/
|
|
1069
|
-
prompt(
|
|
1070
|
-
{
|
|
1071
|
-
name,
|
|
1072
|
-
description,
|
|
1073
|
-
title,
|
|
1074
|
-
schema,
|
|
1075
|
-
complete,
|
|
1076
|
-
enabled,
|
|
1077
|
-
icons,
|
|
1078
|
-
...prompt_or_options
|
|
1079
|
-
},
|
|
1080
|
-
execute,
|
|
1081
|
-
) {
|
|
977
|
+
prompt(prompt_or_options, execute) {
|
|
1082
978
|
if ('execute' in prompt_or_options) {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
979
|
+
execute = /** @type {NonNullable<typeof execute>} */ (
|
|
980
|
+
prompt_or_options.execute
|
|
981
|
+
);
|
|
1086
982
|
}
|
|
1087
|
-
if (complete) {
|
|
1088
|
-
this.#completions['ref/prompt'].set(
|
|
983
|
+
if (prompt_or_options.complete) {
|
|
984
|
+
this.#completions['ref/prompt'].set(
|
|
985
|
+
prompt_or_options.name,
|
|
986
|
+
prompt_or_options.complete,
|
|
987
|
+
);
|
|
1089
988
|
}
|
|
1090
989
|
this.#notify_prompts_list_changed();
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
enabled,
|
|
1097
|
-
icons,
|
|
1098
|
-
});
|
|
990
|
+
const stored_prompt = /** @type {Prompt<any>} */ (prompt_or_options);
|
|
991
|
+
stored_prompt.execute = /** @type {NonNullable<typeof execute>} */ (
|
|
992
|
+
execute
|
|
993
|
+
);
|
|
994
|
+
this.#prompts.set(prompt_or_options.name, stored_prompt);
|
|
1099
995
|
}
|
|
1100
996
|
/**
|
|
1101
|
-
* @type {(resource: StoredResource & {
|
|
997
|
+
* @type {(resource: StoredResource & { uri: string })=> void}
|
|
1102
998
|
*/
|
|
1103
|
-
#resource(
|
|
1104
|
-
if (complete) {
|
|
1105
|
-
this.#completions['ref/resource'].set(
|
|
999
|
+
#resource(resource) {
|
|
1000
|
+
if (resource.template && resource.complete) {
|
|
1001
|
+
this.#completions['ref/resource'].set(
|
|
1002
|
+
resource.uri,
|
|
1003
|
+
resource.complete,
|
|
1004
|
+
);
|
|
1106
1005
|
}
|
|
1107
1006
|
if (resource.template) {
|
|
1108
|
-
this.#templates.add(uri);
|
|
1007
|
+
this.#templates.add(resource.uri);
|
|
1109
1008
|
}
|
|
1110
1009
|
this.#notify_resources_list_changed();
|
|
1111
|
-
this.#resources.set(uri, resource);
|
|
1010
|
+
this.#resources.set(resource.uri, resource);
|
|
1112
1011
|
}
|
|
1113
1012
|
|
|
1114
1013
|
/**
|
|
@@ -1132,35 +1031,21 @@ export class McpServer {
|
|
|
1132
1031
|
* @param {CreatedResource | ResourceOptions} resource_or_options
|
|
1133
1032
|
* @param {(uri: string) => Promise<ReadResourceResult> | ReadResourceResult} [execute]
|
|
1134
1033
|
*/
|
|
1135
|
-
resource(
|
|
1136
|
-
{
|
|
1137
|
-
name,
|
|
1138
|
-
description,
|
|
1139
|
-
title,
|
|
1140
|
-
uri,
|
|
1141
|
-
mimeType,
|
|
1142
|
-
enabled,
|
|
1143
|
-
icons,
|
|
1144
|
-
...resource_or_options
|
|
1145
|
-
},
|
|
1146
|
-
execute,
|
|
1147
|
-
) {
|
|
1034
|
+
resource(resource_or_options, execute) {
|
|
1148
1035
|
if ('execute' in resource_or_options) {
|
|
1149
1036
|
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
1150
1037
|
// from showing in intellisense when declaring a tool inline
|
|
1151
1038
|
execute = resource_or_options.execute;
|
|
1152
1039
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
template: false,
|
|
1163
|
-
});
|
|
1040
|
+
const stored_resource =
|
|
1041
|
+
/** @type {StoredResource & { uri: string }} */ (
|
|
1042
|
+
resource_or_options
|
|
1043
|
+
);
|
|
1044
|
+
stored_resource.execute = /** @type {NonNullable<typeof execute>} */ (
|
|
1045
|
+
execute
|
|
1046
|
+
);
|
|
1047
|
+
stored_resource.template = false;
|
|
1048
|
+
this.#resource(stored_resource);
|
|
1164
1049
|
}
|
|
1165
1050
|
/**
|
|
1166
1051
|
* Add a resource template to the server. Resources are added manually to the context by the user to provide the LLM with additional context.
|
|
@@ -1198,39 +1083,23 @@ export class McpServer {
|
|
|
1198
1083
|
* @param {CreatedTemplate<TUri> | TemplateOptions<TUri>} template_or_options
|
|
1199
1084
|
* @param {(uri: string, params: Record<TVariables, string | string[]>) => Promise<ReadResourceResult> | ReadResourceResult} [execute]
|
|
1200
1085
|
*/
|
|
1201
|
-
template(
|
|
1202
|
-
{
|
|
1203
|
-
name,
|
|
1204
|
-
description,
|
|
1205
|
-
title,
|
|
1206
|
-
uri,
|
|
1207
|
-
mimeType,
|
|
1208
|
-
complete,
|
|
1209
|
-
list: list_resources,
|
|
1210
|
-
enabled,
|
|
1211
|
-
icons,
|
|
1212
|
-
...template_or_options
|
|
1213
|
-
},
|
|
1214
|
-
execute,
|
|
1215
|
-
) {
|
|
1086
|
+
template(template_or_options, execute) {
|
|
1216
1087
|
if ('execute' in template_or_options) {
|
|
1217
1088
|
// @ts-expect-error typescript doesn't know about execute because of an egregious hack to prevent it
|
|
1218
1089
|
// from showing in intellisense when declaring a tool inline
|
|
1219
1090
|
execute = template_or_options.execute;
|
|
1220
1091
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
template: true,
|
|
1233
|
-
});
|
|
1092
|
+
const stored_template =
|
|
1093
|
+
/** @type {StoredResource & { uri: string }} */ (
|
|
1094
|
+
/** @type {unknown} */ (template_or_options)
|
|
1095
|
+
);
|
|
1096
|
+
stored_template.execute = /** @type {NonNullable<typeof execute>} */ (
|
|
1097
|
+
execute
|
|
1098
|
+
);
|
|
1099
|
+
// @ts-expect-error list_resources only exists on template resources
|
|
1100
|
+
stored_template.list_resources = template_or_options.list;
|
|
1101
|
+
stored_template.template = true;
|
|
1102
|
+
this.#resource(stored_template);
|
|
1234
1103
|
}
|
|
1235
1104
|
/**
|
|
1236
1105
|
* The main function that receive a JSONRpc message and either dispatch a `send` event or process the request.
|
|
@@ -67,42 +67,26 @@ export type CreatedPrompt<TSchema extends StandardSchemaV1 | undefined = undefin
|
|
|
67
67
|
export type CreatedResource = ResourceOptions & { [created_resource]: created_resource };
|
|
68
68
|
export type CreatedTemplate<TUri extends string = string> = TemplateOptions<TUri> & { [created_template]: created_template };
|
|
69
69
|
|
|
70
|
-
export type Tool<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = {
|
|
71
|
-
description: string;
|
|
72
|
-
schema: TSchema;
|
|
73
|
-
outputSchema?: TOutputSchema;
|
|
74
|
-
title?: string;
|
|
75
|
-
annotations?: ToolAnnotations;
|
|
76
|
-
_meta?: Record<string, unknown>;
|
|
77
|
-
enabled?: () => boolean | Promise<boolean>;
|
|
70
|
+
export type Tool<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = ToolOptions<TSchema, TOutputSchema> & {
|
|
78
71
|
execute: (
|
|
79
72
|
input?: StandardSchemaV1.InferInput<TSchema>,
|
|
80
73
|
) => Promise<CallToolResult> | CallToolResult;
|
|
81
|
-
}
|
|
74
|
+
};
|
|
82
75
|
|
|
83
76
|
export type Completion = (
|
|
84
77
|
query: string,
|
|
85
78
|
context: { arguments: Record<string, string> },
|
|
86
79
|
) => CompleteResult | Promise<CompleteResult>;
|
|
87
80
|
|
|
88
|
-
export type Prompt<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = {
|
|
89
|
-
description: string;
|
|
90
|
-
schema: TSchema;
|
|
91
|
-
title?: string;
|
|
92
|
-
enabled?: () => boolean | Promise<boolean>;
|
|
81
|
+
export type Prompt<TSchema extends StandardSchemaV1 = StandardSchemaV1<any>> = PromptOptions<TSchema> & {
|
|
93
82
|
execute: (
|
|
94
83
|
input?: StandardSchemaV1.InferInput<TSchema>,
|
|
95
84
|
) => Promise<GetPromptResult> | GetPromptResult;
|
|
96
|
-
}
|
|
85
|
+
};
|
|
97
86
|
|
|
98
87
|
export type StoredResource =
|
|
99
|
-
| {
|
|
100
|
-
description: string;
|
|
101
|
-
name: string;
|
|
88
|
+
| TemplateOptions<string, string> & {
|
|
102
89
|
template: true;
|
|
103
|
-
title?: string;
|
|
104
|
-
mimeType?: string;
|
|
105
|
-
enabled?: () => boolean | Promise<boolean>;
|
|
106
90
|
list_resources?: () =>
|
|
107
91
|
| Promise<Array<Resource>>
|
|
108
92
|
| Array<Resource>;
|
|
@@ -110,18 +94,13 @@ export type StoredResource =
|
|
|
110
94
|
uri: string,
|
|
111
95
|
params: Record<string, string | string[]>,
|
|
112
96
|
) => Promise<ReadResourceResult> | ReadResourceResult;
|
|
113
|
-
}
|
|
114
|
-
| {
|
|
115
|
-
description: string;
|
|
116
|
-
name: string;
|
|
97
|
+
}
|
|
98
|
+
| ResourceOptions & {
|
|
117
99
|
template: false;
|
|
118
|
-
title?: string;
|
|
119
|
-
mimeType?: string;
|
|
120
|
-
enabled?: () => boolean | Promise<boolean>;
|
|
121
100
|
execute: (
|
|
122
101
|
uri: string,
|
|
123
102
|
) => Promise<ReadResourceResult> | ReadResourceResult;
|
|
124
|
-
}
|
|
103
|
+
};
|
|
125
104
|
|
|
126
105
|
export type ServerOptions<TSchema extends StandardSchemaV1 | undefined> = {
|
|
127
106
|
capabilities?: ServerCapabilities;
|
package/src/types/index.d.ts.map
CHANGED
|
@@ -103,6 +103,6 @@
|
|
|
103
103
|
null,
|
|
104
104
|
null
|
|
105
105
|
],
|
|
106
|
-
"mappings": ";;;;;cAkLaA,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aC+zCyBC,KAAKA;aDl7CFC,aAAaA;;aCy8CHC,kBAAkBA;aAGrBC,eAAeA;aAvBZC,kBAAkBA;aAUKC,UAAUA;aAmBzBC,0BAA0BA;aAGjCC,mBAAmBA;aAY9BC,QAAQA;aAYJC,YAAYA;aAlDVC,UAAUA;aAwDZC,YAAYA;aAGRC,gBAAgBA;aAGjBC,eAAeA;aAGbC,iBAAiBA;aAMPC,2BAA2BA;aAHnCC,mBAAmBA;aAhDxBC,cAAcA;OC7/CxDC,YAAYA;OACZC,cAAcA;OACdC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