feat: MCP v2 (draft)#2843
Open
KKonstantinov wants to merge 1 commit into
Open
Conversation
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.
Migrate
@upstash/context7-mcpto MCP TypeScript SDK v2Summary
This PR migrates the
packages/mcpserver (@upstash/context7-mcp) from the MCPTypeScript SDK v1 (
@modelcontextprotocol/sdk) to v2(
@modelcontextprotocol/server+@modelcontextprotocol/node).It is a mechanical, behavior-preserving migration — no tool logic, prompts, transport
wiring, or runtime behavior changed. The bulk of it was produced by the official
@modelcontextprotocol/codemodand then reviewed by hand.Why v2
v2 replaces the single monolithic
@modelcontextprotocol/sdkpackage with a set offocused, ESM-only packages:
@modelcontextprotocol/server— the runtime-neutral server API (McpServer,stdio transport, shared types).
@modelcontextprotocol/node— the Node.js HTTP transport(
NodeStreamableHTTPServerTransport).The result is a smaller dependency surface, a cleaner public API, and first-class
support for non-Node runtimes. v1 is being superseded, so new work should target v2.
What changed (high level)
@modelcontextprotocol/sdk@modelcontextprotocol/server+@modelcontextprotocol/node@modelcontextprotocol/sdk/...{ query: z.string() }z.object({ query: z.string() })setRequestHandler(ListPromptsRequestSchema, …)setRequestHandler("prompts/list", …)StreamableHTTPServerTransportNodeStreamableHTTPServerTransportTwo concrete illustrations:
What did NOT change
zoddependency (already^4.4.3; v2's Standard Schema requirement is satisfiedby Zod v4).
How this was produced
Generated with the official MCP v1→v2 codemod and reviewed by hand:
Verification
All package checks pass after the migration:
typecheck(tsc --noEmit)build(tsc)test(vitest run) — 12/12 passinglint(eslint .)Before merging
2.0.0-alpha.3). The dependency pins reflect that.Recommend merging once v2 reaches a stable release and re-pinning to the GA version.
minimumReleaseAgeExclude: ['@modelcontextprotocol/*']entry added topnpm-workspace.yamlexempts the SDK packages from this repo's 7-dayminimumReleaseAgegate so the pre-release versions can be installed. It can beremoved once the depended-on v2 release is older than that window.
Roadmap
alphadraftbeta(legacy era MCP on modern interfaces)stable- backwards compatible with legacy era MCP clients; enabling Modern stateless MCP will need context7 maintainers support