Commerce MCP Server

Commerce MCP Server

Enables AI agents to browse product catalogs, search products with filters, and initiate checkouts, generating order summaries and checkout URLs.

Category
Visit Server

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 authX-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)

git clone https://github.com/NewPlanetWW/mcp-commerce-starter
cd mcp-commerce-starter

python -m venv .venv && source .venv/bin/activate
pip 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:

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.

npm i -g vercel
vercel login
vercel --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):

Variable Default Notes
API_KEY dev-secret-key Change before going live
REQUIRE_AUTH false Set 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):

{
  "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:

{
  "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:

# server.py — swap PRODUCTS for a live query
import 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:

import stripe
stripe.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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured