Skip to content

fix(server): add relatedRequestId option to sendToolListChanged and siblings#1802

Open
lanxevo3 wants to merge 3 commits intomodelcontextprotocol:mainfrom
lanxevo3:fix/send-list-changed-inline
Open

fix(server): add relatedRequestId option to sendToolListChanged and siblings#1802
lanxevo3 wants to merge 3 commits intomodelcontextprotocol:mainfrom
lanxevo3:fix/send-list-changed-inline

Conversation

@lanxevo3
Copy link
Copy Markdown

Enables stateless MCP servers to deliver list-change notifications inline via the POST SSE response stream, instead of silently dropping them when no GET SSE channel is open.

Fixes #1771

What changed

Three methods in \server.ts\ and their wrappers in \mcp.ts\ now accept an optional \options?: NotificationOptions\ parameter, which passes
elatedRequestId\ through to
otification(). When
elatedRequestId\ is set, the transport delivers the notification inline in the active POST SSE response — enabling stateless servers to notify clients without a persistent GET channel.

\\ s
// Before (notification silently dropped for stateless servers)
server.sendToolListChanged();

// After (delivered inline via relatedRequestId)
server.sendToolListChanged({ relatedRequestId: extra.requestId });
\\

The inline SSE delivery path already existed end-to-end; this change only exposes the missing optional parameter in the public API.

OAuth 2.1 §3.2 requires token endpoint requests to use
application/x-www-form-urlencoded regardless of grant type.

Add an explicit header.set() call immediately before the fetch in
executeTokenRequest() to prevent any addClientAuthentication
implementation from accidentally overriding the Content-Type.

Fixes modelcontextprotocol/inspector#1160
…esourceListChanged/sendPromptListChanged

Enables stateless MCP servers to deliver list-change notifications
inline via the POST SSE response stream, instead of silently dropping
them when no GET SSE channel is open.

Fixes modelcontextprotocol#1771.
@lanxevo3 lanxevo3 requested a review from a team as a code owner March 28, 2026 16:15
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

⚠️ No Changeset found

Latest commit: 65daa43

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
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 28, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1802

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1802

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1802

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1802

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1802

commit: 65daa43

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.

sendToolListChanged() notification silently dropped when no GET SSE channel is open

1 participant