PrestaShop MCP Analytics
Provides read-only PrestaShop sales analytics via the PrestaShop Webservice, including product sales statistics, product search by name, top-selling products by quantity or revenue, date-range filtering, and order-state filtering.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PrestaShop MCP Analytics
MCP server for read-only PrestaShop sales analytics via LLM interfaces.
๐ฏ Features
๐ Product Sales Statistics - Detailed sales breakdown by product
๐ Product Search by Name - Find products using natural language search (NEW in v1.3)
๐ Top Selling Products - Best-sellers by quantity or revenue
๐ Flexible Date Ranges - Query any period (up to 2 years)
๐จ Multiple Output Formats - JSON for APIs, Markdown for humans
๐ Secure & Read-Only - No write operations, environment-based auth
โก Efficient Pagination - Handles large datasets with automatic pagination
๐ฏ Order State Filtering - Filter by order status for accurate reporting
Related MCP server: MCP GraphQL Sales Server
๐ Prerequisites
Node.js 18+
PrestaShop 1.7.x or 8.x with Webservice enabled
API Key with read permissions on
orders,order_details,products
๐ Installation
1. Install from npm
npm install @dfr_contact/prestashop-mcp-analyticsOr clone and install for development:
git clone <repository-url>
cd prestashop-mcp-analytics
npm install2. Configure Environment
cp .env.example .env
# Edit .env with your PrestaShop credentialsRequired variables:
PRESTASHOP_BASE_URL=https://your-prestashop-store.com
PRESTASHOP_WS_KEY=YOUR_32_CHARACTER_WEBSERVICE_KEY3. Build
npm run build4. Run
npm start๐ง PrestaShop Setup
Go to Advanced Parameters > Webservice
Enable webservice
Create a new API key:
Click "Add new webservice key"
Generate a 32-character key
Enable the key (status: Yes)
Grant GET permissions on:
ordersorder_detailsproducts
Save
๐ ๏ธ Usage
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"prestashop-analytics": {
"command": "npx",
"args": ["-y", "@dfr_contact/prestashop-mcp-analytics"],
"env": {
"PRESTASHOP_BASE_URL": "https://your-store.com",
"PRESTASHOP_WS_KEY": "your_32_character_key_here"
}
}
}
}Or if installed globally:
{
"mcpServers": {
"prestashop-analytics": {
"command": "node",
"args": ["/absolute/path/to/node_modules/@dfr_contact/prestashop-mcp-analytics/dist/index.js"],
"env": {
"PRESTASHOP_BASE_URL": "https://your-store.com",
"PRESTASHOP_WS_KEY": "your_32_character_key_here"
}
}
}
}Example Queries
Get product sales statistics (by ID or name):
"How many units of product ID 42 were sold in September 2024?"
"Show me revenue for product #15 this quarter"
"What are the sales for 'DJI O4 Air Unit' last month?"
"Get stats for 'Condensateur Panasonic' this week"Get top products:
"What are my top 5 products this month?"
"Show me top 10 products by revenue in Q4 2024"๐ Product Search by Name (NEW in v1.3)
You can now search for products using their name instead of ID:
Direct product name:
{
"product_name": "DJI O4 Air Unit",
"date_from": "2025-01-01",
"date_to": "2025-01-31"
}Partial match (case-insensitive):
{
"product_name": "motor",
"date_from": "2025-01-01",
"date_to": "2025-01-31"
}Features:
โ Case-insensitive partial matching
โ Multi-language support (searches in all languages)
โ Fast performance (~200-350ms for 500 products)
โ Smart handling:
0 results โ helpful error message
1 result โ automatic selection
Multiple results โ interactive list to choose from
Example conversation:
User: "Show me sales for Condensateur Panasonic last week"
Assistant: Found 2 products:
1. Condensateur Panasonic Low ESR 680uF 35V (ID: 2557)
2. Condensateur Panasonic Low ESR 1000uF 35V (ID: 3249)
Please specify which product you want by using the product_id.๐ฏ Order State Filtering (NEW in v1.1)
Both tools support filtering by PrestaShop order states for precise reporting:
Match PrestaShop backoffice statistics:
{
"product_id": 42,
"date_from": "2025-01-01",
"date_to": "2025-01-31",
"order_states": [4, 5]
}Common PrestaShop States:
1- Awaiting check payment2- Payment accepted3- Processing in progress4- Shipped5- Delivered6- Canceled7- Refunded8- Payment error
Recommended filters:
Backoffice parity:
[4, 5](Shipped + Delivered only)All valid orders:
[2, 3, 4, 5](Payment accepted through Delivered)All states: Omit parameter (default behavior)
๐ก Tip: PrestaShop backoffice typically excludes Processing (3) and Refunded (7) states from statistics. Use
order_states: [4, 5]to match exactly.
๐งช Development
Commands
npm run build # Compile TypeScript
npm run dev # Watch mode with auto-rebuild
npm test # Run tests
npm run test:watch # Tests in watch mode
npm run test:coverage # Generate coverage report
npm run lint # Check code quality
npm run lint:fix # Auto-fix linting issues
npm run format # Check code formatting
npm run format:fix # Auto-format codeProject Structure
src/
โโโ index.ts # Entry point + MCP server setup
โโโ config.ts # Configuration & environment
โโโ types.ts # TypeScript interfaces
โโโ constants.ts # Global constants
โโโ schemas/ # Zod validation schemas
โ โโโ common.schema.ts
โ โโโ product-sales-stats.schema.ts
โ โโโ top-products.schema.ts
โโโ services/ # Business logic
โ โโโ prestashop-api.service.ts
โ โโโ orders.service.ts
โโโ formatters/ # Output formatting
โ โโโ json.formatter.ts
โ โโโ markdown.formatter.ts
โโโ tools/ # MCP tool handlers
โ โโโ get-product-sales-stats.tool.ts
โ โโโ get-top-products.tool.ts
โโโ utils/ # Utilities
โโโ date.utils.ts
โโโ error.utils.ts
โโโ validation.utils.ts
โโโ truncation.utils.ts๐ Documentation
CLAUDE.md - Complete project architecture and specifications
IMPLEMENTATION_PLAN.md - Day-by-day implementation guide
๐ Security
โ Read-only operations only (GET requests)
โ Environment-based authentication
โ Strict input validation with Zod
โ Request timeouts (30s)
โ Response size limiting (25,000 chars)
โ No secrets in logs
โ ๏ธ Limitations
Date range: Max 730 days (2 years) per query
Products limit: 1-100 products per request
Response size: Truncated at 25,000 characters
Orders: Max 1,000 orders processed per query
Operations: Read-only, no write support
๐ค Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ License
MIT License - see LICENSE file for details
๐ Support
For issues and questions:
Check CLAUDE.md troubleshooting section
Open an issue on GitHub
๐ Acknowledgments
Built with:
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only access to a company's ERP for Claude, ChatGPT and Gemini, with OAuth and an audit trail.
Sales analytics, ML forecasting, customer segmentation, and trend analysis.
Read-only Amazon seller analytics: sales, Buy Box, FBA inventory, alerts, revenue and fees.
MerchantFlow is a hosted, read-only ecommerce analytics MCP server for Shopify and WooCommerce. It gives AI assistants tenant-scoped access to revenue, profit and loss, product and SKU profitability, COGS coverage, fulfillment costs, advertising spend, ROAS, marketing performance, cohorts, LTV, and business valuation across connected commerce and marketing platforms. Connect with OAuth over Streamable HTTP. No local server installation is required.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI-powered tools for querying customer and order analytics, enabling order counting, customer listing by country, and spend calculation.-
- FlicenseAqualityDmaintenanceProvides AI assistants with access to sales data from a Northwind-style database through GraphQL queries, enabling natural language requests for orders, customers, products, and analytics.101-
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to a sales database, letting LLMs answer analytics questions like revenue by region or top customers via MCP tools.-
- FlicenseNot gradedqualityDmaintenanceEnables querying sales data, identifying out-of-stock products, viewing top sellers, and receiving restock suggestions through natural language.-