From 7edefb33471ec7c6f96731edadf6746bdab971d2 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:37:58 -0500 Subject: [PATCH] chore(mcp): upgrade client to 2.0.0 (#39369) Co-authored-by: Aiden Cline Co-authored-by: Aiden Cline --- bun.lock | 14 ++--- bunfig.toml | 2 +- package.json | 2 +- packages/opencode/package.json | 4 +- ...modelcontextprotocol%2Fclient@2.0.0.patch} | 52 +++++++++---------- 5 files changed, 37 insertions(+), 37 deletions(-) rename patches/{@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch => @modelcontextprotocol%2Fclient@2.0.0.patch} (84%) diff --git a/bun.lock b/bun.lock index 084567c2e6d..7a8f2c16a36 100644 --- a/bun.lock +++ b/bun.lock @@ -592,7 +592,7 @@ "@effect/platform-node": "catalog:", "@ff-labs/fff-bun": "0.9.4", "@gitlab/opencode-gitlab-auth": "1.3.3", - "@modelcontextprotocol/client": "2.0.0-beta.5", + "@modelcontextprotocol/client": "2.0.0", "@octokit/graphql": "9.0.2", "@octokit/rest": "catalog:", "@openauthjs/openauth": "catalog:", @@ -666,7 +666,7 @@ }, "devDependencies": { "@babel/core": "7.28.4", - "@modelcontextprotocol/server": "2.0.0-beta.5", + "@modelcontextprotocol/server": "2.0.0", "@octokit/webhooks-types": "7.6.1", "@opencode-ai/core": "workspace:*", "@opencode-ai/http-recorder": "workspace:*", @@ -1071,10 +1071,10 @@ ], "patchedDependencies": { "@pierre/trees@1.0.0-beta.4": "patches/@pierre%2Ftrees@1.0.0-beta.4.patch", - "@modelcontextprotocol/client@2.0.0-beta.5": "patches/@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch", - "@ai-sdk/xai@3.0.102": "patches/@ai-sdk%2Fxai@3.0.102.patch", "@tanstack/virtual-core@3.17.3": "patches/@tanstack%2Fvirtual-core@3.17.3.patch", + "@ai-sdk/xai@3.0.102": "patches/@ai-sdk%2Fxai@3.0.102.patch", "gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch", + "@modelcontextprotocol/client@2.0.0": "patches/@modelcontextprotocol%2Fclient@2.0.0.patch", "@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch", "effect@4.0.0-beta.83": "patches/effect@4.0.0-beta.83.patch", "@ai-sdk/mistral@3.0.51": "patches/@ai-sdk%2Fmistral@3.0.51.patch", @@ -1830,11 +1830,11 @@ "@mixmark-io/domino": ["@mixmark-io/domino@2.2.0", "", {}, "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw=="], - "@modelcontextprotocol/client": ["@modelcontextprotocol/client@2.0.0-beta.5", "", { "dependencies": { "@modelcontextprotocol/core": "2.0.0-beta.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "jose": "^6.1.3", "pkce-challenge": "^5.0.0", "zod": "^4.2.0" } }, "sha512-YuuNm5f2TMoFQRje1UqVP8TJRjijCXMz4ckvoVpx1cUXuBEmykWQ2d8R536pek6UKcXT41T5nWc4qR1JFIbEmg=="], + "@modelcontextprotocol/client": ["@modelcontextprotocol/client@2.0.0", "", { "dependencies": { "@modelcontextprotocol/core": "2.0.0", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "jose": "^6.1.3", "pkce-challenge": "^5.0.0", "zod": "^4.2.0" } }, "sha512-8f1OghQ2rjzIOfqgUCP+8GiUWqRs89njoWLNqAe8kWmDePv3s1fZXseej+QXemssEuuOvLLmLO/kqM3IQHtISw=="], - "@modelcontextprotocol/core": ["@modelcontextprotocol/core@2.0.0-beta.5", "", { "dependencies": { "zod": "^4.2.0" } }, "sha512-HKbY9XTbsDy1Y6r2I55TGE3JEapM0vg96e1MUmBIF9LGjos5gjhcIrTz1yvBPLg2aFKHjwhUAQfRdrCEnPxNew=="], + "@modelcontextprotocol/core": ["@modelcontextprotocol/core@2.0.0", "", { "dependencies": { "zod": "^4.2.0" } }, "sha512-pJCEwGG7Lfr/+PQp9ZTwKXNeO5wzbfKL7H3MYpCorM4oFBoQrdjnBgEoqG+RjhsvS1FKrDbKux+M1HhlnGWqcA=="], - "@modelcontextprotocol/server": ["@modelcontextprotocol/server@2.0.0-beta.5", "", { "dependencies": { "@modelcontextprotocol/core": "2.0.0-beta.5", "zod": "^4.2.0" } }, "sha512-i1E5l75rQKsgY/AKAIspgMBH1vEL7dqiK7tHr0L+raYcb0SWOziqNGJXGIG6NY4AlXDWIKGJQGB7Nqfs3oUi5g=="], + "@modelcontextprotocol/server": ["@modelcontextprotocol/server@2.0.0", "", { "dependencies": { "@modelcontextprotocol/core": "2.0.0", "zod": "^4.2.0" } }, "sha512-YhHWdHfpFMQfd0prsEnxKeS3Qz3ytIGmsS0sth4KDjnacIT7hxk6hXHkJ9KysxlkvTM+WZAtQbbcUhdoP4Hvtw=="], "@motionone/animation": ["@motionone/animation@10.18.0", "", { "dependencies": { "@motionone/easing": "^10.18.0", "@motionone/types": "^10.17.1", "@motionone/utils": "^10.18.0", "tslib": "^2.3.1" } }, "sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw=="], diff --git a/bunfig.toml b/bunfig.toml index c506ff57c4b..649db19f1de 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -2,7 +2,7 @@ exact = true # Only install newly resolved package versions published at least 3 days ago. minimumReleaseAge = 259200 -minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] +minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@modelcontextprotocol/client", "@modelcontextprotocol/core", "@modelcontextprotocol/server", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] [test] root = "./do-not-run-tests-from-root" diff --git a/package.json b/package.json index e7e081a4d31..30630fdf2fe 100644 --- a/package.json +++ b/package.json @@ -157,6 +157,6 @@ "@pierre/trees@1.0.0-beta.4": "patches/@pierre%2Ftrees@1.0.0-beta.4.patch", "effect@4.0.0-beta.83": "patches/effect@4.0.0-beta.83.patch", "@tanstack/virtual-core@3.17.3": "patches/@tanstack%2Fvirtual-core@3.17.3.patch", - "@modelcontextprotocol/client@2.0.0-beta.5": "patches/@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch" + "@modelcontextprotocol/client@2.0.0": "patches/@modelcontextprotocol%2Fclient@2.0.0.patch" } } diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 293a678e9bb..d2155eb4ba2 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@babel/core": "7.28.4", - "@modelcontextprotocol/server": "2.0.0-beta.5", + "@modelcontextprotocol/server": "2.0.0", "@octokit/webhooks-types": "7.6.1", "@opencode-ai/core": "workspace:*", "@opencode-ai/http-recorder": "workspace:*", @@ -81,7 +81,7 @@ "@effect/platform-node": "catalog:", "@ff-labs/fff-bun": "0.9.4", "@gitlab/opencode-gitlab-auth": "1.3.3", - "@modelcontextprotocol/client": "2.0.0-beta.5", + "@modelcontextprotocol/client": "2.0.0", "@octokit/graphql": "9.0.2", "@octokit/rest": "catalog:", "@openauthjs/openauth": "catalog:", diff --git a/patches/@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch b/patches/@modelcontextprotocol%2Fclient@2.0.0.patch similarity index 84% rename from patches/@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch rename to patches/@modelcontextprotocol%2Fclient@2.0.0.patch index 4205f158317..833adea8a9a 100644 --- a/patches/@modelcontextprotocol%2Fclient@2.0.0-beta.5.patch +++ b/patches/@modelcontextprotocol%2Fclient@2.0.0.patch @@ -1,8 +1,8 @@ diff --git a/dist/index.cjs b/dist/index.cjs -index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370a4553855 100644 +index 635f1c0..9214f0b 100644 --- a/dist/index.cjs +++ b/dist/index.cjs -@@ -3154,6 +3154,7 @@ var Client = class extends require_src.Protocol { +@@ -3211,6 +3211,7 @@ var Client = class extends require_src.Protocol { */ async _connectPlainLegacy(transport, options) { await super.connect(transport); @@ -10,7 +10,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 if (transport.sessionId !== void 0) { const negotiatedProtocolVersion = this._negotiatedProtocolVersion; if (negotiatedProtocolVersion !== void 0) transport.setProtocolVersion?.(negotiatedProtocolVersion); -@@ -3170,6 +3171,7 @@ var Client = class extends require_src.Protocol { +@@ -3227,6 +3228,7 @@ var Client = class extends require_src.Protocol { * the handshake; its completion sets the negotiated (legacy) version. */ async _legacyHandshake(transport, options) { @@ -18,7 +18,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 const legacyVersions = require_src.legacyProtocolVersions(this._supportedProtocolVersions); try { const offeredVersion = legacyVersions[0]; -@@ -3208,6 +3210,7 @@ var Client = class extends require_src.Protocol { +@@ -3265,6 +3267,7 @@ var Client = class extends require_src.Protocol { await super.connect(transport); const negotiatedProtocolVersion = this._negotiatedProtocolVersion; if (negotiatedProtocolVersion !== void 0 && transport.setProtocolVersion) transport.setProtocolVersion(negotiatedProtocolVersion); @@ -26,7 +26,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 return; } this._resetConnectionState(); -@@ -5211,10 +5214,32 @@ var StreamableHTTPClientTransport = class { +@@ -5294,10 +5297,32 @@ var StreamableHTTPClientTransport = class { } } async send(message, options) { @@ -61,7 +61,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 const { resumptionToken, onresumptiontoken } = options || {}; if (resumptionToken) { this._startOrAuthSse({ -@@ -5226,8 +5251,8 @@ var StreamableHTTPClientTransport = class { +@@ -5309,8 +5334,8 @@ var StreamableHTTPClientTransport = class { } const headers = await this._commonHeaders(); this._applyBodyDerivedHeaders(headers, message); @@ -71,7 +71,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 if (options?.headers !== void 0) for (const [name, value] of Object.entries(options.headers)) { if (RESERVED_REQUEST_HEADER_NAMES.has(name.toLowerCase())) continue; headers.set(name, value); -@@ -5249,8 +5274,14 @@ var StreamableHTTPClientTransport = class { +@@ -5332,8 +5357,14 @@ var StreamableHTTPClientTransport = class { signal }; const response = await (this._fetch ?? fetch)(this._url, init); @@ -87,29 +87,29 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370 if (response.status === 401 && this._authProvider) { if (response.headers.has("www-authenticate")) { const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); -@@ -5264,7 +5295,7 @@ var StreamableHTTPClientTransport = class { - fetchFn: this._fetchWithInit - }); +@@ -5351,7 +5382,7 @@ var StreamableHTTPClientTransport = class { + throw markAuthSeamEscape(error); + } await response.text?.().catch(() => {}); - return this._send(message, options, true, stepUpRetries); + return this._send(message, options, true, stepUpRetries, isSessionRetry); } await response.text?.().catch(() => {}); - if (isAuthRetry) throw new require_src.SdkHttpError(require_src.SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", { -@@ -5284,7 +5315,7 @@ var StreamableHTTPClientTransport = class { + if (isAuthRetry) throw markAuthSeamEscape(new require_src.SdkHttpError(require_src.SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", { +@@ -5371,7 +5402,7 @@ var StreamableHTTPClientTransport = class { statusText: response.statusText, text - }, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError(); + }, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError()); - return this._send(message, options, isAuthRetry, stepUpRetries + 1); + return this._send(message, options, isAuthRetry, stepUpRetries + 1, isSessionRetry); } } if (response.status === 400 && typeof text === "string" && this._isModernEnvelopedRequest(message)) try { diff --git a/dist/index.mjs b/dist/index.mjs -index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a7749668c39747 100644 +index f02ce3c..0a5a649 100644 --- a/dist/index.mjs +++ b/dist/index.mjs -@@ -3151,6 +3151,7 @@ var Client = class extends Protocol { +@@ -3208,6 +3208,7 @@ var Client = class extends Protocol { */ async _connectPlainLegacy(transport, options) { await super.connect(transport); @@ -117,7 +117,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 if (transport.sessionId !== void 0) { const negotiatedProtocolVersion = this._negotiatedProtocolVersion; if (negotiatedProtocolVersion !== void 0) transport.setProtocolVersion?.(negotiatedProtocolVersion); -@@ -3167,6 +3168,7 @@ var Client = class extends Protocol { +@@ -3224,6 +3225,7 @@ var Client = class extends Protocol { * the handshake; its completion sets the negotiated (legacy) version. */ async _legacyHandshake(transport, options) { @@ -125,7 +125,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 const legacyVersions = legacyProtocolVersions(this._supportedProtocolVersions); try { const offeredVersion = legacyVersions[0]; -@@ -3205,6 +3207,7 @@ var Client = class extends Protocol { +@@ -3262,6 +3264,7 @@ var Client = class extends Protocol { await super.connect(transport); const negotiatedProtocolVersion = this._negotiatedProtocolVersion; if (negotiatedProtocolVersion !== void 0 && transport.setProtocolVersion) transport.setProtocolVersion(negotiatedProtocolVersion); @@ -133,7 +133,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 return; } this._resetConnectionState(); -@@ -5208,10 +5211,32 @@ var StreamableHTTPClientTransport = class { +@@ -5291,10 +5294,32 @@ var StreamableHTTPClientTransport = class { } } async send(message, options) { @@ -168,7 +168,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 const { resumptionToken, onresumptiontoken } = options || {}; if (resumptionToken) { this._startOrAuthSse({ -@@ -5223,8 +5248,8 @@ var StreamableHTTPClientTransport = class { +@@ -5306,8 +5331,8 @@ var StreamableHTTPClientTransport = class { } const headers = await this._commonHeaders(); this._applyBodyDerivedHeaders(headers, message); @@ -178,7 +178,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 if (options?.headers !== void 0) for (const [name, value] of Object.entries(options.headers)) { if (RESERVED_REQUEST_HEADER_NAMES.has(name.toLowerCase())) continue; headers.set(name, value); -@@ -5246,8 +5271,14 @@ var StreamableHTTPClientTransport = class { +@@ -5329,8 +5354,14 @@ var StreamableHTTPClientTransport = class { signal }; const response = await (this._fetch ?? fetch)(this._url, init); @@ -194,19 +194,19 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496 if (response.status === 401 && this._authProvider) { if (response.headers.has("www-authenticate")) { const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response); -@@ -5261,7 +5292,7 @@ var StreamableHTTPClientTransport = class { - fetchFn: this._fetchWithInit - }); +@@ -5348,7 +5379,7 @@ var StreamableHTTPClientTransport = class { + throw markAuthSeamEscape(error); + } await response.text?.().catch(() => {}); - return this._send(message, options, true, stepUpRetries); + return this._send(message, options, true, stepUpRetries, isSessionRetry); } await response.text?.().catch(() => {}); - if (isAuthRetry) throw new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", { -@@ -5281,7 +5312,7 @@ var StreamableHTTPClientTransport = class { + if (isAuthRetry) throw markAuthSeamEscape(new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", { +@@ -5368,7 +5399,7 @@ var StreamableHTTPClientTransport = class { statusText: response.statusText, text - }, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError(); + }, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError()); - return this._send(message, options, isAuthRetry, stepUpRetries + 1); + return this._send(message, options, isAuthRetry, stepUpRetries + 1, isSessionRetry); }