This project implements a Model Context Protocol (MCP) server that interacts with Spurtcommerce.
The protocol supports various tools to interact with Spurtcommerce APIs for product search and category browsing.
At the moment, the following APIs are supported:
- Product API
- Store API
- Categories API
To run the Spurtcommerce MCP server using npx
, use the following command:
npx -y @spurtcommerce/mcp@latest
If you are working on the MCP server locally, you can run it by setting the MCP_SERVER_PATH
environment variable to the absolute path of your built server file:
export MCP_SERVER_PATH="/absolute/path/to/build/index.js"
If MCP_SERVER_PATH
is not set or is empty, the client will fall back to:
npx @spurtcommerce/mcp@latest
Add the following configuration to your settings.json
.
For more information, read the Cursor MCP documentation or the Claude Desktop MCP guide.
{
"mcpServers": {
"spurtcommerce-mcp": {
"command": "npx",
"args": ["-y", "@spurtcommerce/mcp@latest"],
"env": {
"SPURTCOMMERCE_API_URL": "https://your_backend/api",
"SPURTCOMMERECE_API_KEY": "your_api_key_here"
}
}
}
}
On Windows, you may need this alternative setup:
{
"mcpServers": {
"spurtcommerce-mcp": {
"command": "cmd",
"args": ["/k", "npx", "-y", "@spurtcommerce/mcp@latest"],
"env": {
"SPURTCOMMERCE_API_URL": "https://your_backend/api",
"SPURTCOMMERECE_API_KEY": "your_api_key_here"
}
}
}
}
Variable | Description |
---|---|
SPURTCOMMERCE_API_URL |
Base API URL for your Spurtcommerce backend |
SPURTCOMMERECE_API_KEY |
API key for authenticating requests |
MCP_SERVER_PATH |
(Optional) Absolute path to the built MCP server file for local development |
This MCP server provides the following tools:
Tool Name | Description |
---|---|
get_product_by_sku |
Retrieve detailed product information using SKU |
get_all_category |
Fetch all available product categories |
search_products |
Search products by keyword or filters |
get_product_by_sku
→ Use when you know the SKU and want full product details.get_all_category
→ Use when you need a list of categories for navigation or filtering.search_products
→ Use when searching products by name, category, or other filters.
Prompt Name | Description |
---|---|
spurtcommerce_product_search |
Helps you search products and fetch relevant product details using available tools |
This repository contains three main parts:
project-root/
│
├── agent/ # Main backend service (Node.js/Express)
└── servers/
└── spurtcommerce/ # MCP server (@spurtcommerce/mcp)
Backend (agent):
cd agent
npm install
MCP Server:
cd servers/spurtcommerce
npm install
Agent (agent/.env
):
ANTHROPIC_API_KEY=your_api_key
SOCKET_PORT=3001
# Optional: Directly point to built MCP server
MCP_SERVER_PATH=servers/spurtcommerce/dist/index.js
The MCP server is built with the MCP SDK and communicates with the Spurtcommerce API.
Build:
npm run build
Run locally:
node $(pwd)/dist/index.js
Start agent backend:
cd agent
npm start