example-mcp-server-n8n-retail

heldiapriadi/example-mcp-server-n8n-retail

3.1

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.

Tools
11
Resources
0
Prompts
0

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 keywords
  • list_categories – Lists all product categories available
  • list_recommendations – Returns AI-generated product recommendations

Read Tools

  • get_product_detail – Get detailed information for a single product
  • get_cart_contents – Return current user's cart
  • get_chat_history – Return previous messages from a user session

Write Tools

  • create_cart – Start a new cart for a user session
  • add_to_cart – Add product(s) to the cart
  • update_cart_item – Change quantity of an item in the cart
  • create_order – Finalize checkout and create an order
  • save_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

  1. Clone the repository
git clone https://github.com/yourusername/n8n-mcp-server.git
cd n8n-mcp-server
  1. Install dependencies
npm install
  1. Build the project
npm run build
  1. 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

  1. Start the server
  2. In Claude Desktop, go to Settings > Model Context Protocol
  3. 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 implementation
  • src/models.ts - Data models and functions