Repository navigation
feat!: move to MCP TypeScript SDK v2 - #142
Merged
Merged
Conversation
Swaps @modelcontextprotocol/sdk 1.x for the v2 packages (@modelcontextprotocol/server and /core, plus /client for tests) and ext-apps 2.0.3, same as mapbox/mcp-server#296. Ran the official v1-to-v2 codemod, then: - Replace the SDK output-validation patch with lenientOutputSchema, a Standard Schema wrapper that keeps the real schema in tools/list but only warns on a mismatch. Tools that return text only get structuredContent {}. - Register prompt argument schemas as z.object(), since v2 deprecates raw shapes. - Move test request contexts to the v2 shape (http.authInfo) so the token checks actually run. - Add tests that make a real tools/call through McpServer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 21, 2026
Open
ctufts
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of mapbox/mcp-server#245, same move as mapbox/mcp-server#296.
Moves us from
@modelcontextprotocol/sdk1.x to the v2 SDK packages (@modelcontextprotocol/serverand/core2.3.1) and ext-apps 2.0.3.What changed
Most of it is the official codemod (
npx @modelcontextprotocol/codemod v1-to-v2 .). On top of that:structuredContentdoesn't match the output schema or is missing, which is what our patch stopped in v1.lenientOutputSchema(same as mcp-server) keeps the real schema intools/listand only warns. Text-only results from a tool with an output schema getstructuredContent: {}.patches/is now empty. New tests make realtools/callrequests throughMcpServerand fail without the wrapper.z.object(...), since v2 deprecates bare Zod shapes there.{ http: { authInfo } }shape (path-traversal and map preview UI tests), so the token actually reaches the code under test.@modelcontextprotocol/clientis a dev dependency, tests only.Clients
Nothing changes. It still negotiates 2025-11-25 and the MCP Apps UI resources serve the same way.
Heads up
installTo(server)needs a v2McpServer. A v1 package still registers fine on a v2 server but reads the token from the wrong place, so hosted pins v2 releases of all three server packages together.@mcp-ui/server6.1.0 (latest) still depends on the v1 SDK, so v1 stays innode_modulesunder it. We only callcreateUIResource(), which builds a plain object, so the two SDKs never touch.Testing
npm test: 51 files, 646 tests passingMcpServerstructuredContent, 6 resources including bothui://ones astext/html;profile=mcp-app, 7 prompts, clean stderr🤖 Generated with Claude Code