heldiapriadi/example-mcp-server-n8n-retail
If you are the rightful owner of example-mcp-server-n8n-retail and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a Model Context Protocol (MCP) server implementation for a shopping assistant.
n8n Shopping Assistant MCP Server
This is a Model Context Protocol (MCP) server implementation for a shopping assistant. It provides tools and prompts that can be used by MCP clients like Claude to interact with a shopping system.
Features
Search Tools
search_products
– Search for products by keywordslist_categories
– Lists all product categories availablelist_recommendations
– Returns AI-generated product recommendations
Read Tools
get_product_detail
– Get detailed information for a single productget_cart_contents
– Return current user's cartget_chat_history
– Return previous messages from a user session
Write Tools
create_cart
– Start a new cart for a user sessionadd_to_cart
– Add product(s) to the cartupdate_cart_item
– Change quantity of an item in the cartcreate_order
– Finalize checkout and create an ordersave_user_message
– Log user message to chat history
Prompts
- Product Recommendation: Suggest related or complementary items for a given user input or product
- Cart Summary: Summarize what's in the user's cart in natural language
- Order Confirmation: Generate confirmation summary with total price, delivery info, etc.
Getting Started
Prerequisites
- Node.js 18 or higher
- npm or yarn
Installation
- Clone the repository
git clone https://github.com/yourusername/n8n-mcp-server.git
cd n8n-mcp-server
- Install dependencies
npm install
- Build the project
npm run build
- Start the server
npm start
The server will start on port 3000 by default. You can change the port by setting the PORT
environment variable.
Endpoints
- Modern MCP Endpoint (StreamableHTTP):
http://localhost:3000/mcp
- Legacy MCP Endpoint (SSE):
http://localhost:3000/sse
- Health Check:
http://localhost:3000/health
Using with Claude
To use this MCP server with Claude, you can connect it via the Claude Desktop app or via the Claude API using the MCP TypeScript SDK client.
Connecting via Claude Desktop
- Start the server
- In Claude Desktop, go to Settings > Model Context Protocol
- Add a new server with the URL
http://localhost:3000/mcp
Example Usage with Claude
I'd like to search for some snacks. Can you show me what's available?
[Claude will use the search_products tool to look for snacks]
I'd like to add some Oreo cookies to my cart.
[Claude will use the create_cart and add_to_cart tools]
Can you show me what's in my cart?
[Claude will use the get_cart_contents tool and the cart-summary prompt]
I'd like to checkout now.
[Claude will use the create_order tool and the order-confirmation prompt]
Development
To run the server in development mode with automatic restarts:
npm run dev
Project Structure
src/index.ts
- Main server implementationsrc/models.ts
- Data models and functions