VersionControl:PRs/pickipedia-mcp/39: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
DrivingThatTrain (talk | contribs)
cryptograss/pickipedia-mcp#39, as GitHub has it
Tag: Manual revert
DrivingThatTrain (talk | contribs)
cryptograss/pickipedia-mcp#39, as GitHub has it
 
Line 16: Line 16:
|deploy=
|deploy=
}}
}}
<pre class="pr-body">Bumps [@modelcontextprotocol/server](https://github.com/modelcontextprotocol/typescript-sdk) from 2.0.0 to 2.3.1.
&lt;details&gt;
&lt;summary&gt;Release notes&lt;/summary&gt;
&lt;p&gt;&lt;em&gt;Sourced from &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/releases"&gt;@​modelcontextprotocol/server's releases&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;h2&gt;&lt;code&gt;@​modelcontextprotocol/server-legacy&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.1&lt;/h2&gt;
&lt;h3&gt;Patch Changes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2952"&gt;#2952&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/5a1867390b91b8836f49af76c45427279f513325"&gt;&lt;code&gt;5a18673&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - &lt;code&gt;requireBearerAuth&lt;/code&gt; in &lt;code&gt;@modelcontextprotocol/server-legacy&lt;/code&gt; takes the optional &lt;code&gt;expectedResource&lt;/code&gt; that &lt;code&gt;@modelcontextprotocol/server&lt;/code&gt; 2.3.0 and &lt;code&gt;@modelcontextprotocol/sdk&lt;/code&gt; 1.32.0 added: the resource the token must be issued for (its audience), usually the server's URL. When it is set, a token is accepted only if the verifier reports that value in &lt;code&gt;AuthInfo.resource&lt;/code&gt;; the two are compared as strings, ignoring a fragment and one trailing slash. A token reported for another value, or for none, is answered &lt;code&gt;401 invalid_token&lt;/code&gt; with the usual &lt;code&gt;WWW-Authenticate&lt;/code&gt; challenge. When it is not set, nothing changes. The package stays frozen otherwise; this option is added so that its &lt;code&gt;requireBearerAuth&lt;/code&gt; matches the 1.x middleware it is a copy of.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updated dependencies []:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;@​modelcontextprotocol/core&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.1&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;code&gt;@​modelcontextprotocol/server&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.1&lt;/h2&gt;
&lt;h3&gt;Patch Changes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Updated dependencies []:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;@​modelcontextprotocol/core&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.1&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;code&gt;@​modelcontextprotocol/server-legacy&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.0&lt;/h2&gt;
&lt;h3&gt;Patch Changes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2908"&gt;#2908&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/633dd3e12bff6869c932c4a526341622320912b1"&gt;&lt;code&gt;633dd3e&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - The &lt;code&gt;license&lt;/code&gt; field of the package manifests is now &lt;code&gt;Apache-2.0&lt;/code&gt;; the &lt;code&gt;LICENSE&lt;/code&gt; file shipped in each package carries the full terms, including the MIT text for earlier contributions. No code change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updated dependencies [&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/633dd3e12bff6869c932c4a526341622320912b1"&gt;&lt;code&gt;633dd3e&lt;/code&gt;&lt;/a&gt;]:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;@​modelcontextprotocol/core&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.0&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;code&gt;@​modelcontextprotocol/server&lt;/code&gt;&lt;a href="https://github.com/2"&gt;&lt;code&gt;@​2&lt;/code&gt;&lt;/a&gt;.3.0&lt;/h2&gt;
&lt;h3&gt;Minor Changes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2929"&gt;#2929&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/40f8f4e229d963cd7fd2890bda2aeebe7005299a"&gt;&lt;code&gt;40f8f4e&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - &lt;code&gt;requireBearerAuth&lt;/code&gt; and &lt;code&gt;verifyBearerToken&lt;/code&gt; take a new optional &lt;code&gt;expectedResource&lt;/code&gt;, which makes them accept only tokens issued for this resource (the token's audience). Set it to the value your authorization server puts into tokens meant for this server, usually the server's URL. When it is set, a token is accepted only if the verifier reports that value in &lt;code&gt;AuthInfo.resource&lt;/code&gt;; the two are compared as strings, ignoring a fragment and one trailing slash. A token reported for another value, or for none, is answered &lt;code&gt;401 invalid_token&lt;/code&gt; with the usual &lt;code&gt;WWW-Authenticate&lt;/code&gt; challenge. When it is not set, nothing changes. To use it, pass &lt;code&gt;expectedResource&lt;/code&gt; and have &lt;code&gt;verifyAccessToken&lt;/code&gt; fill &lt;code&gt;AuthInfo.resource&lt;/code&gt;, for example from the &lt;code&gt;aud&lt;/code&gt; claim. The option is declared on a new exported type, &lt;code&gt;VerifyBearerTokenOptions&lt;/code&gt;, which extends &lt;code&gt;BearerAuthOptions&lt;/code&gt;; &lt;code&gt;BearerAuthOptions&lt;/code&gt; itself is unchanged. The Express &lt;code&gt;requireBearerAuth&lt;/code&gt; passes the option through. With Express, &lt;code&gt;@modelcontextprotocol/express&lt;/code&gt; has to be upgraded to this release as well: 2.0.1 does not pass the option on, so nothing is compared. Its options type does not have the option, so TypeScript reports an &lt;code&gt;expectedResource&lt;/code&gt; written in a call to the 2.0.1 &lt;code&gt;requireBearerAuth&lt;/code&gt; as an error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2926"&gt;#2926&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/6d8dbc6cb590edf766fcb66b636ca6b654e99c37"&gt;&lt;code&gt;6d8dbc6&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - &lt;code&gt;McpServer&lt;/code&gt; now accepts a &lt;code&gt;maxToolInputElements&lt;/code&gt; option that limits the number of elements in tool-call arguments: the largest combined number of array elements and object members a single &lt;code&gt;tools/call&lt;/code&gt; &lt;code&gt;arguments&lt;/code&gt; payload may contain. It is off by default, so behavior is unchanged unless you set it. When it is set and a call exceeds it, that call is answered with an &lt;code&gt;isError: true&lt;/code&gt; tool result that names the limit, before the input schema runs, and the server keeps serving. Set it above the largest arguments your tools legitimately accept; &lt;code&gt;maxRequestBodySize&lt;/code&gt; remains the primary limit on request size. The value must be a number of at least 1, or &lt;code&gt;Infinity&lt;/code&gt; for no limit; any other value is rejected at construction. The options type is exported as &lt;code&gt;McpServerOptions&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2918"&gt;#2918&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/84804c22e45a662675a198f853b7f00063838a8d"&gt;&lt;code&gt;84804c2&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - A &lt;code&gt;Server&lt;/code&gt; or &lt;code&gt;McpServer&lt;/code&gt; now serves one connection at a time, and a Streamable HTTP server transport without sessions (&lt;code&gt;sessionIdGenerator: undefined&lt;/code&gt;) serves one request. An app that uses one server object, or one stateless transport, for every HTTP request fails on the second request after this upgrade. Build the server and the transport per request instead.&lt;/p&gt;
&lt;p&gt;What keeps working without a change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;createMcpHandler(buildServer)&lt;/code&gt; and &lt;code&gt;serveStdio(buildServer)&lt;/code&gt;, where &lt;code&gt;buildServer&lt;/code&gt; returns a new server on every call.&lt;/li&gt;
&lt;li&gt;A handler that builds a new server and a new stateless transport for each request.&lt;/li&gt;
&lt;li&gt;One server and one transport per session (a transport with a &lt;code&gt;sessionIdGenerator&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Connecting a server again after &lt;code&gt;close()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Client&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What fails now, how it shows, and what to change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One server object with a new stateless transport per request (&lt;code&gt;const server = new McpServer(...)&lt;/code&gt; outside the handler, &lt;code&gt;await server.connect(transport)&lt;/code&gt; inside it): the second HTTP request the process receives fails, and so does every later one. &lt;code&gt;connect()&lt;/code&gt; rejects with an &lt;code&gt;SdkError&lt;/code&gt; of code &lt;code&gt;ALREADY_CONNECTED&lt;/code&gt;. If the handler closes the transport when the response ends, requests that arrive one after the other still work and a request that overlaps another one fails. Change: move &lt;code&gt;new McpServer(...)&lt;/code&gt; and its registrations into the handler.&lt;/li&gt;
&lt;li&gt;One stateless transport for every request (a transport built once with &lt;code&gt;sessionIdGenerator: undefined&lt;/code&gt;): the second HTTP request fails. &lt;code&gt;WebStandardStreamableHTTPServerTransport.handleRequest()&lt;/code&gt; rejects with &lt;code&gt;Stateless transport cannot be reused across requests. Create a new transport per request.&lt;/code&gt;, and &lt;code&gt;NodeStreamableHTTPServerTransport.handleRequest()&lt;/code&gt; answers &lt;code&gt;500&lt;/code&gt;. Change: build the server and the transport inside the handler and connect them there.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;createMcpHandler(() =&amp;gt; server)&lt;/code&gt; with a server built once: a request that arrives after the previous response has been read to its end still works. A request that arrives while another one is being served is answered &lt;code&gt;500&lt;/code&gt; with the JSON-RPC error &lt;code&gt;-32603&lt;/code&gt; (&lt;code&gt;Internal server error&lt;/code&gt;); the reason is reported only through the &lt;code&gt;onerror&lt;/code&gt; option. Change: pass a function that builds the server, as in &lt;code&gt;createMcpHandler(buildServer)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;One server object for every session: the &lt;code&gt;initialize&lt;/code&gt; request of the second session fails with &lt;code&gt;ALREADY_CONNECTED&lt;/code&gt;. Change: build a server per session.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What the caller sees when &lt;code&gt;connect()&lt;/code&gt; or &lt;code&gt;handleRequest()&lt;/code&gt; rejects depends on the host. Express 5, Fastify and Hono answer &lt;code&gt;500&lt;/code&gt;. A plain &lt;code&gt;node:http&lt;/code&gt; listener without its own error handling gets an unhandled rejection, which ends the process.&lt;/p&gt;
&lt;p&gt;The README examples of &lt;code&gt;@modelcontextprotocol/express&lt;/code&gt;, &lt;code&gt;@modelcontextprotocol/fastify&lt;/code&gt;, &lt;code&gt;@modelcontextprotocol/hono&lt;/code&gt; and &lt;code&gt;@modelcontextprotocol/node&lt;/code&gt;, and the handler examples in the JSDoc of &lt;code&gt;WebStandardStreamableHTTPServerTransport&lt;/code&gt; and &lt;code&gt;NodeStreamableHTTPServerTransport&lt;/code&gt;, now build a server and a transport per request.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2907"&gt;#2907&lt;/a&gt; &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/e55f9ac1b1cae413599b499cbaa45c0378edba78"&gt;&lt;code&gt;e55f9ac&lt;/code&gt;&lt;/a&gt; Thanks &lt;a href="https://github.com/apps/claude"&gt;&lt;code&gt;@​claude&lt;/code&gt;&lt;/a&gt;! - &lt;code&gt;allowedOrigins&lt;/code&gt; and &lt;code&gt;validateOriginHeader&lt;/code&gt; accept lowercase entries of the form &lt;code&gt;&amp;lt;scheme&amp;gt;://*&lt;/code&gt;, such as &lt;code&gt;moz-extension://*&lt;/code&gt; or &lt;code&gt;chrome-extension://*&lt;/code&gt;, which admit every origin of that scheme. This lets a server admit MCP clients that run as a browser extension when the extension ID cannot be listed, as on Firefox, where it differs on every install. &lt;code&gt;http://*&lt;/code&gt; and &lt;code&gt;https://*&lt;/code&gt; are not honoured, and the defaults are unchanged.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;/blockquote&gt;
&lt;p&gt;... (truncated)&lt;/p&gt;
&lt;/details&gt;
&lt;details&gt;
&lt;summary&gt;Commits&lt;/summary&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/fcef852f6cdafea07f36cf6fae69b37c8adf85be"&gt;&lt;code&gt;fcef852&lt;/code&gt;&lt;/a&gt; Version Packages (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2953"&gt;#2953&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/e8b7f05f5b9e4204510289dc0596531265e9ddcb"&gt;&lt;code&gt;e8b7f05&lt;/code&gt;&lt;/a&gt; docs: one opening note in the server and client package READMEs (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2955"&gt;#2955&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/5a1867390b91b8836f49af76c45427279f513325"&gt;&lt;code&gt;5a18673&lt;/code&gt;&lt;/a&gt; feat(server-legacy): add expectedResource to requireBearerAuth (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2952"&gt;#2952&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/3ab61c61f5ff1cd6b67eec6222247c66635495fd"&gt;&lt;code&gt;3ab61c6&lt;/code&gt;&lt;/a&gt; docs: update the README banners (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2940"&gt;#2940&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/8aabbdcef6e016978a3132045281dfbd51c69792"&gt;&lt;code&gt;8aabbdc&lt;/code&gt;&lt;/a&gt; test(e2e): expect SdkHttpError after a second 401 from onUnauthorized (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2936"&gt;#2936&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/33fecfb119cb637022fcb345c61c09227ed04fc4"&gt;&lt;code&gt;33fecfb&lt;/code&gt;&lt;/a&gt; test(e2e): cover tools/call without arguments (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2933"&gt;#2933&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/818f7828898f367bfd4436bf55ccdfa17c3757d6"&gt;&lt;code&gt;818f782&lt;/code&gt;&lt;/a&gt; docs: state the principles in CLAUDE.md and shorten REVIEW.md (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2938"&gt;#2938&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/a202a3621fcb97918e09fa45d0f9efd2dbdee19b"&gt;&lt;code&gt;a202a36&lt;/code&gt;&lt;/a&gt; Version Packages (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2896"&gt;#2896&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/2d731faef167b3df78d4be05f547a134f0e23bcf"&gt;&lt;code&gt;2d731fa&lt;/code&gt;&lt;/a&gt; fix(client): refresh again when an SSE retry failed for a reason other than 4...&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/b6e5c5574e107c33cb6ae33c2e869780f5684c3a"&gt;&lt;code&gt;b6e5c55&lt;/code&gt;&lt;/a&gt; test(e2e): cover prompts/get without arguments for prompts with a schema (&lt;a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2928"&gt;#2928&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Additional commits viewable in &lt;a href="https://github.com/modelcontextprotocol/typescript-sdk/compare/@modelcontextprotocol/server@2.0.0...@modelcontextprotocol/server@2.3.1"&gt;compare view&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;br /&gt;
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@modelcontextprotocol/server&amp;package-manager=npm_and_yarn&amp;previous-version=2.0.0&amp;new-version=2.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
&lt;details&gt;
&lt;summary&gt;Dependabot commands and options&lt;/summary&gt;
&lt;br /&gt;
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show &lt;dependency name&gt; ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
&lt;/details&gt;</pre>

Latest revision as of 19:06, 9 November 2026

pickipedia-mcp#39: Bump @modelcontextprotocol/server from 2.0.0 to 2.3.1
State 🟣 merged 2026-10-29 03:12:48
Worked on by not said
Moods not said
Deploy not said
Branch dependabot/npm_and_yarn/modelcontextprotocol/server-2.3.1 → master, by dependabot[bot]
Opened · last pushed 2026-10-25 13:53:17 · 2026-10-25 13:53:15
Bumps [@modelcontextprotocol/server](https://github.com/modelcontextprotocol/typescript-sdk) from 2.0.0 to 2.3.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/modelcontextprotocol/typescript-sdk/releases">@​modelcontextprotocol/server's releases</a>.</em></p>
<blockquote>
<h2><code>@​modelcontextprotocol/server-legacy</code><a href="https://github.com/2"><code>@​2</code></a>.3.1</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2952">#2952</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/5a1867390b91b8836f49af76c45427279f513325"><code>5a18673</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - <code>requireBearerAuth</code> in <code>@modelcontextprotocol/server-legacy</code> takes the optional <code>expectedResource</code> that <code>@modelcontextprotocol/server</code> 2.3.0 and <code>@modelcontextprotocol/sdk</code> 1.32.0 added: the resource the token must be issued for (its audience), usually the server's URL. When it is set, a token is accepted only if the verifier reports that value in <code>AuthInfo.resource</code>; the two are compared as strings, ignoring a fragment and one trailing slash. A token reported for another value, or for none, is answered <code>401 invalid_token</code> with the usual <code>WWW-Authenticate</code> challenge. When it is not set, nothing changes. The package stays frozen otherwise; this option is added so that its <code>requireBearerAuth</code> matches the 1.x middleware it is a copy of.</p>
</li>
<li>
<p>Updated dependencies []:</p>
<ul>
<li><code>@​modelcontextprotocol/core</code><a href="https://github.com/2"><code>@​2</code></a>.3.1</li>
</ul>
</li>
</ul>
<h2><code>@​modelcontextprotocol/server</code><a href="https://github.com/2"><code>@​2</code></a>.3.1</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies []:
<ul>
<li><code>@​modelcontextprotocol/core</code><a href="https://github.com/2"><code>@​2</code></a>.3.1</li>
</ul>
</li>
</ul>
<h2><code>@​modelcontextprotocol/server-legacy</code><a href="https://github.com/2"><code>@​2</code></a>.3.0</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2908">#2908</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/633dd3e12bff6869c932c4a526341622320912b1"><code>633dd3e</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - The <code>license</code> field of the package manifests is now <code>Apache-2.0</code>; the <code>LICENSE</code> file shipped in each package carries the full terms, including the MIT text for earlier contributions. No code change.</p>
</li>
<li>
<p>Updated dependencies [<a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/633dd3e12bff6869c932c4a526341622320912b1"><code>633dd3e</code></a>]:</p>
<ul>
<li><code>@​modelcontextprotocol/core</code><a href="https://github.com/2"><code>@​2</code></a>.3.0</li>
</ul>
</li>
</ul>
<h2><code>@​modelcontextprotocol/server</code><a href="https://github.com/2"><code>@​2</code></a>.3.0</h2>
<h3>Minor Changes</h3>
<ul>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2929">#2929</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/40f8f4e229d963cd7fd2890bda2aeebe7005299a"><code>40f8f4e</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - <code>requireBearerAuth</code> and <code>verifyBearerToken</code> take a new optional <code>expectedResource</code>, which makes them accept only tokens issued for this resource (the token's audience). Set it to the value your authorization server puts into tokens meant for this server, usually the server's URL. When it is set, a token is accepted only if the verifier reports that value in <code>AuthInfo.resource</code>; the two are compared as strings, ignoring a fragment and one trailing slash. A token reported for another value, or for none, is answered <code>401 invalid_token</code> with the usual <code>WWW-Authenticate</code> challenge. When it is not set, nothing changes. To use it, pass <code>expectedResource</code> and have <code>verifyAccessToken</code> fill <code>AuthInfo.resource</code>, for example from the <code>aud</code> claim. The option is declared on a new exported type, <code>VerifyBearerTokenOptions</code>, which extends <code>BearerAuthOptions</code>; <code>BearerAuthOptions</code> itself is unchanged. The Express <code>requireBearerAuth</code> passes the option through. With Express, <code>@modelcontextprotocol/express</code> has to be upgraded to this release as well: 2.0.1 does not pass the option on, so nothing is compared. Its options type does not have the option, so TypeScript reports an <code>expectedResource</code> written in a call to the 2.0.1 <code>requireBearerAuth</code> as an error.</p>
</li>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2926">#2926</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/6d8dbc6cb590edf766fcb66b636ca6b654e99c37"><code>6d8dbc6</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - <code>McpServer</code> now accepts a <code>maxToolInputElements</code> option that limits the number of elements in tool-call arguments: the largest combined number of array elements and object members a single <code>tools/call</code> <code>arguments</code> payload may contain. It is off by default, so behavior is unchanged unless you set it. When it is set and a call exceeds it, that call is answered with an <code>isError: true</code> tool result that names the limit, before the input schema runs, and the server keeps serving. Set it above the largest arguments your tools legitimately accept; <code>maxRequestBodySize</code> remains the primary limit on request size. The value must be a number of at least 1, or <code>Infinity</code> for no limit; any other value is rejected at construction. The options type is exported as <code>McpServerOptions</code>.</p>
</li>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2918">#2918</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/84804c22e45a662675a198f853b7f00063838a8d"><code>84804c2</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - A <code>Server</code> or <code>McpServer</code> now serves one connection at a time, and a Streamable HTTP server transport without sessions (<code>sessionIdGenerator: undefined</code>) serves one request. An app that uses one server object, or one stateless transport, for every HTTP request fails on the second request after this upgrade. Build the server and the transport per request instead.</p>
<p>What keeps working without a change:</p>
<ul>
<li><code>createMcpHandler(buildServer)</code> and <code>serveStdio(buildServer)</code>, where <code>buildServer</code> returns a new server on every call.</li>
<li>A handler that builds a new server and a new stateless transport for each request.</li>
<li>One server and one transport per session (a transport with a <code>sessionIdGenerator</code>).</li>
<li>Connecting a server again after <code>close()</code>.</li>
<li><code>Client</code>.</li>
</ul>
<p>What fails now, how it shows, and what to change:</p>
<ul>
<li>One server object with a new stateless transport per request (<code>const server = new McpServer(...)</code> outside the handler, <code>await server.connect(transport)</code> inside it): the second HTTP request the process receives fails, and so does every later one. <code>connect()</code> rejects with an <code>SdkError</code> of code <code>ALREADY_CONNECTED</code>. If the handler closes the transport when the response ends, requests that arrive one after the other still work and a request that overlaps another one fails. Change: move <code>new McpServer(...)</code> and its registrations into the handler.</li>
<li>One stateless transport for every request (a transport built once with <code>sessionIdGenerator: undefined</code>): the second HTTP request fails. <code>WebStandardStreamableHTTPServerTransport.handleRequest()</code> rejects with <code>Stateless transport cannot be reused across requests. Create a new transport per request.</code>, and <code>NodeStreamableHTTPServerTransport.handleRequest()</code> answers <code>500</code>. Change: build the server and the transport inside the handler and connect them there.</li>
<li><code>createMcpHandler(() =&gt; server)</code> with a server built once: a request that arrives after the previous response has been read to its end still works. A request that arrives while another one is being served is answered <code>500</code> with the JSON-RPC error <code>-32603</code> (<code>Internal server error</code>); the reason is reported only through the <code>onerror</code> option. Change: pass a function that builds the server, as in <code>createMcpHandler(buildServer)</code>.</li>
<li>One server object for every session: the <code>initialize</code> request of the second session fails with <code>ALREADY_CONNECTED</code>. Change: build a server per session.</li>
</ul>
<p>What the caller sees when <code>connect()</code> or <code>handleRequest()</code> rejects depends on the host. Express 5, Fastify and Hono answer <code>500</code>. A plain <code>node:http</code> listener without its own error handling gets an unhandled rejection, which ends the process.</p>
<p>The README examples of <code>@modelcontextprotocol/express</code>, <code>@modelcontextprotocol/fastify</code>, <code>@modelcontextprotocol/hono</code> and <code>@modelcontextprotocol/node</code>, and the handler examples in the JSDoc of <code>WebStandardStreamableHTTPServerTransport</code> and <code>NodeStreamableHTTPServerTransport</code>, now build a server and a transport per request.</p>
</li>
<li>
<p><a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2907">#2907</a> <a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/e55f9ac1b1cae413599b499cbaa45c0378edba78"><code>e55f9ac</code></a> Thanks <a href="https://github.com/apps/claude"><code>@​claude</code></a>! - <code>allowedOrigins</code> and <code>validateOriginHeader</code> accept lowercase entries of the form <code>&lt;scheme&gt;://*</code>, such as <code>moz-extension://*</code> or <code>chrome-extension://*</code>, which admit every origin of that scheme. This lets a server admit MCP clients that run as a browser extension when the extension ID cannot be listed, as on Firefox, where it differs on every install. <code>http://*</code> and <code>https://*</code> are not honoured, and the defaults are unchanged.</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/fcef852f6cdafea07f36cf6fae69b37c8adf85be"><code>fcef852</code></a> Version Packages (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2953">#2953</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/e8b7f05f5b9e4204510289dc0596531265e9ddcb"><code>e8b7f05</code></a> docs: one opening note in the server and client package READMEs (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2955">#2955</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/5a1867390b91b8836f49af76c45427279f513325"><code>5a18673</code></a> feat(server-legacy): add expectedResource to requireBearerAuth (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2952">#2952</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/3ab61c61f5ff1cd6b67eec6222247c66635495fd"><code>3ab61c6</code></a> docs: update the README banners (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2940">#2940</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/8aabbdcef6e016978a3132045281dfbd51c69792"><code>8aabbdc</code></a> test(e2e): expect SdkHttpError after a second 401 from onUnauthorized (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2936">#2936</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/33fecfb119cb637022fcb345c61c09227ed04fc4"><code>33fecfb</code></a> test(e2e): cover tools/call without arguments (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2933">#2933</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/818f7828898f367bfd4436bf55ccdfa17c3757d6"><code>818f782</code></a> docs: state the principles in CLAUDE.md and shorten REVIEW.md (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2938">#2938</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/a202a3621fcb97918e09fa45d0f9efd2dbdee19b"><code>a202a36</code></a> Version Packages (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2896">#2896</a>)</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/2d731faef167b3df78d4be05f547a134f0e23bcf"><code>2d731fa</code></a> fix(client): refresh again when an SSE retry failed for a reason other than 4...</li>
<li><a href="https://github.com/modelcontextprotocol/typescript-sdk/commit/b6e5c5574e107c33cb6ae33c2e869780f5684c3a"><code>b6e5c55</code></a> test(e2e): cover prompts/get without arguments for prompts with a schema (<a href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2928">#2928</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/modelcontextprotocol/typescript-sdk/compare/@modelcontextprotocol/server@2.0.0...@modelcontextprotocol/server@2.3.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@modelcontextprotocol/server&package-manager=npm_and_yarn&previous-version=2.0.0&new-version=2.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>