@ai-sdk/mcp 2.0.55 → 2.0.57
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/CHANGELOG.md +18 -0
- package/dist/index.js +36 -63
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/tool/mcp-client.ts +37 -65
- package/src/tool/oauth.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/mcp
|
|
2
2
|
|
|
3
|
+
## 2.0.57
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 771e74b: chore: enable dead code lint rules
|
|
8
|
+
- Updated dependencies [fe07867]
|
|
9
|
+
- Updated dependencies [a4b0940]
|
|
10
|
+
- Updated dependencies [771e74b]
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.47
|
|
12
|
+
|
|
13
|
+
## 2.0.56
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [ffb0e76]
|
|
18
|
+
- @ai-sdk/provider@4.0.18
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.46
|
|
20
|
+
|
|
3
21
|
## 2.0.55
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -950,7 +950,6 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, {
|
|
|
950
950
|
return metadata;
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
return void 0;
|
|
954
953
|
}
|
|
955
954
|
async function startAuthorization(authorizationServerUrl, {
|
|
956
955
|
metadata,
|
|
@@ -2541,13 +2540,11 @@ function getErrorStatusCode(error) {
|
|
|
2541
2540
|
if (error != null && typeof error === "object" && "statusCode" in error && typeof error.statusCode === "number") {
|
|
2542
2541
|
return error.statusCode;
|
|
2543
2542
|
}
|
|
2544
|
-
return void 0;
|
|
2545
2543
|
}
|
|
2546
2544
|
function getStringErrorCode(error) {
|
|
2547
2545
|
if (error != null && typeof error === "object" && "code" in error && typeof error.code === "string") {
|
|
2548
2546
|
return error.code;
|
|
2549
2547
|
}
|
|
2550
|
-
return void 0;
|
|
2551
2548
|
}
|
|
2552
2549
|
function isRetryableMCPToolCallError(error) {
|
|
2553
2550
|
const statusCode = getErrorStatusCode(error);
|
|
@@ -3103,91 +3100,67 @@ var DefaultMCPClient = class {
|
|
|
3103
3100
|
arguments: args = {},
|
|
3104
3101
|
options
|
|
3105
3102
|
}) {
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
});
|
|
3118
|
-
} catch (error) {
|
|
3119
|
-
throw error;
|
|
3120
|
-
}
|
|
3103
|
+
return this.callToolWithRetry({
|
|
3104
|
+
options,
|
|
3105
|
+
execute: () => this.request({
|
|
3106
|
+
request: {
|
|
3107
|
+
method: "tools/call",
|
|
3108
|
+
params: { name: name3, arguments: args }
|
|
3109
|
+
},
|
|
3110
|
+
resultSchema: CallToolResultSchema,
|
|
3111
|
+
options
|
|
3112
|
+
})
|
|
3113
|
+
});
|
|
3121
3114
|
}
|
|
3122
3115
|
async listResourcesInternal({
|
|
3123
3116
|
params,
|
|
3124
3117
|
options
|
|
3125
3118
|
} = {}) {
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
});
|
|
3132
|
-
} catch (error) {
|
|
3133
|
-
throw error;
|
|
3134
|
-
}
|
|
3119
|
+
return this.request({
|
|
3120
|
+
request: { method: "resources/list", params },
|
|
3121
|
+
resultSchema: ListResourcesResultSchema,
|
|
3122
|
+
options
|
|
3123
|
+
});
|
|
3135
3124
|
}
|
|
3136
3125
|
async readResourceInternal({
|
|
3137
3126
|
uri,
|
|
3138
3127
|
options
|
|
3139
3128
|
}) {
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
});
|
|
3146
|
-
} catch (error) {
|
|
3147
|
-
throw error;
|
|
3148
|
-
}
|
|
3129
|
+
return this.request({
|
|
3130
|
+
request: { method: "resources/read", params: { uri } },
|
|
3131
|
+
resultSchema: ReadResourceResultSchema,
|
|
3132
|
+
options
|
|
3133
|
+
});
|
|
3149
3134
|
}
|
|
3150
3135
|
async listResourceTemplatesInternal({
|
|
3151
3136
|
options
|
|
3152
3137
|
} = {}) {
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
});
|
|
3159
|
-
} catch (error) {
|
|
3160
|
-
throw error;
|
|
3161
|
-
}
|
|
3138
|
+
return this.request({
|
|
3139
|
+
request: { method: "resources/templates/list" },
|
|
3140
|
+
resultSchema: ListResourceTemplatesResultSchema,
|
|
3141
|
+
options
|
|
3142
|
+
});
|
|
3162
3143
|
}
|
|
3163
3144
|
async listPromptsInternal({
|
|
3164
3145
|
params,
|
|
3165
3146
|
options
|
|
3166
3147
|
} = {}) {
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
});
|
|
3173
|
-
} catch (error) {
|
|
3174
|
-
throw error;
|
|
3175
|
-
}
|
|
3148
|
+
return this.request({
|
|
3149
|
+
request: { method: "prompts/list", params },
|
|
3150
|
+
resultSchema: ListPromptsResultSchema,
|
|
3151
|
+
options
|
|
3152
|
+
});
|
|
3176
3153
|
}
|
|
3177
3154
|
async getPromptInternal({
|
|
3178
3155
|
name: name3,
|
|
3179
3156
|
args,
|
|
3180
3157
|
options
|
|
3181
3158
|
}) {
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
});
|
|
3188
|
-
} catch (error) {
|
|
3189
|
-
throw error;
|
|
3190
|
-
}
|
|
3159
|
+
return this.request({
|
|
3160
|
+
request: { method: "prompts/get", params: { name: name3, arguments: args } },
|
|
3161
|
+
resultSchema: GetPromptResultSchema,
|
|
3162
|
+
options
|
|
3163
|
+
});
|
|
3191
3164
|
}
|
|
3192
3165
|
async completeInternal({
|
|
3193
3166
|
options,
|