@atxp/client 0.2.21 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/ajv.js +8 -0
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/cache.js +4 -0
- package/dist/_virtual/cache.js.map +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/uri.all.js +4 -0
- package/dist/_virtual/uri.all.js.map +1 -0
- package/dist/atxpAccount.js +4 -2
- package/dist/atxpAccount.js.map +1 -1
- package/dist/atxpClient.js +12 -10
- package/dist/atxpClient.js.map +1 -1
- package/dist/atxpFetcher.js +10 -8
- package/dist/atxpFetcher.js.map +1 -1
- package/dist/baseAccount.js +5 -3
- package/dist/baseAccount.js.map +1 -1
- package/dist/baseConstants.js +4 -0
- package/dist/baseConstants.js.map +1 -0
- package/dist/basePaymentMaker.js +15 -12
- package/dist/basePaymentMaker.js.map +1 -1
- package/dist/index.cjs +15595 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +250 -10
- package/dist/index.js +15558 -10
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +398 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +273 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +378 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +46 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +120 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +380 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1254 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/ajv/lib/ajv.js +531 -0
- package/dist/node_modules/ajv/lib/ajv.js.map +1 -0
- package/dist/node_modules/ajv/lib/cache.js +37 -0
- package/dist/node_modules/ajv/lib/cache.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/async.js +102 -0
- package/dist/node_modules/ajv/lib/compile/async.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/error_classes.js +46 -0
- package/dist/node_modules/ajv/lib/compile/error_classes.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/formats.js +154 -0
- package/dist/node_modules/ajv/lib/compile/formats.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/index.js +404 -0
- package/dist/node_modules/ajv/lib/compile/index.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/resolve.js +286 -0
- package/dist/node_modules/ajv/lib/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/rules.js +79 -0
- package/dist/node_modules/ajv/lib/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/schema_obj.js +21 -0
- package/dist/node_modules/ajv/lib/compile/schema_obj.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/ucs2length.js +30 -0
- package/dist/node_modules/ajv/lib/compile/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv/lib/compile/util.js +252 -0
- package/dist/node_modules/ajv/lib/compile/util.js.map +1 -0
- package/dist/node_modules/ajv/lib/data.js +59 -0
- package/dist/node_modules/ajv/lib/data.js.map +1 -0
- package/dist/node_modules/ajv/lib/definition_schema.js +49 -0
- package/dist/node_modules/ajv/lib/definition_schema.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/_limit.js +173 -0
- package/dist/node_modules/ajv/lib/dotjs/_limit.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +90 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitItems.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +95 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitLength.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +90 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/allOf.js +52 -0
- package/dist/node_modules/ajv/lib/dotjs/allOf.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/anyOf.js +83 -0
- package/dist/node_modules/ajv/lib/dotjs/anyOf.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/comment.js +24 -0
- package/dist/node_modules/ajv/lib/dotjs/comment.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/const.js +62 -0
- package/dist/node_modules/ajv/lib/dotjs/const.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/contains.js +91 -0
- package/dist/node_modules/ajv/lib/dotjs/contains.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/custom.js +238 -0
- package/dist/node_modules/ajv/lib/dotjs/custom.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/dependencies.js +178 -0
- package/dist/node_modules/ajv/lib/dotjs/dependencies.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/enum.js +72 -0
- package/dist/node_modules/ajv/lib/dotjs/enum.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/format.js +160 -0
- package/dist/node_modules/ajv/lib/dotjs/format.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/if.js +113 -0
- package/dist/node_modules/ajv/lib/dotjs/if.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/index.js +68 -0
- package/dist/node_modules/ajv/lib/dotjs/index.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/items.js +150 -0
- package/dist/node_modules/ajv/lib/dotjs/items.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +90 -0
- package/dist/node_modules/ajv/lib/dotjs/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/not.js +94 -0
- package/dist/node_modules/ajv/lib/dotjs/not.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/oneOf.js +83 -0
- package/dist/node_modules/ajv/lib/dotjs/oneOf.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/pattern.js +85 -0
- package/dist/node_modules/ajv/lib/dotjs/pattern.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/properties.js +345 -0
- package/dist/node_modules/ajv/lib/dotjs/properties.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +91 -0
- package/dist/node_modules/ajv/lib/dotjs/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/ref.js +134 -0
- package/dist/node_modules/ajv/lib/dotjs/ref.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/required.js +276 -0
- package/dist/node_modules/ajv/lib/dotjs/required.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +96 -0
- package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js.map +1 -0
- package/dist/node_modules/ajv/lib/dotjs/validate.js +492 -0
- package/dist/node_modules/ajv/lib/dotjs/validate.js.map +1 -0
- package/dist/node_modules/ajv/lib/keyword.js +159 -0
- package/dist/node_modules/ajv/lib/keyword.js.map +1 -0
- package/dist/node_modules/ajv/lib/refs/data.json.js +33 -0
- package/dist/node_modules/ajv/lib/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js +254 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/eventsource-parser/dist/index.js +104 -0
- package/dist/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/dist/node_modules/eventsource-parser/dist/stream.js +28 -0
- package/dist/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/dist/node_modules/fast-deep-equal/index.js +56 -0
- package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/fast-json-stable-stringify/index.js +69 -0
- package/dist/node_modules/fast-json-stable-stringify/index.js.map +1 -0
- package/dist/node_modules/json-schema-traverse/index.js +100 -0
- package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/pkce-challenge/dist/index.browser.js +66 -0
- package/dist/node_modules/pkce-challenge/dist/index.browser.js.map +1 -0
- package/dist/node_modules/uri-js/dist/es5/uri.all.js +1418 -0
- package/dist/node_modules/uri-js/dist/es5/uri.all.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
- package/dist/node_modules/zod/dist/esm/v3/ZodError.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/errors.js +9 -0
- package/dist/node_modules/zod/dist/esm/v3/errors.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +9 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +112 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/util.js +136 -0
- package/dist/node_modules/zod/dist/esm/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/locales/en.js +110 -0
- package/dist/node_modules/zod/dist/esm/v3/locales/en.js.map +1 -0
- package/dist/node_modules/zod/dist/esm/v3/types.js +3488 -0
- package/dist/node_modules/zod/dist/esm/v3/types.js.map +1 -0
- package/dist/oAuth.js +7 -6
- package/dist/oAuth.js.map +1 -1
- package/dist/solanaAccount.js +7 -4
- package/dist/solanaAccount.js.map +1 -1
- package/dist/solanaPaymentMaker.js +15 -12
- package/dist/solanaPaymentMaker.js.map +1 -1
- package/dist/types.js +5 -3
- package/dist/types.js.map +1 -1
- package/package.json +26 -10
- package/dist/atxpAccount.d.ts +0 -13
- package/dist/atxpAccount.d.ts.map +0 -1
- package/dist/atxpClient.d.ts +0 -14
- package/dist/atxpClient.d.ts.map +0 -1
- package/dist/atxpFetcher.d.ts +0 -72
- package/dist/atxpFetcher.d.ts.map +0 -1
- package/dist/baseAccount.d.ts +0 -10
- package/dist/baseAccount.d.ts.map +0 -1
- package/dist/basePaymentMaker.d.ts +0 -16
- package/dist/basePaymentMaker.d.ts.map +0 -1
- package/dist/clientTestHelpers.d.ts +0 -6
- package/dist/clientTestHelpers.d.ts.map +0 -1
- package/dist/clientTestHelpers.js +0 -94
- package/dist/clientTestHelpers.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/oAuth.d.ts +0 -44
- package/dist/oAuth.d.ts.map +0 -1
- package/dist/setup.expo.d.ts +0 -2
- package/dist/setup.expo.d.ts.map +0 -1
- package/dist/setup.expo.js +0 -30
- package/dist/setup.expo.js.map +0 -1
- package/dist/solanaAccount.d.ts +0 -9
- package/dist/solanaAccount.d.ts.map +0 -1
- package/dist/solanaPaymentMaker.d.ts +0 -18
- package/dist/solanaPaymentMaker.d.ts.map +0 -1
- package/dist/types.d.ts +0 -70
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { Protocol, mergeCapabilities } from '../shared/protocol.js';
|
|
2
|
+
import { LATEST_PROTOCOL_VERSION, InitializeResultSchema, SUPPORTED_PROTOCOL_VERSIONS, EmptyResultSchema, CompleteResultSchema, GetPromptResultSchema, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ReadResourceResultSchema, CallToolResultSchema, McpError, ErrorCode, ListToolsResultSchema } from '../types.js';
|
|
3
|
+
import Ajv from '../../../../../../_virtual/ajv.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An MCP client on top of a pluggable transport.
|
|
7
|
+
*
|
|
8
|
+
* The client will automatically begin the initialization flow with the server when connect() is called.
|
|
9
|
+
*
|
|
10
|
+
* To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Custom schemas
|
|
14
|
+
* const CustomRequestSchema = RequestSchema.extend({...})
|
|
15
|
+
* const CustomNotificationSchema = NotificationSchema.extend({...})
|
|
16
|
+
* const CustomResultSchema = ResultSchema.extend({...})
|
|
17
|
+
*
|
|
18
|
+
* // Type aliases
|
|
19
|
+
* type CustomRequest = z.infer<typeof CustomRequestSchema>
|
|
20
|
+
* type CustomNotification = z.infer<typeof CustomNotificationSchema>
|
|
21
|
+
* type CustomResult = z.infer<typeof CustomResultSchema>
|
|
22
|
+
*
|
|
23
|
+
* // Create typed client
|
|
24
|
+
* const client = new Client<CustomRequest, CustomNotification, CustomResult>({
|
|
25
|
+
* name: "CustomClient",
|
|
26
|
+
* version: "1.0.0"
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
class Client extends Protocol {
|
|
31
|
+
/**
|
|
32
|
+
* Initializes this client with the given name and version information.
|
|
33
|
+
*/
|
|
34
|
+
constructor(_clientInfo, options) {
|
|
35
|
+
var _a;
|
|
36
|
+
super(options);
|
|
37
|
+
this._clientInfo = _clientInfo;
|
|
38
|
+
this._cachedToolOutputValidators = new Map();
|
|
39
|
+
this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {};
|
|
40
|
+
this._ajv = new Ajv();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Registers new capabilities. This can only be called before connecting to a transport.
|
|
44
|
+
*
|
|
45
|
+
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
|
|
46
|
+
*/
|
|
47
|
+
registerCapabilities(capabilities) {
|
|
48
|
+
if (this.transport) {
|
|
49
|
+
throw new Error("Cannot register capabilities after connecting to transport");
|
|
50
|
+
}
|
|
51
|
+
this._capabilities = mergeCapabilities(this._capabilities, capabilities);
|
|
52
|
+
}
|
|
53
|
+
assertCapability(capability, method) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) {
|
|
56
|
+
throw new Error(`Server does not support ${capability} (required for ${method})`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async connect(transport, options) {
|
|
60
|
+
await super.connect(transport);
|
|
61
|
+
// When transport sessionId is already set this means we are trying to reconnect.
|
|
62
|
+
// In this case we don't need to initialize again.
|
|
63
|
+
if (transport.sessionId !== undefined) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const result = await this.request({
|
|
68
|
+
method: "initialize",
|
|
69
|
+
params: {
|
|
70
|
+
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
71
|
+
capabilities: this._capabilities,
|
|
72
|
+
clientInfo: this._clientInfo,
|
|
73
|
+
},
|
|
74
|
+
}, InitializeResultSchema, options);
|
|
75
|
+
if (result === undefined) {
|
|
76
|
+
throw new Error(`Server sent invalid initialize result: ${result}`);
|
|
77
|
+
}
|
|
78
|
+
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
|
|
79
|
+
throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
|
|
80
|
+
}
|
|
81
|
+
this._serverCapabilities = result.capabilities;
|
|
82
|
+
this._serverVersion = result.serverInfo;
|
|
83
|
+
// HTTP transports must set the protocol version in each header after initialization.
|
|
84
|
+
if (transport.setProtocolVersion) {
|
|
85
|
+
transport.setProtocolVersion(result.protocolVersion);
|
|
86
|
+
}
|
|
87
|
+
this._instructions = result.instructions;
|
|
88
|
+
await this.notification({
|
|
89
|
+
method: "notifications/initialized",
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
// Disconnect if initialization fails.
|
|
94
|
+
void this.close();
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* After initialization has completed, this will be populated with the server's reported capabilities.
|
|
100
|
+
*/
|
|
101
|
+
getServerCapabilities() {
|
|
102
|
+
return this._serverCapabilities;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* After initialization has completed, this will be populated with information about the server's name and version.
|
|
106
|
+
*/
|
|
107
|
+
getServerVersion() {
|
|
108
|
+
return this._serverVersion;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* After initialization has completed, this may be populated with information about the server's instructions.
|
|
112
|
+
*/
|
|
113
|
+
getInstructions() {
|
|
114
|
+
return this._instructions;
|
|
115
|
+
}
|
|
116
|
+
assertCapabilityForMethod(method) {
|
|
117
|
+
var _a, _b, _c, _d, _e;
|
|
118
|
+
switch (method) {
|
|
119
|
+
case "logging/setLevel":
|
|
120
|
+
if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) {
|
|
121
|
+
throw new Error(`Server does not support logging (required for ${method})`);
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
case "prompts/get":
|
|
125
|
+
case "prompts/list":
|
|
126
|
+
if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) {
|
|
127
|
+
throw new Error(`Server does not support prompts (required for ${method})`);
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case "resources/list":
|
|
131
|
+
case "resources/templates/list":
|
|
132
|
+
case "resources/read":
|
|
133
|
+
case "resources/subscribe":
|
|
134
|
+
case "resources/unsubscribe":
|
|
135
|
+
if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) {
|
|
136
|
+
throw new Error(`Server does not support resources (required for ${method})`);
|
|
137
|
+
}
|
|
138
|
+
if (method === "resources/subscribe" &&
|
|
139
|
+
!this._serverCapabilities.resources.subscribe) {
|
|
140
|
+
throw new Error(`Server does not support resource subscriptions (required for ${method})`);
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
case "tools/call":
|
|
144
|
+
case "tools/list":
|
|
145
|
+
if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) {
|
|
146
|
+
throw new Error(`Server does not support tools (required for ${method})`);
|
|
147
|
+
}
|
|
148
|
+
break;
|
|
149
|
+
case "completion/complete":
|
|
150
|
+
if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.completions)) {
|
|
151
|
+
throw new Error(`Server does not support completions (required for ${method})`);
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
assertNotificationCapability(method) {
|
|
157
|
+
var _a;
|
|
158
|
+
switch (method) {
|
|
159
|
+
case "notifications/roots/list_changed":
|
|
160
|
+
if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) {
|
|
161
|
+
throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
|
|
162
|
+
}
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
assertRequestHandlerCapability(method) {
|
|
167
|
+
switch (method) {
|
|
168
|
+
case "sampling/createMessage":
|
|
169
|
+
if (!this._capabilities.sampling) {
|
|
170
|
+
throw new Error(`Client does not support sampling capability (required for ${method})`);
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case "elicitation/create":
|
|
174
|
+
if (!this._capabilities.elicitation) {
|
|
175
|
+
throw new Error(`Client does not support elicitation capability (required for ${method})`);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case "roots/list":
|
|
179
|
+
if (!this._capabilities.roots) {
|
|
180
|
+
throw new Error(`Client does not support roots capability (required for ${method})`);
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async ping(options) {
|
|
186
|
+
return this.request({ method: "ping" }, EmptyResultSchema, options);
|
|
187
|
+
}
|
|
188
|
+
async complete(params, options) {
|
|
189
|
+
return this.request({ method: "completion/complete", params }, CompleteResultSchema, options);
|
|
190
|
+
}
|
|
191
|
+
async setLoggingLevel(level, options) {
|
|
192
|
+
return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options);
|
|
193
|
+
}
|
|
194
|
+
async getPrompt(params, options) {
|
|
195
|
+
return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options);
|
|
196
|
+
}
|
|
197
|
+
async listPrompts(params, options) {
|
|
198
|
+
return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options);
|
|
199
|
+
}
|
|
200
|
+
async listResources(params, options) {
|
|
201
|
+
return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options);
|
|
202
|
+
}
|
|
203
|
+
async listResourceTemplates(params, options) {
|
|
204
|
+
return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options);
|
|
205
|
+
}
|
|
206
|
+
async readResource(params, options) {
|
|
207
|
+
return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options);
|
|
208
|
+
}
|
|
209
|
+
async subscribeResource(params, options) {
|
|
210
|
+
return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options);
|
|
211
|
+
}
|
|
212
|
+
async unsubscribeResource(params, options) {
|
|
213
|
+
return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options);
|
|
214
|
+
}
|
|
215
|
+
async callTool(params, resultSchema = CallToolResultSchema, options) {
|
|
216
|
+
const result = await this.request({ method: "tools/call", params }, resultSchema, options);
|
|
217
|
+
// Check if the tool has an outputSchema
|
|
218
|
+
const validator = this.getToolOutputValidator(params.name);
|
|
219
|
+
if (validator) {
|
|
220
|
+
// If tool has outputSchema, it MUST return structuredContent (unless it's an error)
|
|
221
|
+
if (!result.structuredContent && !result.isError) {
|
|
222
|
+
throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
|
|
223
|
+
}
|
|
224
|
+
// Only validate structured content if present (not when there's an error)
|
|
225
|
+
if (result.structuredContent) {
|
|
226
|
+
try {
|
|
227
|
+
// Validate the structured content (which is already an object) against the schema
|
|
228
|
+
const isValid = validator(result.structuredContent);
|
|
229
|
+
if (!isValid) {
|
|
230
|
+
throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${this._ajv.errorsText(validator.errors)}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
if (error instanceof McpError) {
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
cacheToolOutputSchemas(tools) {
|
|
244
|
+
this._cachedToolOutputValidators.clear();
|
|
245
|
+
for (const tool of tools) {
|
|
246
|
+
// If the tool has an outputSchema, create and cache the Ajv validator
|
|
247
|
+
if (tool.outputSchema) {
|
|
248
|
+
try {
|
|
249
|
+
const validator = this._ajv.compile(tool.outputSchema);
|
|
250
|
+
this._cachedToolOutputValidators.set(tool.name, validator);
|
|
251
|
+
}
|
|
252
|
+
catch (_a) {
|
|
253
|
+
// Ignore schema compilation errors
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
getToolOutputValidator(toolName) {
|
|
259
|
+
return this._cachedToolOutputValidators.get(toolName);
|
|
260
|
+
}
|
|
261
|
+
async listTools(params, options) {
|
|
262
|
+
const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
|
|
263
|
+
// Cache the tools and their output schemas for future validation
|
|
264
|
+
this.cacheToolOutputSchemas(result.tools);
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
async sendRootsListChanged() {
|
|
268
|
+
return this.notification({ method: "notifications/roots/list_changed" });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export { Client };
|
|
273
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../../node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js"],"sourcesContent":["import { mergeCapabilities, Protocol, } from \"../shared/protocol.js\";\nimport { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, ErrorCode, McpError, } from \"../types.js\";\nimport Ajv from \"ajv\";\n/**\n * An MCP client on top of a pluggable transport.\n *\n * The client will automatically begin the initialization flow with the server when connect() is called.\n *\n * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:\n *\n * ```typescript\n * // Custom schemas\n * const CustomRequestSchema = RequestSchema.extend({...})\n * const CustomNotificationSchema = NotificationSchema.extend({...})\n * const CustomResultSchema = ResultSchema.extend({...})\n *\n * // Type aliases\n * type CustomRequest = z.infer<typeof CustomRequestSchema>\n * type CustomNotification = z.infer<typeof CustomNotificationSchema>\n * type CustomResult = z.infer<typeof CustomResultSchema>\n *\n * // Create typed client\n * const client = new Client<CustomRequest, CustomNotification, CustomResult>({\n * name: \"CustomClient\",\n * version: \"1.0.0\"\n * })\n * ```\n */\nexport class Client extends Protocol {\n /**\n * Initializes this client with the given name and version information.\n */\n constructor(_clientInfo, options) {\n var _a;\n super(options);\n this._clientInfo = _clientInfo;\n this._cachedToolOutputValidators = new Map();\n this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {};\n this._ajv = new Ajv();\n }\n /**\n * Registers new capabilities. This can only be called before connecting to a transport.\n *\n * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).\n */\n registerCapabilities(capabilities) {\n if (this.transport) {\n throw new Error(\"Cannot register capabilities after connecting to transport\");\n }\n this._capabilities = mergeCapabilities(this._capabilities, capabilities);\n }\n assertCapability(capability, method) {\n var _a;\n if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) {\n throw new Error(`Server does not support ${capability} (required for ${method})`);\n }\n }\n async connect(transport, options) {\n await super.connect(transport);\n // When transport sessionId is already set this means we are trying to reconnect.\n // In this case we don't need to initialize again.\n if (transport.sessionId !== undefined) {\n return;\n }\n try {\n const result = await this.request({\n method: \"initialize\",\n params: {\n protocolVersion: LATEST_PROTOCOL_VERSION,\n capabilities: this._capabilities,\n clientInfo: this._clientInfo,\n },\n }, InitializeResultSchema, options);\n if (result === undefined) {\n throw new Error(`Server sent invalid initialize result: ${result}`);\n }\n if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {\n throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);\n }\n this._serverCapabilities = result.capabilities;\n this._serverVersion = result.serverInfo;\n // HTTP transports must set the protocol version in each header after initialization.\n if (transport.setProtocolVersion) {\n transport.setProtocolVersion(result.protocolVersion);\n }\n this._instructions = result.instructions;\n await this.notification({\n method: \"notifications/initialized\",\n });\n }\n catch (error) {\n // Disconnect if initialization fails.\n void this.close();\n throw error;\n }\n }\n /**\n * After initialization has completed, this will be populated with the server's reported capabilities.\n */\n getServerCapabilities() {\n return this._serverCapabilities;\n }\n /**\n * After initialization has completed, this will be populated with information about the server's name and version.\n */\n getServerVersion() {\n return this._serverVersion;\n }\n /**\n * After initialization has completed, this may be populated with information about the server's instructions.\n */\n getInstructions() {\n return this._instructions;\n }\n assertCapabilityForMethod(method) {\n var _a, _b, _c, _d, _e;\n switch (method) {\n case \"logging/setLevel\":\n if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) {\n throw new Error(`Server does not support logging (required for ${method})`);\n }\n break;\n case \"prompts/get\":\n case \"prompts/list\":\n if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) {\n throw new Error(`Server does not support prompts (required for ${method})`);\n }\n break;\n case \"resources/list\":\n case \"resources/templates/list\":\n case \"resources/read\":\n case \"resources/subscribe\":\n case \"resources/unsubscribe\":\n if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) {\n throw new Error(`Server does not support resources (required for ${method})`);\n }\n if (method === \"resources/subscribe\" &&\n !this._serverCapabilities.resources.subscribe) {\n throw new Error(`Server does not support resource subscriptions (required for ${method})`);\n }\n break;\n case \"tools/call\":\n case \"tools/list\":\n if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) {\n throw new Error(`Server does not support tools (required for ${method})`);\n }\n break;\n case \"completion/complete\":\n if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.completions)) {\n throw new Error(`Server does not support completions (required for ${method})`);\n }\n break;\n case \"initialize\":\n // No specific capability required for initialize\n break;\n case \"ping\":\n // No specific capability required for ping\n break;\n }\n }\n assertNotificationCapability(method) {\n var _a;\n switch (method) {\n case \"notifications/roots/list_changed\":\n if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) {\n throw new Error(`Client does not support roots list changed notifications (required for ${method})`);\n }\n break;\n case \"notifications/initialized\":\n // No specific capability required for initialized\n break;\n case \"notifications/cancelled\":\n // Cancellation notifications are always allowed\n break;\n case \"notifications/progress\":\n // Progress notifications are always allowed\n break;\n }\n }\n assertRequestHandlerCapability(method) {\n switch (method) {\n case \"sampling/createMessage\":\n if (!this._capabilities.sampling) {\n throw new Error(`Client does not support sampling capability (required for ${method})`);\n }\n break;\n case \"elicitation/create\":\n if (!this._capabilities.elicitation) {\n throw new Error(`Client does not support elicitation capability (required for ${method})`);\n }\n break;\n case \"roots/list\":\n if (!this._capabilities.roots) {\n throw new Error(`Client does not support roots capability (required for ${method})`);\n }\n break;\n case \"ping\":\n // No specific capability required for ping\n break;\n }\n }\n async ping(options) {\n return this.request({ method: \"ping\" }, EmptyResultSchema, options);\n }\n async complete(params, options) {\n return this.request({ method: \"completion/complete\", params }, CompleteResultSchema, options);\n }\n async setLoggingLevel(level, options) {\n return this.request({ method: \"logging/setLevel\", params: { level } }, EmptyResultSchema, options);\n }\n async getPrompt(params, options) {\n return this.request({ method: \"prompts/get\", params }, GetPromptResultSchema, options);\n }\n async listPrompts(params, options) {\n return this.request({ method: \"prompts/list\", params }, ListPromptsResultSchema, options);\n }\n async listResources(params, options) {\n return this.request({ method: \"resources/list\", params }, ListResourcesResultSchema, options);\n }\n async listResourceTemplates(params, options) {\n return this.request({ method: \"resources/templates/list\", params }, ListResourceTemplatesResultSchema, options);\n }\n async readResource(params, options) {\n return this.request({ method: \"resources/read\", params }, ReadResourceResultSchema, options);\n }\n async subscribeResource(params, options) {\n return this.request({ method: \"resources/subscribe\", params }, EmptyResultSchema, options);\n }\n async unsubscribeResource(params, options) {\n return this.request({ method: \"resources/unsubscribe\", params }, EmptyResultSchema, options);\n }\n async callTool(params, resultSchema = CallToolResultSchema, options) {\n const result = await this.request({ method: \"tools/call\", params }, resultSchema, options);\n // Check if the tool has an outputSchema\n const validator = this.getToolOutputValidator(params.name);\n if (validator) {\n // If tool has outputSchema, it MUST return structuredContent (unless it's an error)\n if (!result.structuredContent && !result.isError) {\n throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);\n }\n // Only validate structured content if present (not when there's an error)\n if (result.structuredContent) {\n try {\n // Validate the structured content (which is already an object) against the schema\n const isValid = validator(result.structuredContent);\n if (!isValid) {\n throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${this._ajv.errorsText(validator.errors)}`);\n }\n }\n catch (error) {\n if (error instanceof McpError) {\n throw error;\n }\n throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n }\n return result;\n }\n cacheToolOutputSchemas(tools) {\n this._cachedToolOutputValidators.clear();\n for (const tool of tools) {\n // If the tool has an outputSchema, create and cache the Ajv validator\n if (tool.outputSchema) {\n try {\n const validator = this._ajv.compile(tool.outputSchema);\n this._cachedToolOutputValidators.set(tool.name, validator);\n }\n catch (_a) {\n // Ignore schema compilation errors\n }\n }\n }\n }\n getToolOutputValidator(toolName) {\n return this._cachedToolOutputValidators.get(toolName);\n }\n async listTools(params, options) {\n const result = await this.request({ method: \"tools/list\", params }, ListToolsResultSchema, options);\n // Cache the tools and their output schemas for future validation\n this.cacheToolOutputSchemas(result.tools);\n return result;\n }\n async sendRootsListChanged() {\n return this.notification({ method: \"notifications/roots/list_changed\" });\n }\n}\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAAS,QAAQ,CAAC;AACrC;AACA;AACA;AACA,IAAI,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE;AACtC,QAAQ,IAAI,EAAE;AACd,QAAQ,KAAK,CAAC,OAAO,CAAC;AACtB,QAAQ,IAAI,CAAC,WAAW,GAAG,WAAW;AACtC,QAAQ,IAAI,CAAC,2BAA2B,GAAG,IAAI,GAAG,EAAE;AACpD,QAAQ,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE,GAAG,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,EAAE;AAC9I,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE;AAC7B,IAAI;AACJ;AACA;AACA;AACA;AAC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