KiezelPay Sales MCP
An MCP server that lets you query KiezelPay merchant sales data in natural language, with tools for sales summaries, product analysis, and prediction.
README
KiezelPay Sales MCP
An MCP client + server that lets you talk to your KiezelPay merchant sales data in natural language. Claude picks which reporting call to make, your products become attachable context, and common analyses are one-word commands.
The read-only KiezelPay merchant reporting API is wrapped as:
- Tools (Claude calls these autonomously)
get_sales_summary- balance, totals, active trials, next/previous payoutget_sales_today/get_sales_yesterday- your sales vs. the best merchant + your rank (optionalplatform)get_purchase_history- recent individual purchases (limit,platform,sort)list_products- distinct product names, derived from historyget_product_sales- aggregated stats for one product
- Resources - your products (derived by aggregating the
productfield across purchase history)kpay://products- list of product nameskpay://products/{product}- one product's aggregate (count, revenue*, countries, platforms, first/last sale)
- Prompts - one-word analyses
/analyze-product <product>- performance deep-dive/trend-product <product>- trajectory over the available history window/predict-product <product>- near-term estimate (a heuristic extrapolation, not a statistical forecast)/sales-report- overall executive summary
* revenue is included only if the history records carry a price field.
Prerequisites
- Python 3.10+
- An Anthropic API key (for the chat host)
- A KiezelPay merchant API key - get it at https://kiezelpay.com/account/api
- The public test key
0123456789abcdef0123456789abcdefworks for summary/today/yesterday, but not/history, so products and the product prompts need a real key.
- The public test key
Setup
1. Configure environment variables
Copy .env.example to .env and fill in the values:
ANTHROPIC_API_KEY="" # your Anthropic API key
CLAUDE_MODEL="claude-sonnet-5"
KIEZELPAY_API_KEY="" # your KiezelPay merchant key
USE_UV="1"
The KiezelPay key is used only by the MCP server, is read from the environment, and is
never returned to the model or printed. .env is gitignored.
2. Install dependencies
Using uv (recommended):
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install -e .
Or without uv:
python -m venv .venv
source .venv/bin/activate
pip install anthropic python-dotenv prompt-toolkit "mcp[cli]>=1.8.0" "httpx>=0.27.0"
3. Run the chat host
uv run main.py # or: python main.py
Usage
Chat naturally - Claude will call the right tools:
> How did sales go today, and what's my current balance?
> Which products sold the most in the last 200 purchases?
Attach a product as context with @ (Tab to autocomplete):
> How is @RadPro doing lately?
Run an analysis prompt with / (Tab to autocomplete):
> /analyze-product RadPro
> /trend-product RadPro
> /predict-product RadPro
> /sales-report
Use from Claude Desktop / Claude Code
The server speaks stdio, so any MCP host can run it. Example Claude Desktop entry:
{
"mcpServers": {
"kiezelpay": {
"command": "uv",
"args": ["run", "mcp_server.py"],
"cwd": "/absolute/path/to/kiezelpay-mcp",
"env": { "KIEZELPAY_API_KEY": "your_key_here" }
}
}
}
Project layout
| File | Role |
|---|---|
mcp_server.py |
KiezelPay Sales MCP server (tools, product resources, prompts) |
kpay_api.py |
Thin async HTTP client for the KiezelPay merchant API + product aggregation |
mcp_client.py |
Generic MCP client + a small test harness (uv run mcp_client.py) |
main.py |
CLI chat host entry point |
core/ |
Chat host internals (Claude wrapper, chat loop, tool manager, CLI I/O) |
Notes & caveats
- The API is read-only; this MCP never mutates anything.
- Products are derived from history, so the catalog only reflects the fetched window
(
CATALOG_LIMITinmcp_server.py, default 200). Raise it for a longer catalog. /predict-productis a reasoning-based estimate over past patterns, not a real forecast.- If
today/yesterdayday boundaries look off, adjust the timezoneoffsetinkpay_api.py(tz_offset_minutes()).
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.