FakeStore

E-commerce demo showcasing Model Context Protocol (MCP) with Next.js and FakeStore API
  • typescript

0

GitHub Stars

typescript

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can use the FakeStore MCP Server to interact with a shopping cart and product catalog through the Model Context Protocol. This MCP server exposes standardized tools that let you authenticate, browse products, and manage a cart via remote HTTP endpoints, while keeping client logic decoupled from API specifics.

How to use

You interact with the MCP server through an MCP client that discovers and calls the server’s tools. Start by authenticating when required, then browse products by category, and use cart operations to add or remove items. All actions are reflected in the UI with instant feedback while background synchronization keeps data consistent with the remote API.

Key capabilities you can leverage include user authentication, product catalog browsing with category filtering, and comprehensive cart operations such as add_to_cart, remove_from_cart, get_cart, and clear_cart. The system supports optimistic UI updates so you get immediate feedback, and sessions are managed at the MCP layer. If you refresh the page, sessions and cart state may reset to API values; a full logout/login cycle without refreshing will try to persist the cart session.

How to install

Prerequisites you need before running locally:

• Node.js 18+ installed on your machine.

• npm or yarn to manage packages.

# Install dependencies
npm install

# Start development server
npm run dev

Notes

The MCP server exposes key endpoints for authentication, product retrieval, and cart management. Use the HTTP-based MCP endpoint to perform all operations from your MCP client.

Development runs at http://localhost:3000 during local testing. The live MCP endpoint used by the client is https://fakestore-mcp.vercel.app/api/mcp. This endpoint handles all cart and product interactions through the MCP server.

Security and troubleshooting

  • Ensure you have a valid authentication flow when required by actions that modify user data (e.g., adding to cart). If you encounter login prompts, supply demo credentials or your own test credentials.

  • If a full page hard refresh occurs, session and cart state may reset to API values. A logout then login without refreshing may preserve cart session depending on your client behavior.

Available tools

login

Authenticate a user session to enable actions that require permissions.

logout

Terminate the current user session and clear related state.

get_products

Retrieve product catalog with optional category filtering and sorting.

get_categories

List available product categories for filtering.

add_to_cart

Add a specified product to the current user’s cart.

remove_from_cart

Remove a specified product from the current user’s cart.

get_cart

View detailed contents of the user’s shopping cart.

clear_cart

Empty the current user’s shopping cart.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational