Skip to content

chore(deps): update eventsource to ^4.1.1, eventsource-parser to ^3.1.1 - #2744

Open
andriyor wants to merge 1 commit into
modelcontextprotocol:mainfrom
andriyor:chore/update-eventsource
Open

chore(deps): update eventsource to ^4.1.1, eventsource-parser to ^3.1.1#2744
andriyor wants to merge 1 commit into
modelcontextprotocol:mainfrom
andriyor:chore/update-eventsource

Conversation

@andriyor

@andriyor andriyor commented Sep 1, 2026

Copy link
Copy Markdown

Motivation and Context

eventsource and eventsource-parser were pinned at ^3.0.2 / ^3.0.0. This bumps both to the newest releases that keep the declared engines: node >=20 floor intact.

before after latest available
eventsource ^3.0.2 ^4.1.1 5.1.1 (needs Node ≥22.12)
eventsource-parser ^3.0.0 ^3.1.1 4.1.0 (needs Node ≥22.12)

Why not the latest majors. eventsource@5 and eventsource-parser@4 both require node >=22.12 and dropped their CommonJS builds. Adopting them would mean raising the engines floor from >=20 across every package, dropping the Node 20 leg from the CI matrix, and breaking require() of @modelcontextprotocol/client's CJS bundle (dist/index.cjs) on Node 20 — eventsource is an external dep there, so it resolves to ERR_REQUIRE_ESM. That's a consumer-facing break and felt out of scope for a dependency refresh; happy to open it as a separate PR if a Node floor bump is on the roadmap.

Why these two versions pair. eventsource@4.1.1 declares eventsource-parser: ^3.0.1, so parser v3 is the version it actually requires. pnpm dedupes to a single shared copy — the lock resolves eventsource@4.1.1 -> eventsource-parser: 3.1.1, the same instance streamableHttp.ts imports directly via eventsource-parser/stream. Bumping the parser to v4 while holding eventsource at v4 would nest a second parser copy in the bundle, so the two have to move together.

How Has This Been Tested?

  • pnpm typecheck:all, pnpm lint:all, pnpm build:all — all clean
  • pnpm test:all — full suite passes (6,700+ tests across all packages)
  • Smoke-tested the CJS path specifically, since it drove the version choice: require('eventsource') and require('eventsource-parser/stream') both resolve, and the built dist/index.cjs loads

One note on test/e2e: it exits non-zero from 2 unhandled rejections in scenarios/protocol.test.ts (a fake-timer request-timeout case) while reporting 2639 passed | 147 expected fail. This is pre-existing on main and unrelated to this change — I re-ran the suite on the unmodified dependency versions and got a byte-identical result.

Breaking Changes

None. eventsource@4's only removal was the FetchLikeInit type (superseded by EventSourceFetchInit), which this repo never imported — packages/client/src/client/sse.ts uses ErrorEvent and EventSourceInit, both still exported. No source changes were needed.

Types of changes

  • Chore (no functional changes, e.g. dependency updates)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed — n/a, no API surface change

Additional context

Lockfile changes are limited to these two packages and their dedupe. There's no .changeset/ directory or Renovate/Dependabot config at HEAD, so no changeset file is included — let me know if the v2 line expects one and I'll add it.

🤖 Generated with Claude Code

Bumps the two client SSE dependencies to the newest releases that keep the
declared `engines: node >=20` floor intact.

eventsource v4 dropped only the unused `FetchLikeInit` type (superseded by
`EventSourceFetchInit`), which this repo never imported — `sse.ts` uses
`ErrorEvent` and `EventSourceInit`, both still exported. No source changes
required.

The pairing is deliberate: eventsource@4 declares `eventsource-parser: ^3.0.1`,
so parser v3 is the version it requires. pnpm dedupes to a single shared copy
(`eventsource@4.1.1 -> eventsource-parser: 3.1.1`), the same instance
`streamableHttp.ts` imports directly via `eventsource-parser/stream`. Bumping
the parser to v4 while holding eventsource at v4 would nest a second parser
copy in the bundle.

Staying off the latest majors on purpose: eventsource@5 and
eventsource-parser@4 both require Node >=22.12 and ship ESM only, which would
break the `>=20` engines floor, the Node 20 CI leg, and `require()` of the
client's CJS bundle on Node 20.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@andriyor
andriyor requested a review from a team as a code owner September 1, 2026 13:34
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 82d03b8

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2744

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2744

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2744

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2744

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2744

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2744

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2744

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2744

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2744

commit: 82d03b8

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