@ai-sdk/mcp 1.0.44 → 1.0.46
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 +12 -0
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/tool/mcp-client.ts +9 -0
- package/src/tool/oauth.ts +12 -2
package/dist/index.mjs
CHANGED
|
@@ -812,7 +812,12 @@ async function exchangeAuthorization(authorizationServerUrl, {
|
|
|
812
812
|
redirect_uri: String(redirectUri)
|
|
813
813
|
});
|
|
814
814
|
if (addClientAuthentication) {
|
|
815
|
-
addClientAuthentication(
|
|
815
|
+
await addClientAuthentication(
|
|
816
|
+
headers,
|
|
817
|
+
params,
|
|
818
|
+
authorizationServerUrl,
|
|
819
|
+
metadata
|
|
820
|
+
);
|
|
816
821
|
} else {
|
|
817
822
|
const supportedMethods = (_a3 = metadata == null ? void 0 : metadata.token_endpoint_auth_methods_supported) != null ? _a3 : [];
|
|
818
823
|
const authMethod = selectClientAuthMethod(
|
|
@@ -864,7 +869,12 @@ async function refreshAuthorization(authorizationServerUrl, {
|
|
|
864
869
|
refresh_token: refreshToken
|
|
865
870
|
});
|
|
866
871
|
if (addClientAuthentication) {
|
|
867
|
-
addClientAuthentication(
|
|
872
|
+
await addClientAuthentication(
|
|
873
|
+
headers,
|
|
874
|
+
params,
|
|
875
|
+
authorizationServerUrl,
|
|
876
|
+
metadata
|
|
877
|
+
);
|
|
868
878
|
} else {
|
|
869
879
|
const supportedMethods = (_a3 = metadata == null ? void 0 : metadata.token_endpoint_auth_methods_supported) != null ? _a3 : [];
|
|
870
880
|
const authMethod = selectClientAuthMethod(
|
|
@@ -2112,6 +2122,14 @@ var DefaultMCPClient = class {
|
|
|
2112
2122
|
}
|
|
2113
2123
|
async onRequestMessage(request) {
|
|
2114
2124
|
try {
|
|
2125
|
+
if (request.method === "ping") {
|
|
2126
|
+
await this.transport.send({
|
|
2127
|
+
jsonrpc: "2.0",
|
|
2128
|
+
id: request.id,
|
|
2129
|
+
result: {}
|
|
2130
|
+
});
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2115
2133
|
if (request.method !== "elicitation/create") {
|
|
2116
2134
|
await this.transport.send({
|
|
2117
2135
|
jsonrpc: "2.0",
|