mcp-loyverse
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-loyverse What were today's total sales?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-loyverse
A local-first, read-only MCP server for the Loyverse POS API that lets AI assistants query receipts, items, employees, customers, stores, and sales analytics — built for secure local use with Personal Access Tokens.
What & Why
mcp-loyverse bridges the Model Context Protocol (MCP) and the Loyverse POS API so that AI assistants like Claude can answer business questions about your point-of-sale data directly:
"What were today's total sales?" — answered in a single tool call
"Which was the best-selling item this week?" — aggregated automatically
"Show me the top employees by sales this month" — with name resolution
Instead of the AI making dozens of paginated API calls, high-level analytics tools handle pagination, filtering, and aggregation internally, returning concise summaries that are token-efficient.
Related MCP server: mcploy
Features
15 MCP tools (1 system + 11 resource + 3 analytics)
Automatic pagination for analytics — no manual cursor handling
Date presets —
today,yesterday,this_week,this_month,last_7_days,last_30_daysTimezone-aware date resolution (configurable, defaults to UTC)
Read-only — only GET requests, no data modification
Secure — token never appears in logs or error messages
Structured logging to stderr with configurable log level
Retry logic — exponential backoff on 429 (rate limit), single retry on 5xx
Safety limits — max 10,000 receipts per analytics query, 90-day max date range
Requirements
Node.js 20+
Loyverse account with a Personal Access Token (Settings > Personal Access Tokens)
Quick Start
No cloning or building required — just add the server to your MCP client:
Claude Code (CLI)
claude mcp add loyverse \
-e LOYVERSE_API_TOKEN=your_personal_access_token_here \
-e DEFAULT_TIMEZONE=America/Mexico_City \
-- npx mcp-loyverseClaude Desktop
Add to your config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"loyverse": {
"command": "npx",
"args": ["mcp-loyverse"],
"env": {
"LOYVERSE_API_TOKEN": "your_personal_access_token_here",
"DEFAULT_TIMEZONE": "America/Mexico_City"
}
}
}
}Other MCP clients
Any MCP-compatible client that supports stdio transport can connect. Use the command npx mcp-loyverse with the environment variables listed in Configuration.
Install from source
If you prefer to run from a local clone:
git clone https://github.com/novigante/mcp-loyverse.git
cd mcp-loyverse
npm install
npm run buildThen use node /path/to/mcp-loyverse/dist/index.js instead of npx mcp-loyverse in the examples above.
Verify
Ask your AI assistant: "Run the healthcheck tool" — it should return server status and configuration info.
Configuration
Variable | Required | Default | Description |
| Yes | — | Loyverse Personal Access Token |
| No |
| API base URL |
| No |
| Timezone for date presets (e.g. |
| No |
| Log verbosity: |
| No |
| Read-only mode (always true in v0.1) |
Available Tools
System
Tool | Description |
| Server status, version, and configuration check |
Resource (CRUD read-only)
Tool | Description | Key Inputs |
| Search receipts by date, store, or receipt numbers |
|
| Get full receipt details |
|
| List catalog items |
|
| Get item details by ID |
|
| List employees (staff, waiters, cashiers) |
|
| Get employee details by ID |
|
| List customers, optionally filter by email |
|
| Get customer details by ID |
|
| List all stores |
|
| Get store details by ID |
|
| Get merchant profile and currency settings | (none) |
Analytics (high-level, auto-paginated)
Tool | Description | Key Inputs |
| Revenue, receipt count, average ticket, taxes, tips |
|
| Top items ranked by quantity or sales amount |
|
| Top employees by sales or receipt count (resolves names) |
|
Example Prompts
"What were today's total sales?"
"Show me the top 5 best-selling items this week"
"Which employee had the highest sales this month?"
"List all receipts from yesterday"
"Get the details of receipt number R-1234"
"What was the average ticket amount this week?"
"What currency does the merchant use?"
Architecture
src/
config/ Configuration (env validation, secrets, logger)
loyverse/ HTTP client, API error handling, resource clients
domain/ Analytics: pure aggregation functions, receipt collector
tools/ MCP tool definitions and handlers
_shared/ Date range helpers, pagination, result builders
mcp/ MCP server setup and tool registry
index.ts Entry point (stdio transport)Each tool exports { definition, handler }. The toolRegistry.ts wires definitions into the MCP server. Analytics tools compose the receipt collector (auto-pagination) with pure aggregation functions.
Security
Read-only — only HTTP GET requests to the Loyverse API
Token protection — the API token never appears in logs, error messages, or tool responses
Secret redaction — structured log data is automatically sanitized
Local-first — runs on your machine via stdio transport; no external server or network exposure
Limitations (v0.1)
Read-only — no creating, updating, or deleting resources
PAT only — no OAuth flow; requires a Personal Access Token
stdio only — no HTTP/SSE transport (designed for local MCP clients)
No caching — every tool call fetches fresh data from the API
Analytics limit — max 10,000 receipts per query; max 90-day date range
Roadmap
Publish to npm (
npx mcp-loyverse)Write tools (create/update items, customers)
OAuth 2.0 authentication flow
HTTP/SSE transport for remote deployment
Response caching with TTL
Webhook support for real-time updates
Inventory and stock level tools
Testing
Unit tests
npm test # 194 tests (Vitest)
npm run test:watch # Watch mode
npx vitest run tests/tools/salesSummary.test.ts # Single fileIntegration tests
End-to-end tests that exercise all 15 tools against the live Loyverse API via the MCP protocol (stdio transport). Validates connectivity, resource reads, analytics, cross-data consistency, error handling, and pagination.
Prerequisites: a .env file with a valid LOYVERSE_API_TOKEN.
cp .env.example .env
# Edit .env — set your real LOYVERSE_API_TOKEN
npm run build
node tests/integration/run-integration.mjsThe script connects as an MCP client, runs 40 tests across 6 phases, and writes raw results to tests/integration/results.json.
Phase | Tests | What it validates |
1. Connectivity | 2 | Healthcheck, merchant auth |
2. Resources | 13 | List/get for all 6 entities, filters |
3. Analytics | 7 | Sales summary, top items, top employees |
4. Cross-validation | 5 | Data consistency between tools |
5. Error handling | 9 | Invalid IDs, missing params, server stability |
6. Pagination | 4 | Cursor-based pagination per resource |
See docs/integration-test-plan.md for detailed validation criteria.
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Write tests first (TDD) —
npm testImplement your changes
Run integration tests locally (requires your own
LOYVERSE_API_TOKEN)Verify:
npm run build && npm test && npm run lintSubmit a pull request — CI must pass before merge
Releasing
Releases are published to npm automatically via GitHub Actions. Only repository maintainers can create releases.
Merge all desired changes to
mainvia PRUpdate the version in
package.json(npm version patch|minor|major) and merge via PRCreate a GitHub Release with tag
vX.Y.Zmatchingpackage.jsonThe workflow builds, tests, and publishes to npm with provenance
License
Available Tools
15 toolsget_customerBRead-only
Get full details of a specific customer by their ID
Inputs: customer_id (required).
get_employeeCRead-only
Get full details of a specific employee by their ID
Inputs: employee_id (required).
get_itemBRead-only
Get full details of a specific item by its ID
Inputs: item_id (required).
get_merchantARead-only
Get merchant profile including business name and currency settings (code and decimal places)
Inputs: no named parameters.
get_receiptBRead-only
Get full details of a specific receipt by its receipt number
Inputs: receipt_number (required).
get_storeBRead-only
Get full details of a specific store by its ID
Inputs: store_id (required).
healthcheckBRead-only
Check server status and configuration
Inputs: no named parameters.
list_customersARead-only
List customers. Filter by IDs or email. Returns customer profiles with visit history and spending totals.
Inputs: email, limit, cursor, customer_ids.
list_employeesARead-only
List employees (waiters, cashiers, staff). Use to resolve employee names from IDs found in receipts.
Inputs: limit, cursor, employee_ids.
list_itemsARead-only
List items from the catalog. Useful to look up item names, prices, SKUs, and categories.
Inputs: limit, cursor, items_ids, show_deleted.
list_receiptsARead-only
Search receipts (tickets) by date range, store, or receipt numbers. Returns receipt summaries with totals, line items, and payment info. Use date presets (today, yesterday, this_week, this_month) or explicit from/to range.
Inputs: to, from, limit, cursor, +3 more.
list_storesBRead-only
List all stores. The stores endpoint does not support pagination — all stores are returned at once.
Inputs: store_ids, show_deleted.
sales_summaryARead-only
Get a sales summary for a given period: total revenue, receipt count, average ticket, discounts, taxes, and tips. Use presets (today, yesterday, this_week, this_month) or explicit date range.
Inputs: to, from, period, store_id.
top_employees_by_salesARead-only
Get the top employees (waiters/cashiers) by sales amount or receipt count. Answers: Which waiter sold the most this month?
Inputs: to, from, limit, metric, +2 more.
top_selling_itemsARead-only
Get the top-selling items for a period, ranked by quantity sold or by sales amount. Answers: What was the best-selling dish today?
Inputs: to, from, limit, metric, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each core entity (employees, receipts, items, customers, stores) has a clearly distinct list vs. get pair. Analytics tools such as sales_summary, top_selling_items, and top_employees_by_sales target different questions and do not overlap with the catalog or receipt lookup tools.
The set predominantly follows a consistent snake_case verb_noun convention, e.g. list_employees, get_receipt, top_selling_items. The main deviation is healthcheck, which would be more consistent as health_check, but it is a minor and readable exception.
With 15 tools, the server is comfortably scoped for a POS data and reporting integration. Each major entity gets list/get coverage, while analytics and healthcheck add clear value without bloating the surface.
The tool set covers list/get access for employees, receipts, items, customers, stores, and merchant profile, plus useful sales and ranking analytics. It lacks create/update/delete operations, but for a read-only reporting MCP server the surface is nearly complete.
Maintenance
Related MCP Connectors
Build custom POS apps with your AI agent. Final's MCP server gives developers what they need to ship a custom point of sale: scaffold a checkout flow, adapt vetted screen blueprints for counter POS, self-checkout kiosks, restaurant ordering and payment terminals, ground every call in Final's version-locked POS APIs, validate, boot a live preview and deploy to real hardware with integrated card payments. The same server also manages the store behind it: products, stock, orders, customers and sales reports. Remote Streamable HTTP with OAuth 2.1.
Read-only finance MCP server. Connects your banks, cards, payment apps, books and payroll into one ledger for your AI. Can't move money. Open source (AGPL-3.0), free during beta.
MCP server for Lemon Squeezy — stores, products, orders, subscriptions, license keys.
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
- AlicenseBqualityCmaintenanceLocal MCP server for TOCOnline accounting/invoicing API that enables AI assistants to manage customers, products, sales documents, and call arbitrary endpoints via natural language after OAuth login.671MIT
- AlicenseAqualityDmaintenanceExposes the Loyverse API as MCP tools to manage stores, products, inventory, customers, receipts, and more from AI assistants.54MIT
- AlicenseAqualityCmaintenanceMCP server for the Clover POS REST API that gives AI assistants read and safe-write access to a merchant's sales, inventory, orders, and customers.561MIT
- AlicenseNot gradedqualityBmaintenanceRead-only MCP server that lets local AI agents query bank transactions stored in a local SQLite database, with tools for accounts, transaction search, spending summaries, recurring charges, trends, themes, subscriptions, and store health.2MIT