Skip to content

MCP (Model Context Protocol) server for SpurtCommerce - enables AI agents to interact with SpurtCommerce via Product, Store, and Category APIs for search and browsing.

Notifications You must be signed in to change notification settings

spurtcommerce/MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spurtcommerce MCP Server

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

Setup

Run from npm package (recommended for production)

To run the Spurtcommerce MCP server using npx, use the following command:

npx -y @spurtcommerce/mcp@latest

Run from local build (for development)

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

Usage with Cursor or Claude Desktop

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"
      }
    }
  }
}

Windows Configuration

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"
      }
    }
  }
}

Environment Variables

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

Available Tools

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

Tool Usage Guidelines

  • 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.

Available Prompts

Prompt Name Description
spurtcommerce_product_search Helps you search products and fetch relevant product details using available tools

Development

@spurtcommerce/mcp – Monorepo Setup

This repository contains three main parts:

project-root/
│
├── agent/                     # Main backend service (Node.js/Express)
└── servers/
    └── spurtcommerce/         # MCP server (@spurtcommerce/mcp)

1. Install Dependencies

Backend (agent):

cd agent
npm install

MCP Server:

cd servers/spurtcommerce
npm install

2. Environment Variables

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

3. Development

MCP Server (servers/spurtcommerce)

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

4. Running the Project

Start agent backend:

cd agent
npm start

About

MCP (Model Context Protocol) server for SpurtCommerce - enables AI agents to interact with SpurtCommerce via Product, Store, and Category APIs for search and browsing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published