docs: update code examples to the v2 SDKs#3066
Draft
claude[bot] wants to merge 5 commits into
Draft
Conversation
Rename tool.inputSchema to tool.input_schema in the Python quickstart, install @modelcontextprotocol/client instead of @modelcontextprotocol/sdk in the TypeScript quickstart, update the Client and StdioClientTransport imports to the new package paths, and raise the Node.js requirement to 20. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
Move the Python quickstart from FastMCP to MCPServer, pin the install to mcp[cli]==2.0.0b1, and require the v2 SDK. Move the TypeScript quickstart to @modelcontextprotocol/server with zod 4, update the McpServer and StdioServerTransport imports, wrap both registerTool input schemas in z.object(), and raise the Node.js requirement to 20. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
Install @modelcontextprotocol/server and @modelcontextprotocol/node in place of @modelcontextprotocol/sdk, import McpServer from the server package, replace StreamableHTTPServerTransport with NodeStreamableHTTPServerTransport from the node package, and raise the Node.js prerequisite to 20. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
Replace streamablehttp_client and its auth_provider kwarg with streamable_http_client plus an httpx.AsyncClient(auth=provider), replace the ClientSession and initialize() flow with the v2 Client context manager, and pass the required storage argument to both OAuth providers with an in-memory TokenStorage implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
Add a note under the abstract stating that the SEP records the experimental tasks feature from the 2025-11-25 specification, that its code examples are non-normative pseudocode written against the v1 SDKs, and that the draft specification moves tasks into the io.modelcontextprotocol/tasks extension per SEP-2663. Regenerated docs/seps/1686-tasks.mdx with npm run generate:seps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
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.
Requested by Den Delimarsky · Slack thread
The client and server quickstarts, the MCP Apps build guide, and the OAuth client credentials guide previously showed install commands and code written against the v1 SDKs. They now install the v2 packages (
@modelcontextprotocol/client,@modelcontextprotocol/server,@modelcontextprotocol/node,mcp2.0.0b1) and use the matching imports and APIs, includingMCPServer,streamable_http_clientwith anhttpx.AsyncClientauth flow, andz.object()input schemas. SEP-1686 now carries a note that it is a historical record whose examples are non-normative pseudocode against the v1 SDKs, with tasks moving to theio.modelcontextprotocol/tasksextension per SEP-2663.Motivation and Context
Preparation for the 2026-07-28 release. The code examples on these pages still targeted the v1 SDKs, so readers following them hit outdated package names, import paths, and API shapes that no longer match the published v2 TypeScript and Python SDKs.
Closes #3046
Closes #3047
Closes #3049
Closes #3050
Closes #3051
How Has This Been Tested?
Documentation-only change. Ran
npm run check:docs(prettier format check, MDX comment check, mint broken-links) andnpm run check:seps, all passing.prettier --checkpasses on every touched file.docs/seps/1686-tasks.mdxwas regenerated fromseps/1686-tasks.mdwithnpm run generate:sepsrather than hand-edited. Python API shapes were cross-checked against the python-sdk main branch (mcp.server.mcpserver,streamable_http_client, the client credentials and JWT OAuth providers' requiredstorageargument).Breaking Changes
None.
Types of changes
Checklist
Additional context
AI assistance disclosure: this PR, including the docs edits and this description, was drafted primarily with AI assistance, and the full diff gets human review before merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_016WBaED7Rta4YsYVz66Qoru
Generated by Claude Code