receipts-api-mcp
receipts-api-mcp

FastAPI receipts statistics server with a built-in MCP layer and a self-contained GitHub Pages testing dashboard.
Live dashboard (no setup required): https://chf3198.github.io/receipts-api-mcp/
The dashboard loads CSV data directly from this repository and processes everything in the browser. No server, no account, no cold start — open the link and it works.
Overview
Layer | Technology | Notes |
Demo dashboard | Vanilla JS + Chart.js + Papa Parse (GitHub Pages) | Always-on, zero setup — visit the link above |
REST API | FastAPI | Run locally: |
MCP server | fastapi-mcp (Streamable HTTP) | Available at |
Data source: data/receipts_2025_01.csv + data/receipts_2025_02.csv (also served from docs/data/ for the dashboard).
Quick Start
Prerequisites
Install uv (replaces pip + venv):
curl -LsSf https://astral.sh/uv/install.sh | shRun locally
git clone https://github.com/chf3198/receipts-api-mcp.git
cd receipts-api-mcp
uv sync
uv run uvicorn receipts_api.main:app --reloadOr via the project script:
uv run receipts-apiAPI is live at http://localhost:8000
Interactive docs: http://localhost:8000/docs
API Endpoints
Method | Path | Description |
|
| List receipts with optional filters |
|
| SQL-style grouped statistics |
|
| Distinct company names |
|
| Distinct product categories |
|
| Single receipt by ID |
Filters (all endpoints)
Param | Type | Description |
| string | Exact match, case-insensitive |
| string | Exact match, case-insensitive |
| ISO date | Earliest receipt date (inclusive) |
| ISO date | Latest receipt date (inclusive) |
| string | e.g. |
/receipts/stats — grouping
?group_by=company · ?group_by=product_category · ?group_by=company,product_category
Returns receipt_count, sum/avg/min/max_total_usd, sum_discount_usd, sum_tax_usd per group.
MCP Connection
Connect any MCP-compatible client (Cursor, Claude Desktop, etc.) to the running server:
{
"mcpServers": {
"receipts-api": {
"url": "http://localhost:8000/mcp"
}
}
}All five receipt endpoints are auto-exposed as MCP tools with full parameter schemas.
Development
uv sync --extra dev # installs pytest + httpx
uv run pytest -v # run test suite (16 smoke tests)
uv run ruff check . # lint
uv run ruff format . # formatSecurity
This is a public, read-only demo API — authentication is intentionally absent by design.
Aspect | Posture |
CORS |
|
Auth | None — all endpoints are public read-only; no PII or sensitive data |
Data | Synthetic sample CSV — no real financial records or personal information |
Dependencies | Audited via |
CDN integrity | SRI hashes on Chart.js and PapaParse script tags |
Branch protection |
|
A full Phase-0 security audit (threat model, automated scans, cross-family fleet red-team) completed 2026-06-08. See SECURITY.md for the full posture report.
Project Structure
receipts-api-mcp/
├── src/
│ └── receipts_api/
│ ├── main.py # FastAPI app, CORS, MCP mount, entrypoint
│ ├── data_loader.py # CSV → shared in-memory list
│ ├── utils.py # shared filter + serialise helpers
│ └── routers/
│ ├── receipts.py # /receipts endpoints
│ └── stats.py # /receipts/stats grouped aggregates
├── data/ # CSV source files (API runtime reads here)
├── docs/ # GitHub Pages dashboard (zero-build HTML/JS)
│ ├── assets/ # dashboard images
│ ├── data/ # CSV copy for browser fetch (Pages same-origin)
│ └── index.html # self-contained dashboard
├── assets/
│ └── interview/ # original interview brief + setup instructions
├── tests/
│ └── test_api.py # 16 pytest smoke tests (TestClient)
├── pyproject.toml # uv + ruff + pytest config
├── uv.lock # deterministic lockfile
└── .python-version # pins Python 3.11 for uvData Layout
The CSV data exists in two locations intentionally — each serves a different consumer:
Path | Consumer | Notes |
| API runtime |
|
| GitHub Pages dashboard | The dashboard ( |
These two copies must remain in sync. The assets/interview/ folder contains the original interview brief and setup instructions (not consumed by any runtime).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chf3198/receipts-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server