Skip to content

chore(infra): drop held mcp-adapters 2.0 changeset to unblock main releases - #11728

Merged
Hunter Lovell (hntrl) merged 1 commit into
mainfrom
open-swe/remove-mcp-changeset
Sep 25, 2026
Merged

Hunter Lovell (hntrl) merged 1 commit into
mainfrom
open-swe/remove-mcp-changeset

Conversation

@hntrl

Copy link
Copy Markdown
Member

Summary

Unblocks the stuck main-branch release by deleting the pending @langchain/mcp-adapters major changeset.

What's stuck

The fix

Delete mcp-adapters-sdk-2.md from main. With zero pending changesets, the next push to main reaches changeset publish and ships all 13 already-bumped packages immediately. Then close #11725 and delete changeset-release/main so the action can recreate a real one later.

Deliberately not changed

  • The adapter's SDK 2 code stays merged on main — the ignore list already keeps it unpublished, and reverting it is unnecessary (and would conflict with the interleaved OpenAI Responses merge).
  • The ignore entry 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 with git show 34edee115:.changeset/mcp-adapters-sdk-2.md (also at 1edf83a).

Verification

pnpm exec changeset status on 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)

…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]>
@changeset-bot

changeset-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c8e401a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hntrl Hunter Lovell (hntrl) changed the title chore(changesets): drop held mcp-adapters 2.0 changeset to unblock main releases chore(infra): drop held mcp-adapters 2.0 changeset to unblock main releases Sep 25, 2026
@hntrl
Hunter Lovell (hntrl) marked this pull request as ready for review September 25, 2026 00:28
@hntrl
Hunter Lovell (hntrl) merged commit 7735b21 into main Sep 25, 2026
16 of 17 checks passed
@hntrl
Hunter Lovell (hntrl) deleted the open-swe/remove-mcp-changeset branch September 25, 2026 00:32

@robin-agent robin-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in Web • View Open SWE trace

@@ -1,119 +0,0 @@
---
"@langchain/mcp-adapters": major

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Hunter Lovell (hntrl) added a commit that referenced this pull request Sep 27, 2026
… 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]>
Hunter Lovell (hntrl) added a commit that referenced this pull request Oct 1, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant