Skip to content

docs: update code examples to the v2 SDKs#3066

Draft
claude[bot] wants to merge 5 commits into
docs/2026-07-28-releasefrom
claude/rc-sdk-v2-examples
Draft

docs: update code examples to the v2 SDKs#3066
claude[bot] wants to merge 5 commits into
docs/2026-07-28-releasefrom
claude/rc-sdk-v2-examples

Conversation

@claude

@claude claude Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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, mcp 2.0.0b1) and use the matching imports and APIs, including MCPServer, streamable_http_client with an httpx.AsyncClient auth flow, and z.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 the io.modelcontextprotocol/tasks extension 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) and npm run check:seps, all passing. prettier --check passes on every touched file. docs/seps/1686-tasks.mdx was regenerated from seps/1686-tasks.md with npm run generate:seps rather 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' required storage argument).

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

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

claude added 5 commits July 10, 2026 07:33
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
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant