Repository navigation
chore(infra): drop held mcp-adapters 2.0 changeset to unblock main releases - #11728
Conversation
…k releases The SDK 2 migration (#11597 et al.) is merged on main, but the adapter is on the changesets ignore list until 2.0 is verified, so its pending major changeset is treated as pending forever: changesets/action never reaches the publish step on push to main, and every push only regenerates the empty version PR (currently #11725). [email protected] and the other 12 packages bumped in #11683 are versioned on main but unpublished. Restore this changeset (and drop the ignore entry) when 2.0 ships — that becomes the 2.0.0 release. Original text is in git history. Co-authored-by: open-swe[bot] <[email protected]>
|
| @@ -1,119 +0,0 @@ | |||
| --- | |||
| "@langchain/mcp-adapters": major | |||
There was a problem hiding this comment.
🟠 Remaining changesets still prevent immediate publishing
Removing this ignored-only changeset does not take the release workflow into its publish branch: .changeset/return-direct-tool-errors.md and .changeset/splitter-loc-length-function.md are still active patch changesets. changesets/action will therefore run the configured version script and update/create a version PR for those patches instead of running pnpm run release on the next main push. The already-versioned 13 packages will not publish immediately as this PR intends; their release remains gated on merging that subsequent version PR (or otherwise clearing the two pending changesets).
(Refers to line 2)
Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.
… retryable (#11720) This is the first of two stacked PRs adding OAuth to `@langchain/mcp-adapters` 2.0. It does four things: - moves the adapter to MCP SDK 2.1; - accepts the SDK's token-based `AuthProvider`; - labels authentication failures correctly; - lets servers that failed on authentication be retried. It also documents these changes in the README. The follow-up PR, stacked on this one, adds `finishAuth` to complete an OAuth redirect. Merging this releases nothing. `@langchain/mcp-adapters` is still in the changesets `ignore` list (#11715). **966 changed lines:** implementation 143, tests 738 (of which the OAuth server fixture is 320), README 18, lockfile 67. ## MCP SDK 2.1 replaces the header workaround In SDK 2.0, a configured `Authorization` header and the provider's token were sent joined into one value, `Bearer <provider>, Bearer <configured>`. #11663 worked around this with `getSdkHeaderCase`. SDK 2.1.0 (modelcontextprotocol/typescript-sdk#2475) fixes it upstream by matching the transport's own `Authorization` case-insensitively, so the workaround is deleted rather than kept alongside. The SDK's fix also decides which value wins, and it picks the opposite of what #11663 did: - once the provider has a token, that token replaces a configured `Authorization`; - until then, the configured header is sent. We follow the SDK instead of patching over it. This order is also the useful one: a static API key works until an OAuth login completes, then the OAuth token takes over. The header tests now pin both cases. `@modelcontextprotocol/client` and `core` now require `^2.1.0`. The dev-only server packages move to `^2.1.0` with them. ## Token providers `authProvider` now accepts the SDK's minimal `AuthProvider`, `{ token(), onUnauthorized?() }`, as well as an `OAuthClientProvider`. The adapter hands it to the transport unchanged: - the SDK calls `token()` before each request; - on a 401, it calls `onUnauthorized()` once, then retries. This covers tokens the application already manages, without implementing the whole OAuth client interface. `AuthProvider` is exported as a type. ## Authentication failures When a provider-driven flow fails, the SDK throws `UnauthorizedError`. That error carries no HTTP status, so the old `code === 401` check missed it. The new `isAuthenticationError` recognizes either `UnauthorizedError` or a 401, on the error itself or up to three levels down its `cause` chain. The depth matters because the legacy HTTP→SSE fallback wraps the SSE 401 twice. Both the HTTP and SSE paths now use it. As a result, a provider auth failure: - gets the authentication error message; - keeps the SDK error as `cause`; - in legacy mode, does not fall back to SSE. Tests pin this on both transports. `UnauthorizedError` is exported so callers can check the cause. ## Auth failures stay retryable Discovery used to add every server that failed to connect to `#failedServers`, which skips that server for the rest of the adapter's lifetime. After a 401, completing the login couldn't bring the server back without creating a new adapter. Now: - auth failures stay out of `#failedServers`, so the next discovery retries them; - unreachable servers and a throwing `token()` still stay blocked; - `onConnectionError` still runs for every failure. ## Docs - The README's Authentication section covers both provider shapes, which `Authorization` value wins, implementing `invalidateCredentials()` (without it, a refresh the server rejects fails instead of restarting the login), and `UnauthorizedError` as the `cause`. - No changeset: since #11728, `main` can't carry a changeset for the ignored adapter without blocking every release (changesets/action#541). The release PR restores the 2.0 changeset, including this PR's notes. ## Testing - `pnpm --filter @langchain/mcp-adapters test`: 463 passed, 2 skipped, no type errors. oxlint and oxfmt report no issues. - The OAuth tests run the real SDK client transport against a real in-process authorization server (`src/tests/fixtures/oauth-server.ts`). The SDK is not mocked. The server is built from the SDK's own `mcpAuthRouter` and `requireBearerAuth` and supports: - dynamic client registration; - PKCE; - RFC 9207 `iss`, which can be sent, omitted or unsupported; - token refresh; - RFC 9728 resource metadata for both `/mcp` and `/sse`. - A test reproduces the double-wrapped legacy HTTP→SSE fallback and checks the server is retried. It fails when `isAuthenticationError` checks only one `cause` level. - In the stack's mutation run, deliberately reverting the token-provider, auth-labeling or retry change each made its tests fail. --------- Signed-off-by: Hunter Lovell <[email protected]> Co-authored-by: Hunter Lovell <[email protected]>
This PR releases `@langchain/mcp-adapters` 2.0.0. It removes the adapter from the changesets `ignore` list (#11715) and restores the major changeset that #11728 removed from `main`; both have to land together, because changesets/action#541 blocks a release that has a changeset for an ignored package. It also raises `@modelcontextprotocol/client` and `@modelcontextprotocol/core` to `^2.2.0`, which fixes `listTools` pagination and the CommonJS `.d.cts` types. The changeset is the 2.0.0 release note and covers everything now on `main`: tool errors returned as error `ToolMessage`s (#11758); tool names prefixed with the server name by default, duplicate names throwing, the `getTools` alias and 1.x resource-template listing (#11759); config guards trimmed to the ones that change behavior (#11768); `close()` stopping a discovery in progress (#11744); plus strict config keys, `mode: "legacy"` for HTTP `reconnect`, the `resource_link` and structured-content changes and the probe fallback. Once this merges, the version-packages PR (#11749) picks up the changeset and publishes 2.0.0 alongside `langchain` 1.5.15, which elicitation under `toolRetryMiddleware` needs. The lockfile churn comes from the SDK bump. --------- Co-authored-by: Hunter Lovell <[email protected]> Co-authored-by: Hunter Lovell <[email protected]>
Summary
Unblocks the stuck main-branch release by deleting the pending
@langchain/mcp-adaptersmajor changeset.What's stuck
[email protected],@langchain/[email protected],@langchain/[email protected], etc. — but none have published: npmlatestis still[email protected]and[email protected]404s..changeset/mcp-adapters-sdk-2.md(major, targeting only the adapter) is still pending, and since chore(mcp-adapters): hold the adapter out of releases until 2.0 is ready #11715 the adapter is on the changesetsignorelist. This hits a known upstream bug (changesets/action#541): a changeset referencing only ignored packages still counts as pending, so the action always takes the "update version PR" branch and never runschangeset publish.The fix
Delete
mcp-adapters-sdk-2.mdfrom main. With zero pending changesets, the next push to main reacheschangeset publishand ships all 13 already-bumped packages immediately. Then close #11725 and deletechangeset-release/mainso the action can recreate a real one later.Deliberately not changed
ignoreentry stays: it correctly holds the adapter until 2.0 ships. Restoring this changeset (plus removing the ignore entry) is the 2.0.0 release trigger — the original text is recoverable withgit show 34edee115:.changeset/mcp-adapters-sdk-2.md(also at 1edf83a).Verification
pnpm exec changeset statuson this branch now shows only the two new patch changesets from today (langchain, classic, textsplitters, neo4j) — the ignored-pending major is gone.Fixes the release block discussed in #hunters-botcave.
Made by Open SWE · view thread · fireworks:accounts/fireworks/models/glm-5p3-flash (max)