WebMCP Demo Store

io.github.kamatanuj由 GitHub 账号 kamatanuj 发布v1.0.0更新于 Nov 1, 2026

WebMCP demo store: same catalog via MCP tool calls vs DOM scraping. -79% bytes, -42% tokens.

发布方自己的服务:demo.st

已验证Streamable HTTP可网页运行网页搜索与抓取商业与电商

概览

AI 生成的概览

一个以 MCP 工具形式提供的演示网店,让助手无需抓取 HTML 即可搜索商品目录、管理购物车并下单。

可以做什么
  • 按分类、最高价格、最低评分或品牌子串搜索商品目录
  • 按商品 id 查看单个商品的完整详情
  • 将商品加入购物车,并查看当前购物车内容与合计金额
  • 为当前购物车下单并返回订单号
适用场景
适合试用或演示通过 MCP 进行的智能体购物流程,或在同一目录上对比工具调用与 DOM 抓取的效果。它是演示商店,并非真实商家。
运行要求
需要一个远程 streamable HTTP 端点;未声明认证、环境变量或请求头。README 还说明可在本地以普通模式或 MCP 模式运行自带的 Python 服务器,仅依赖 Python 标准库。
安装前请注意
结账会实际下单并返回订单号,因此演示服务器上的购物车与订单状态会改变,应把订单视为测试数据。README 提到该演示已产生真实订单号,且目录为固定的演示商品集,并非实时库存。

安装

在 SourceWeft 中

  1. 打开 控制台中的 WebMCP Demo Store,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.kamatanuj%2Fwebmcp-store/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "webmcp-demo-store": {
      "type": "http",
      "url": "https://demowithmcp.converso.work/mcp"
    }
  }
}

README

WebMCP Demo Store — one-file server, two modes, one benchmark

[Listed on mcpservers.org]

Same store, same tools, two delivery modes:

  • WebMCP mode — the page exposes its catalog through MCP tool calls (MCP-over-HTTP /mcp, plus Chrome-native document.modelContext), so an agent reads only what the task needs.
  • Plain mode — the same store as an ordinary website; the agent parses full HTML pages, as every agent must today.

Benchmark (150-product catalog, identical tasks): 79% less action bytes, 42% fewer input tokens, 8/8 tasks correct in both modes. DOM mode wins on small catalogs then collapses; WebMCP wins with age. Crossover report: report.html → WebMCP_Comparison_Report.pdf.

Run it

bash
python3 server.py                    # plain mode      → http://localhost:9501MCP=1 PORT=9502 python3 server.py    # WebMCP mode     → http://localhost:9502 + /mcp

stdlib-only (http.server, json, uuid, threading) — no pip install, no dependencies.

Live demos

Chrome-native WebMCP test (13 Oct 2026)

Chrome 154 + --enable-features=WebMCP exposes document.modelContext on HTTPS origins (about:blank excluded).

  • Registered the 5-tool store contract via the IMPERATIVE API (registerTool): search_products, add_to_cart, get_cart, checkout (server-backed; all fetches in-page).
  • Standard client flow verified: getTools() discovery → executeTool() calls → orders 1017/1018 placed, T2/T4/T8 picks correct (HP Pavilion 14, Razer DeathAdder, OnePlus 12R).
  • 154 build quirks found & worked around:
    1. executeTool(tool, args) requires args as a JSON string (object form throws "Failed to parse input arguments"); return values are JSON strings too — JSON.parse both sides.
    2. Tools can't be re-registered under the same name (InvalidStateError) — reload the page to reset.
    3. Flag/feature name: --enable-features=WebMCP works headless; docs' chrome://flags/#enable-webmcp-testing is the manual path. Note: API is document.modelContext (moved from navigator since July 2026 build).
  • Takeaway: the demo's tool contract is compatible with Chrome's native WebMCP, not just our JSON-RPC shim. When Chrome ships the client agent (Gemini-in-Chrome), the store is already agent-ready.

Repo layout

pathwhat
server.pythe whole thing: store + cart + orders + MCP transport (MCP=1) + static/report serving
catalog.json / catalog_10.json150-product / 10-product demo catalogs
compare.py, compare_llm.py, browser_llm.pybenchmark harnesses (DOM-mode agent, LLM-token accounting, browser-native flow)
make_report.pyregenerates the HTML/PDF reports from results.json / agg_150_vs_30.json
whitepaper.html, report*.html, *.pdf, chart_*.pngstrategy + evidence artifacts (launch deck included)
weekly_recap.pycounters + live-URL digest (used by the ops cron)

License

MIT.

来源:README.md,提交 15e17a4

工具

5

search_products

Search product catalog. Filter by category (mice|laptops|phones), max_price (INR), min_rating, brand substring.

输入参数brandquerycategorymax_pricemin_rating

get_product_details

Full details of one product by id.

输入参数id必填

add_to_cart

Add product to cart (qty default 1).

输入参数id必填qty

get_cart

Current cart contents and total.

无需输入参数。

checkout

Place order for current cart. Returns order id.

无需输入参数。

版本历史

1
  1. v1.0.0最新Oct 18, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Demo 集成