Commerce MCP App

Commerce MCP App

Enables product discovery, session-scoped carts, and confirmation-gated checkout through natural language, with deterministic routing and safety features.

Category
Visit Server

README

Commerce MCP App

A cross-platform MCP App for product discovery, session-scoped carts, and confirmation-gated checkout.

Tool contract

  • search_products — the only model-facing product discovery tool. Handles browsing, natural-language queries, categories, price constraints, attributes, ranking, and pagination.
  • list_products — app-only unfiltered catalog loader; hidden from the model to prevent routing ambiguity.
  • add_to_cart — adds an exact product ID to the current session cart.
  • remove_from_cart — removes an exact product ID from the current session cart.
  • view_cart — returns the current session cart.
  • checkout_cart — previews checkout unless confirmed=true; accepts an idempotency key for safe retries.

The React UI is served at ui://products/index.html. Every UI-backed tool also returns text content for hosts without MCP Apps support.

Product accuracy pipeline

search_products does not send a conversational sentence to the upstream literal search endpoint. It:

  1. Normalizes common product synonyms and categories.
  2. Extracts price bounds and ranking intent from ordinary shopping language.
  3. Retrieves the full catalog through the resilient API client.
  4. Applies deterministic constraints.
  5. Ranks matching candidates by title, category, description, tags, rating, or requested price order.
  6. Returns the normalized intent in structuredContent for debugging and evaluation.

This local retrieval pipeline is appropriate for the small DummyJSON catalog. For a large production catalog, replace candidate retrieval with a search index while retaining the same intent and ranking contract.

Reliability and safety

  • Retry with exponential backoff for network, 429, and 5xx failures.
  • Request timeout, ETag revalidation, LRU caching, and stale-cache fallback.
  • Zod validation at the upstream catalog boundary.
  • Optional bearer-token authentication with explicit 401 responses.
  • Cart isolation by MCP transport session; stdio processes are naturally one client per process.
  • Cumulative per-product quantity limits.
  • Explicit confirmation and idempotent replay for checkout.
  • MCP annotations describing read-only, destructive, and idempotent behavior.

The sample checkout produces a local receipt. A real deployment must replace it with transactional inventory, order, and payment services.

Commands

npm install
npm run check
npm test
npm run build
npx -y @mcpjam/inspector@latest

Paid model-routing evals are intentionally separate:

npm run eval

Configuration

  • PRODUCTS_API_ENDPOINT — defaults to https://dummyjson.com/products
  • PRODUCTS_API_BEARER_TOKEN — optional
  • PRODUCTS_API_TIMEOUT_MS — defaults to 8000
  • PRODUCTS_API_MAX_RETRIES — defaults to 3
  • PRODUCTS_API_BASE_BACKOFF_MS — defaults to 300
  • PRODUCTS_API_MAX_BACKOFF_MS — defaults to 3000
  • PRODUCTS_API_CACHE_TTL_MS — defaults to 30000
  • PRODUCTS_API_CACHE_MAX_ENTRIES — defaults to 100

Evaluation strategy

npm test is deterministic and covers API resilience, response validation, query parsing, ranking, cart isolation, quantity constraints, and UI behavior. npm run eval measures model tool selection and argument extraction without a routing answer sheet. Product-result correctness is covered by deterministic golden-set tests so provider outages or exhausted credits cannot masquerade as zero product accuracy.

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