Skip to content

Commit 096c2ba

Browse files
authored
chore(core): update MCP SDK to 2.3.1 (#58232)
1 parent 84578e1 commit 096c2ba

5 files changed

Lines changed: 31 additions & 67 deletions

File tree

‎bun.lock‎

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
"@ff-labs/fff-bun@0.10.5": "patches/@ff-labs%2Ffff-bun@0.10.5.patch",
186186
"ghostty-web@github:anomalyco/ghostty-web#83c0a07": "patches/ghostty-web@0.3.0.patch",
187187
"vite@8.2.2": "patches/vite@8.2.2.patch",
188-
"@modelcontextprotocol/client@2.0.0": "patches/@modelcontextprotocol%2Fclient@2.0.0.patch",
188+
"@modelcontextprotocol/client@2.3.1": "patches/@modelcontextprotocol%2Fclient@2.3.1.patch",
189189
"@corvu/drawer@0.2.4": "patches/@corvu%2Fdrawer@0.2.4.patch"
190190
}
191191
}

‎packages/client/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"devDependencies": {
5454
"@effect/platform-node": "catalog:",
55-
"@modelcontextprotocol/client": "2.0.0",
55+
"@modelcontextprotocol/client": "2.3.1",
5656
"@opencode/httpapi-codegen": "workspace:*",
5757
"@tsconfig/bun": "catalog:",
5858
"@types/bun": "catalog:",

‎packages/core/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@ai-sdk/openai-compatible": "2.0.41",
8080
"@effect/platform-node": "catalog:",
8181
"@effect/sql-sqlite-bun": "catalog:",
82-
"@modelcontextprotocol/server": "2.0.0",
82+
"@modelcontextprotocol/server": "2.3.1",
8383
"@opencode/http-recorder": "workspace:*",
8484
"@parcel/watcher-darwin-arm64": "2.5.1",
8585
"@parcel/watcher-darwin-x64": "2.5.1",
@@ -105,8 +105,8 @@
105105
"@ff-labs/fff-bun": "0.10.5",
106106
"@ff-labs/fff-node": "0.10.5",
107107
"@lydell/node-pty": "catalog:",
108-
"@modelcontextprotocol/client": "2.0.0",
109-
"@modelcontextprotocol/core": "2.0.0",
108+
"@modelcontextprotocol/client": "2.3.1",
109+
"@modelcontextprotocol/core": "2.3.1",
110110
"@opencode-ai/pty": "0.3.1",
111111
"@opencode/ai": "workspace:*",
112112
"@opencode/codemode": "workspace:*",
Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,48 @@
11
diff --git a/dist/index.cjs b/dist/index.cjs
2-
index 635f1c0134274c89e7efbcae2adf3d9ecba575ee..3f4dfb779a55deaae2c188a442b78ca519d5c17d 100644
2+
index 71cf630..4c33e3b 100644
33
--- a/dist/index.cjs
44
+++ b/dist/index.cjs
5-
@@ -517,7 +517,7 @@ function applyPublicAuth(clientId, params) {
6-
}
7-
/** Loopback hosts exempt from the in-transit `https:` requirement (RFC 8252 §7.3). */
8-
function isLoopbackHost(hostname) {
9-
- return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
10-
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
11-
}
12-
/**
13-
* SEP-2207: refuse to send credentials to a non-TLS, non-loopback token endpoint.
14-
@@ -977,7 +977,6 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
5+
@@ -1038,7 +1038,6 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
156
else {
167
const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
178
url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
189
- url.search = issuer.search;
1910
}
2011
let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);
2112
if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) response = await tryMetadataDiscovery(new URL(`/.well-known/${wellKnownType}`, issuer), protocolVersion, fetchFn);
22-
@@ -1158,7 +1157,6 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
13+
@@ -1222,7 +1221,6 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
2314
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
2415
if (state) authorizationUrl.searchParams.set("state", state);
2516
if (scope) authorizationUrl.searchParams.set("scope", scope);
2617
- if (scope?.split(" ").includes("offline_access")) authorizationUrl.searchParams.append("prompt", "consent");
27-
if (resource) authorizationUrl.searchParams.set("resource", resource.href);
18+
if (resource) authorizationUrl.searchParams.set("resource", resourceIndicatorToString(resource));
2819
return {
2920
authorizationUrl,
3021
diff --git a/dist/index.mjs b/dist/index.mjs
31-
index f02ce3ca394e826fc27c9848dbe9a214bf6ba7a9..3508b8e841bb8d3d724fa5ff573902dbca81cf89 100644
22+
index c1a09a8..f5b0e1d 100644
3223
--- a/dist/index.mjs
3324
+++ b/dist/index.mjs
34-
@@ -514,7 +514,7 @@ function applyPublicAuth(clientId, params) {
35-
}
36-
/** Loopback hosts exempt from the in-transit `https:` requirement (RFC 8252 §7.3). */
37-
function isLoopbackHost(hostname) {
38-
- return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
39-
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
40-
}
41-
/**
42-
* SEP-2207: refuse to send credentials to a non-TLS, non-loopback token endpoint.
43-
@@ -974,7 +974,6 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
25+
@@ -1035,7 +1035,6 @@ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, o
4426
else {
4527
const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
4628
url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
4729
- url.search = issuer.search;
4830
}
4931
let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);
5032
if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) response = await tryMetadataDiscovery(new URL(`/.well-known/${wellKnownType}`, issuer), protocolVersion, fetchFn);
51-
@@ -1155,7 +1154,6 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
33+
@@ -1219,7 +1218,6 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
5234
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
5335
if (state) authorizationUrl.searchParams.set("state", state);
5436
if (scope) authorizationUrl.searchParams.set("scope", scope);
5537
- if (scope?.split(" ").includes("offline_access")) authorizationUrl.searchParams.append("prompt", "consent");
56-
if (resource) authorizationUrl.searchParams.set("resource", resource.href);
38+
if (resource) authorizationUrl.searchParams.set("resource", resourceIndicatorToString(resource));
5739
return {
5840
authorizationUrl,
59-
diff --git a/dist/src-NAgB4Mp8.cjs b/dist/src-NAgB4Mp8.cjs
60-
index e8f2499..4436b61 100644
61-
--- a/dist/src-NAgB4Mp8.cjs
62-
+++ b/dist/src-NAgB4Mp8.cjs
63-
@@ -1063,11 +1063,7 @@ function build$1() {
41+
diff --git a/dist/src-DpAS0jfg.cjs b/dist/src-DpAS0jfg.cjs
42+
index e2ffe64..af1153c 100644
43+
--- a/dist/src-DpAS0jfg.cjs
44+
+++ b/dist/src-DpAS0jfg.cjs
45+
@@ -1093,11 +1093,7 @@ function build$1() {
6446
properties: zod_v4.record(zod_v4.string(), JSONValueSchema$1).optional(),
6547
required: zod_v4.array(zod_v4.string()).optional()
6648
}).catchall(zod_v4.unknown()),
@@ -73,20 +55,11 @@ index e8f2499..4436b61 100644
7355
annotations: ToolAnnotationsSchema$1.optional(),
7456
execution: ToolExecutionSchema$1.optional(),
7557
_meta: zod_v4.record(zod_v4.string(), zod_v4.unknown()).optional()
76-
@@ -5698,7 +5694,7 @@ var Protocol = class {
77-
return this._requestHandlers.get(method);
78-
}
79-
async _oncancel(notification) {
80-
- if (!notification.params.requestId) return;
81-
+ if (notification.params.requestId === void 0) return;
82-
this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
83-
}
84-
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
85-
diff --git a/dist/src-D_zzAWoS.mjs b/dist/src-D_zzAWoS.mjs
86-
index 6ac3d53..9b8e48b 100644
87-
--- a/dist/src-D_zzAWoS.mjs
88-
+++ b/dist/src-D_zzAWoS.mjs
89-
@@ -1062,11 +1062,7 @@ function build$1() {
58+
diff --git a/dist/src-WCy6ifGf.mjs b/dist/src-WCy6ifGf.mjs
59+
index 7a40fb4..16d9ac0 100644
60+
--- a/dist/src-WCy6ifGf.mjs
61+
+++ b/dist/src-WCy6ifGf.mjs
62+
@@ -1092,11 +1092,7 @@ function build$1() {
9063
properties: z.record(z.string(), JSONValueSchema$1).optional(),
9164
required: z.array(z.string()).optional()
9265
}).catchall(z.unknown()),
@@ -99,12 +72,3 @@ index 6ac3d53..9b8e48b 100644
9972
annotations: ToolAnnotationsSchema$1.optional(),
10073
execution: ToolExecutionSchema$1.optional(),
10174
_meta: z.record(z.string(), z.unknown()).optional()
102-
@@ -5697,7 +5693,7 @@ var Protocol = class {
103-
return this._requestHandlers.get(method);
104-
}
105-
async _oncancel(notification) {
106-
- if (!notification.params.requestId) return;
107-
+ if (notification.params.requestId === void 0) return;
108-
this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
109-
}
110-
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {

0 commit comments

Comments
 (0)