Sales Analyzer MCP

Sales Analyzer MCP

Sales anomaly detection for a sample café dataset. Enables analyzing weekly sales, product history, and detecting anomalies like closures or pricing glitches.

Category
Visit Server

README

Sales Analyzer MCP Server

A remote MCP server that exposes sales anomaly detection as tools Claude can call. It bundles a deterministic sample dataset — one year of daily sales for a fictional café, "Bean & Leaf" — and analyzes it with robust statistics (median absolute deviation), so anomalies like closures, pricing glitches, and structural product declines are detected in code, not guessed by the model.

The server returns only computed data: no LLM calls, no API keys, fully stateless. Built with the official MCP Python SDK (FastMCP) over the Streamable HTTP transport.

Tools

Tool What it returns
list_weeks() The 53 weeks in the dataset with date ranges, row counts, and completeness
analyze_week(week_number) Weekly revenue, totals by product, week-over-week changes, top movers, daily series, and flagged anomalies with severity and reason
get_product_history(product_name) A product's full weekly units/revenue series

Bad inputs (week 99, unknown product) return a clear {"error": ...} message instead of failing.

Project layout

  • server.py — FastMCP server: transport, health check, and the three tools
  • analytics.py — stdlib-only analytics: weekly aggregation + MAD-based anomaly detection
  • generate_sample_data.py — seeded generator for the sample dataset (byte-identical every run)
  • data/sales_2025.csv — the bundled dataset (regenerated at startup if missing)
  • test_client.py — smoke test that exercises every tool against a running server

Run locally

pip install -r requirements.txt
python server.py

The server listens on port 8000 (override with the PORT env var):

  • Landing page / health check: GET http://localhost:8000/ → an HTML page (HTTP 200)
  • MCP endpoint: http://localhost:8000/mcp

Verify all tools in a second terminal:

python test_client.py

Deploy to Render (free tier)

  1. Push this repo to GitHub.

  2. In the Render dashboard, click New + → Blueprint and select the repo — render.yaml configures everything (Python web service, free plan, python server.py start command).

    • Or manually: New + → Web Service, build command pip install -r requirements.txt, start command python server.py.
  3. Wait for the deploy to go live. Your MCP endpoint is:

    https://<your-service>.onrender.com/mcp
    
  4. Sanity-check it: opening https://<your-service>.onrender.com/ in a browser shows the landing page (which also serves as the health check).

Note: free-tier services spin down after ~15 minutes of inactivity; the first request after that takes ~30-60 seconds while the instance cold-starts. The server is stateless, so this is harmless — retry once if a first call times out.

Add to Claude as a custom connector

  1. In Claude (web or desktop), go to Settings → Connectors.

  2. Click Add custom connector.

  3. Enter the URL ending in /mcp, e.g. https://sales-analyzer-mcp.onrender.com/mcp, and add it. No authentication is required.

  4. In a chat, enable the connector from the tools menu, then ask something like:

    Which weeks in the sales data look anomalous, and what happened in week 32?

Claude will call list_weeks, analyze_week, and get_product_history as needed and reason over the returned figures.

About the sample data

The dataset (6 products × 365 days of 2025) has realistic weekly rhythm, seasonality, and growth, plus four hidden anomalies the detectors rediscover:

  • a 5-day closure in mid-March (pipe burst),
  • a one-day viral spike in May,
  • a week of 10x-inflated Latte revenue in August (decimal error — units normal),
  • a permanent Blueberry Muffin collapse from October (supplier problem).

The generator is seeded, so the CSV is identical on every run.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured