MCP Commerce Server Starter

io.github.NewPlanetWW由 GitHub 帳號 NewPlanetWW 發布v1.0.0更新於 Oct 24, 2026

FastMCP commerce server starter: product catalog, search, and checkout. Deploy to Vercel in 5 min.

已驗證Streamable HTTP可網頁執行開發者工具商業與電商

概覽

AI 產生的概覽

一個商務類 MCP 伺服器起步範本,提供商品目錄資源以及搜尋與結帳工具,讓代理程式完成購物流程。

可以做什麼
這是以 FastMCP 與 FastAPI 打造的複製即可部署商務伺服器範本。它提供代理程式可讀取的商品目錄資源、支援關鍵字、分類與最高價格篩選的 search_products 工具,以及回傳訂單摘要與結帳連結的 initiate_checkout 工具。另外也提供健康檢查端點,可在本機執行或部署到 Vercel。
適用情境
當你需要一個可運作、面向代理程式的商務後端範例,或想把自家商品目錄與結帳流程接上 Claude、ChatGPT、Gemini、Cursor 等 MCP 用戶端時,可以使用它。它是範本而非成品商店,需要自行替換範例資料與結帳佔位實作。
執行需求
可作為遠端端點使用,也可在本機執行,需要 Python 及以 pip 安裝的相依套件;使用 Vercel CLI 部署需要 Node 18+。選用的 API 金鑰驗證使用 X-API-Key 標頭,由 API_KEY 與 REQUIRE_AUTH 環境變數控制。清單中未宣告任何憑證。
安裝前請注意
API_KEY 的預設值是佔位值,上線前應更換;除非設定 REQUIRE_AUTH,否則驗證處於關閉狀態。結帳工具在接上 Stripe 等真實支付服務前只是佔位實作,屆時會涉及 STRIPE_SECRET_KEY 與真實扣款。商品資料在替換前只是原始碼中的範例資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MCP Commerce Server Starter,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.NewPlanetWW%2Fmcp-commerce-starter/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "commerce-starter": {
      "type": "http",
      "url": "https://mcp-commerce-starter.vercel.app/mcp"
    }
  }
}

README

MCP Commerce Server Starter

Clone-and-deploy boilerplate for a commerce MCP server. Live on Vercel in five minutes. Reachable by Claude, ChatGPT, Gemini, Cursor, and every other MCP-compatible client.

Full build guide (with the why behind every line): How to Build an MCP Server in 2026


What you get

  • Product catalog Resource — agents read the full catalog before acting
  • search_products Tool — keyword + category + max-price filter
  • initiate_checkout Tool — returns order summary + checkout URL
  • Optional API-key auth — X-API-Key header, toggle with REQUIRE_AUTH=true
  • Health endpoint at /health
  • Vercel-ready — one command deploy, free Hobby tier

Stack: Python · FastMCP · FastAPI · Vercel


Quick start (local)

bash
git clone https://github.com/NewPlanetWW/mcp-commerce-startercd mcp-commerce-starter
python -m venv .venv && source .venv/bin/activatepip install -r requirements.txt
python server.py# Server running at http://localhost:8000# MCP endpoint: http://localhost:8000/mcp# Health check: http://localhost:8000/health

Test the health endpoint:

bash
curl http://localhost:8000/health# {"status":"ok","server":"Commerce MCP Server","version":"1.0.0"}

Deploy to Vercel (free)

Requires Node 18+ for the Vercel CLI. No GitHub required — the CLI uploads directly.

bash
npm i -g vercelvercel loginvercel --prod

The CLI prints your production URL. Your MCP endpoint is at:

https://your-project.vercel.app/mcp

Set environment variables in the Vercel dashboard (Settings → Environment Variables):

VariableDefaultNotes
API_KEYdev-secret-keyChange before going live
REQUIRE_AUTHfalseSet true to enforce the key

Wire into Claude Desktop

Option A — Local stdio (fast iteration while building):

Edit ~/Library/Application Support/Claude/claude_desktop_config.json on macOS (see full guide for Windows/Linux paths):

json
{  "mcpServers": {    "commerce-catalog": {      "command": "uvicorn",      "args": ["server:app", "--host", "127.0.0.1", "--port", "8001"],      "env": {        "REQUIRE_AUTH": "false"      },      "cwd": "/path/to/mcp-commerce-starter"    }  }}

Option B — Remote (after Vercel deploy) using mcp-remote:

json
{  "mcpServers": {    "commerce-catalog-remote": {      "command": "npx",      "args": [        "-y", "mcp-remote@latest",        "https://your-project.vercel.app/mcp",        "--header", "Authorization: Bearer ${MCP_API_KEY}"      ],      "env": { "MCP_API_KEY": "your-secret-key" }    }  }}

Fully quit and relaunch Claude Desktop. Ask: "What products do you have under $100?" — Claude calls search_products and responds with your catalog.


Customize

Replace the sample products

Edit the PRODUCTS list in server.py. Each product needs: sku, name, price, description, availability, category, image_url.

For real inventory, replace the list with a database call:

python
# server.py — swap PRODUCTS for a live queryimport psycopg2  # or SQLAlchemy, Supabase, etc.
def get_products():    # your DB query here    return [...]
PRODUCTS = get_products()

Add Stripe checkout

Replace the stub in initiate_checkout with a real Stripe session:

python
import stripestripe.api_key = os.getenv("STRIPE_SECRET_KEY")
session = stripe.checkout.Session.create(    line_items=[{"price": price_id, "quantity": quantity}],    mode="payment",    success_url="https://yourstore.com/success",    cancel_url="https://yourstore.com/cancel",)return {"success": True, "checkout_url": session.url, ...}

The 5 errors you'll hit (and how to fix them)

Covered in the full guide: 30daypivot.com/agentmall_spoke_mcp

  1. MCP error -32600 — initialization order violation
  2. 422 Unprocessable Entity — Pydantic model vs plain args mismatch
  3. 405 Method Not Allowed — missing DELETE in CORS allowed methods
  4. stateless_http not set — serverless Vercel requires stateless_http=True
  5. ModuleNotFoundError: mcp — wrong package name (mcp[cli], not fastmcp)

Project structure

mcp-commerce-starter/├── server.py          # FastMCP app — resource, tools, middleware, FastAPI mount├── requirements.txt   # Pinned dependencies├── vercel.json        # Vercel deployment config├── mcp.json           # MCP server manifest├── .env.example       # Environment variable template└── README.md

Go deeper

This starter is the code companion to the AgentMall spoke series on 30DayPivot:


License

MIT

來源:README.md,提交 d9ec6db

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 75%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。