Skip to content

feat(examples): upgrade mcp-shop-server to mcp 2.x, add TS/Python consumption snippets - #644

Merged
cornelcroi merged 1 commit into
mainfrom
feat/635-mcp-2026-example
Jul 29, 2026
Merged

feat(examples): upgrade mcp-shop-server to mcp 2.x, add TS/Python consumption snippets#644
cornelcroi merged 1 commit into
mainfrom
feat/635-mcp-2026-example

Conversation

@cornelcroi

Copy link
Copy Markdown
Collaborator

Issue Link

Closes #635

Summary

Final piece of the MCP 2026-07-28 series (#631#634). The shop server example moves to mcp 2.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 over streamable-http.

Changes

  • shop_server.py: FastMCPMCPServer; host/port moved from the constructor to run() (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 + Python MCPToolProvider snippets, Python >= 3.10 note.

Verification

Live end-to-end, all four combinations exercised against this server: agent-squad's MCPToolProvider on 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_order visible, refresh_order app-only), widget URI, and structuredContent verified on both. The reviewer independently reproduced this, including a raw legacy initialize (2025-06-18) and a modern server/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)

Checklist

  • Issue linked
  • Docs/README updated with usage examples
  • Backward compatible (example only; server still serves legacy clients)

Code written by Claude (Fable 5), architected and approved by @cornelcroi.

…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.
@cornelcroi
cornelcroi merged commit eaf3bfc into main Jul 29, 2026
2 checks passed
@cornelcroi
cornelcroi deleted the feat/635-mcp-2026-example branch July 29, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] End-to-end MCP 2026-07-28 example: shop server on mcp 2.x consumed from TS and Python

1 participant