Development

MCP vs REST APIs for Ecommerce: When to Use Each

By Michael E.Updated Sources checked 13 min

Short answer

MCP (Model Context Protocol) does not replace an ecommerce REST API. A REST API serves programs written by developers who read your docs; an MCP server describes tools so AI clients can discover and call them at runtime. In most stores the MCP tool is a thin layer over the same service your REST endpoint uses, and many integrations need only REST.

Key takeaways

  • MCP typically wraps existing APIs or services; your data and business logic stay where they are.
  • REST is enough when a known developer integrates with you, as with most feeds, ERPs, and platform checkout APIs.
  • MCP earns its overhead when AI clients you don't control need to discover and choose tools on their own.
  • Use stdio for local, single-user tools and Streamable HTTP for shared remote servers.
  • In revision 2026-07-28, Streamable HTTP has no protocol sessions: each message is its own POST to one endpoint.
  • Platform choices matter: Google describes REST as the default transport for UCP Native Checkout, while Shopify serves MCP endpoints natively.

Does MCP replace our existing APIs?

No. MCP is a protocol for exposing tools to AI clients, and in an ecommerce stack those tools usually call the APIs and services you already run. The MCP tools spec itself describes tools as letting models interact with external systems "such as querying databases, calling APIs, or performing computations."

REST API
An HTTP interface organized around resources and verbs (for example GET /v1/products/search), documented for developers who write client code against it.
MCP (Model Context Protocol)
An open JSON-RPC 2.0 protocol in which servers publish tool definitions (name, description, input and output schemas) that AI clients list and call at runtime.
MCP tool
One callable operation on an MCP server, described by a JSON Schema so a model can decide when and how to use it.
Streamable HTTP
MCP's standard remote transport: every client message is an HTTP POST to a single MCP endpoint.

Think of the difference as who reads the contract. A REST API's reader is a developer, at build time. An MCP server's reader is a model, at run time, which is why tool descriptions and schemas carry so much weight. For the broader picture of MCP in commerce, see the ecommerce MCP server guide.

What does the same catalog workflow look like in REST and MCP?

The workflow: a shopper asks for products matching keywords and a budget, and gets back SKU, title, price, stock, and URL. Both versions call one shared service function, so the comparison isolates the interface.

Shared service used by both interfaces (illustrative; db is a placeholder).
// catalog-service.ts — shared business logic (illustrative, synthetic data model).
// Both the REST endpoint and the MCP tool call this. Neither owns the data.

export interface ProductHit {
  sku: string;
  title: string;
  price_cents: number;
  currency: "USD";
  in_stock: boolean;
  url: string;
}

export async function searchCatalog(q: string, opts: { maxPriceCents?: number; limit: number }) {
  const rows = await db.products.search({ text: q, maxPrice: opts.maxPriceCents, limit: opts.limit });
  return rows.map((r): ProductHit => ({
    sku: r.sku,
    title: r.title,
    price_cents: r.priceCents,
    currency: "USD",
    in_stock: r.available > 0,
    url: "https://shop.example/products/" + r.handle,
  }));
}

As a REST endpoint

Illustrative REST endpoint. Not run.
// rest.ts — a conventional REST endpoint (illustrative, Hono-style router).
import { Hono } from "hono";
import { searchCatalog } from "./catalog-service";

const app = new Hono();

// GET /v1/products/search?q=trail+shoes&max_price_cents=15000&limit=10
app.get("/v1/products/search", async (c) => {
  const q = c.req.query("q");
  if (!q || q.length > 200) return c.json({ error: "q is required (max 200 chars)" }, 400);

  const limit = Math.min(Number(c.req.query("limit") ?? 10), 50);
  const max = c.req.query("max_price_cents");
  const hits = await searchCatalog(q, { limit, maxPriceCents: max ? Number(max) : undefined });

  c.header("Cache-Control", "public, max-age=60");
  return c.json({ data: hits, count: hits.length });
});

export default app;

As an MCP tool

Illustrative MCP tool definition as returned in tools/list (fields per the MCP 2026-07-28 Tools spec).
{
  "name": "search_products",
  "title": "Search products",
  "description": "Search the store catalog by keywords. Returns up to 'limit' products with price in cents (USD), stock status, and product URL. Use max_price_cents when the shopper states a budget. Read-only.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "q": { "type": "string", "maxLength": 200, "description": "Shopper's keywords, e.g. 'waterproof trail shoes'" },
      "max_price_cents": { "type": "integer", "minimum": 0, "description": "Optional budget ceiling in cents" },
      "limit": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
    },
    "required": ["q"],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "properties": {
      "products": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "sku": { "type": "string" },
            "title": { "type": "string" },
            "price_cents": { "type": "integer" },
            "currency": { "type": "string" },
            "in_stock": { "type": "boolean" },
            "url": { "type": "string" }
          },
          "required": ["sku", "title", "price_cents", "currency", "in_stock", "url"]
        }
      }
    },
    "required": ["products"]
  }
}
Illustrative MCP tool handler calling the same service. Register it with whichever MCP SDK you use.
// mcp-handler.ts — the same workflow as an MCP tool handler (illustrative, SDK-agnostic).
import { searchCatalog } from "./catalog-service";

export async function handleSearchProducts(args: { q: string; max_price_cents?: number; limit?: number }) {
  const products = await searchCatalog(args.q, {
    limit: Math.min(args.limit ?? 10, 50),
    maxPriceCents: args.max_price_cents,
  });

  if (products.length === 0) {
    // A tool execution error the model can act on (isError: true), not a protocol error.
    return {
      isError: true,
      content: [{ type: "text", text: "No products matched. Try fewer or broader keywords." }],
    };
  }

  return {
    structuredContent: { products },
    // The spec suggests also returning serialized JSON as text for backwards compatibility.
    content: [{ type: "text", text: JSON.stringify({ products }) }],
  };
}
Illustrative tools/call over Streamable HTTP, with the headers the 2026-07-28 transport requires.
POST /mcp HTTP/1.1
Host: mcp.shop.example
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: search_products

{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "search_products",
    "arguments": { "q": "waterproof trail shoes", "max_price_cents": 15000 },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": { "name": "ExampleClient", "version": "1.0.0" },
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}
What changed between the two versions
ConcernREST endpointMCP tool
Contract readerDeveloper, via docsModel, via description and inputSchema
DiscoveryDocs, OpenAPI filetools/list at runtime
ValidationYour codeJSON Schema in the tool plus your code; servers MUST validate inputs
ErrorsHTTP status codesJSON-RPC errors for protocol problems; isError: true results for recoverable tool failures
CachingHTTP caching (Cache-Control, CDNs)POST-only transport; cache inside your service. tools/list results can carry cache hints
AuthYour existing schemeOAuth 2.1 resource-server model for HTTP servers that support authorization
Business logicShared serviceSame shared service

When is a plain REST integration enough?

Whenever the consumer is a specific system built by someone who can read your docs. That covers most commerce integrations: product feeds, ERP and PIM sync, inventory webhooks, payment providers, and many AI-platform checkout specs.

Decision guide (our assessment)
SituationUseWhy
Sending products to an AI shopping surface's feedFeed or REST per that platform's specThe platform defines the contract; see the ChatGPT product feed spec
ERP, PIM, or warehouse syncREST, webhooks, or filesFixed partners, batch or event flows
Google UCP Native CheckoutREST by defaultGoogle's UCP FAQ calls REST the default; MCP transport is early access with onboarding conditions
Your own chat assistant calling a few known endpointsREST or function callingYou control both sides
Third-party AI clients (desktop assistants, agents) acting for staff or shoppersMCPRuntime discovery across clients you don't build
Shopify store needing catalog and cart toolsShopify's native MCP endpoints firstShopify already serves them; see the Storefront MCP migration
WooCommerce admin tasks from an AI clientWooCommerce MCP via the MCP AdapterNative, in developer preview; see the WooCommerce MCP guide

Who owns the data when we add an MCP server?

You still do, in the same systems as before. An MCP server is an access layer: it reads from and writes to your commerce platform, PIM, or ERP, and it should hold no product truth of its own beyond caches and short-lived handles such as cart IDs.

  • Source of truth stays put. Prices, stock, and policies come from the same systems your storefront uses, so the agent and the website don't disagree.
  • Outputs leave your control. Whatever a tool returns enters an AI client's context and possibly its logs. Return only fields the tool needs, especially for customer data.
  • Platform-hosted servers are the platform's. When Shopify or WooCommerce serves the MCP endpoint, its tool contracts and versions change on the platform's schedule, not yours.
  • Handles need binding. The 2026-07-28 spec has no protocol sessions, so state like a cart lives behind an explicit ID that you must bind to the caller. See MCP authentication for ecommerce.

What overhead and capabilities does MCP add over REST?

MCP adds a protocol layer, schema-first tool design, and an authorization model you must implement correctly. In return you get runtime discovery, model-readable contracts, and structured results that any MCP client can use.

MCP addsCostBenefit
JSON-RPC envelope and required metadata headersSmall per-call overhead; more to testGateways can route on Mcp-Method and Mcp-Name without parsing bodies
Tool descriptions and schemasWriting and maintaining model-facing docsModels choose and fill tools correctly more often
structuredContent with outputSchemaSchema upkeepTyped results clients can validate
Tool execution errors (isError)Designing helpful messagesModels can self-correct and retry
Elicitation via input-required resultsMore complex flowsA tool can ask the user for missing input mid-call
OAuth 2.1 resource-server dutiesReal security engineeringStandard way for many clients to get scoped access

Token cost is the hidden overhead. Every tool definition a client loads takes model context, so twenty overlapping tools are worse than five sharp ones. The spec also asks servers to return tools in a deterministic order, which helps clients cache tool lists.

Should an ecommerce MCP server use stdio or Streamable HTTP?

Use stdio for a tool that runs on one person's machine and Streamable HTTP for anything shared, remote, or customer-facing. They're the two standard transports in revision 2026-07-28, and protocol semantics are the same on both.

Transport comparison (MCP 2026-07-28)
stdioStreamable HTTP
How it runsClient launches the server as a subprocess; newline-delimited JSON-RPC over stdin/stdoutIndependent server; each message is an HTTP POST to one MCP endpoint
ResponsesOver stdoutA single JSON object or a request-scoped SSE stream
CredentialsFrom the environment; the spec says stdio should not use the OAuth flowOAuth 2.1 per the authorization spec, if you support authorization
SessionsProcess lifetimeNone at protocol level; Mcp-Session-Id and the GET stream were removed in 2026-07-28
Required headersNoneMCP-Protocol-Version, Mcp-Method, and Mcp-Name for tool calls
Security mustsSandboxing and consent on the client sideValidate Origin (403 if invalid); bind to 127.0.0.1 when local
Ecommerce fitStaff catalog tools, local data scriptsShopper-facing tools, multi-user staff tools, platform integrations

Because 2026-07-28 Streamable HTTP is stateless at the protocol level, it fits ordinary load-balanced HTTP infrastructure well. Older clients may still speak 2025-11-25 sessions; the spec describes how servers detect and handle that traffic, for example answering GET or DELETE with 405 when they support only the new revision.

How should MCP and REST fit together in an ecommerce architecture?

Put business logic in services, expose REST for systems, and add a thin MCP layer for AI clients only where it pays off. Both interfaces share validation, authorization rules, and logging.

  1. Keep one service layer per capability (catalog, inventory, pricing, orders).
  2. Expose REST or webhooks for known integrations and your own frontends.
  3. Add MCP tools that map to shopper or staff intents ("find products under a budget"), not one tool per REST route.
  4. Enforce authorization in the service layer so neither interface can bypass it.
  5. Version both: pin the MCP protocol revision you implement and record it with test results.

If you're building the server yourself, the TypeScript MCP server tutorial walks through a read-only catalog server. If you want us to assess whether you need one at all, that's the first step of our MCP server development work.

Frequently asked questions

Is MCP just a REST API with a different name?

No. MCP uses JSON-RPC 2.0 messages and a discovery method (tools/list) so AI clients can find and call tools at runtime. A REST API is resource-oriented and documented for developers. An MCP server often calls a REST API internally.

Can we generate MCP tools automatically from our OpenAPI spec?

You can, but one tool per endpoint usually produces too many overlapping tools with developer-oriented descriptions. Hand-designed tools that match shopper or staff intents tend to be easier for models to use correctly.

Do AI shopping platforms require MCP?

It varies by platform and changes often. Google's UCP FAQ describes REST as the default for Native Checkout with MCP in early access, OpenAI documents its own product feed submission process, and Shopify serves MCP endpoints itself. Check each platform's current docs.

Is MCP slower than REST?

The protocol overhead per call is small: a JSON-RPC envelope and a few headers. The bigger costs are model context spent on tool definitions and extra reasoning steps, which depend on tool design more than transport.

Can MCP responses be cached like REST GETs?

Not with ordinary HTTP caching, because Streamable HTTP uses POST. Cache inside your service layer instead. The 2026-07-28 spec does let tools/list results carry caching hints.

Does stdio work for a customer-facing shopping assistant?

Not usually. Stdio runs the server as a local subprocess of one client. Customer-facing tools need a remote Streamable HTTP server with proper authorization.

If we build an MCP server, will AI assistants recommend our products?

Not by itself. An MCP server proves that a connected client can call your tools. Recommendation and platform eligibility are separate layers decided by each AI platform.

Not sure you need an MCP server?

Tell us which AI clients you want to support, what your platform already exposes, and where your catalog data lives. We'll tell you whether REST, native platform tools, or a custom MCP layer fits.

Sources

  1. MCP specification: Transports overview (2026-07-28)
  2. MCP specification: Streamable HTTP (2026-07-28)
  3. MCP specification: Tools (2026-07-28)
  4. MCP specification: Authorization (2026-07-28)
  5. Google: UCP FAQ
  6. Shopify: Storefront Catalog MCP

Platform capabilities, eligibility, and specifications change. Sources were checked on 2026-11-29; confirm the current primary documentation before scoping an implementation. See our editorial policy and methodology.