feat(examples): upgrade mcp-shop-server to mcp 2.x, add TS/Python consumption snippets - #644
Merged
Merged
Conversation
…sumption snippets The shop server now runs on MCPServer (mcp 2.x): it serves MCP protocol 2026-07-28 and still answers legacy clients through the handshake, so the Swift sample keeps working unchanged. host/port move from the constructor to run(), per the v2 API; decorators are unchanged. The README gains MCPToolProvider snippets for TypeScript and Python over streamable-http, closing the loop on the 2026-07-28 series: verified live with the provider on both mcp 2.0 (modern era) and mcp 1.29 (legacy handshake) against this server. Closes #635 Code written by Claude (Fable 5), architected and approved by @cornelcroi.
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.
Issue Link
Closes #635
Summary
Final piece of the MCP 2026-07-28 series (#631–#634). The shop server example moves to
mcp2.x (MCPServer), so it serves protocol 2026-07-28 while still answering legacy clients — the Swift ChatGPTStyleChat sample keeps working unchanged. The README now shows how to consume it from agent-squad in TypeScript and Python overstreamable-http.Changes
shop_server.py:FastMCP→MCPServer; host/port moved from the constructor torun()(the v2 API); decorators (meta=,structured_output=) unchanged — verified against the installed 2.0.0.requirements.txt:mcp>=2.0.0.README.md: dual-era note, TS + PythonMCPToolProvidersnippets, Python >= 3.10 note.Verification
Live end-to-end, all four combinations exercised against this server: agent-squad's
MCPToolProvideron mcp 2.0 negotiated the modern era (stateless POSTs); on mcp 1.29 the server answered the legacy handshake (protocol 2025-11-25, session ID). Model-visible filtering (get_ordervisible,refresh_orderapp-only), widget URI, andstructuredContentverified on both. The reviewer independently reproduced this, including a raw legacyinitialize(2025-06-18) and a modernserver/discover(2026-07-28) against the same process.python-expert review: APPROVED.
Release notes draft for the series (no CHANGELOG file exists in the repo — use for the next release, suggested 1.2.0 / TS minor)
streamable-httptransport inMCPServerConfig(Add Streamable HTTP transport to MCPToolProvider (TypeScript + Python) #632)agent-squad[mcp]acceptsmcp1.x and 2.x ([Python] agent-squad[mcp] broken by mcp 2.0.0 release — cap dependency to <2 #631, [Python] Support MCP protocol 2026-07-28 via mcp 2.x, dual-major (no breaking changes) #634); fresh installs resolve to 2.xssecustom headers ([TypeScript] MCPToolProvider sse transport passes headers option that SSEClientTransport ignores #640, pre-existing)Checklist
Code written by Claude (Fable 5), architected and approved by @cornelcroi.