Docs MCP Server
Give your AI coding assistant the Loyalty.lt docs and the full Shop API contract, offline
Docs MCP Server
@loyaltylt/docs-mcp is an MCP server that hands your
AI assistant this documentation and the full Shop API contract — endpoint paths, field
names, requiredness, auth headers, response shapes. With it the assistant writes a
working integration instead of inventing plausible-looking field names.
It is a read-only documentation server. It never touches your account, never sends a request to our API, and needs no key. If you want an assistant that actually runs your loyalty programme — issues cards, drafts campaigns, checks invoices — that is the AI agent for partners, a different server with a different key.
| Docs MCP (this page) | Partner AI agent | |
|---|---|---|
| Endpoint | npx @loyaltylt/docs-mcp over stdio | https://mcp.loyalty.lt/mcp over HTTP |
| Auth | none | Authorization: Bearer lmcp_… |
| Sees | documentation and the OpenAPI contract | your live Loyalty.lt account |
| Writes | nothing | shops, cards, coupons, campaigns |
| For | developers writing the integration | partners running the programme |
Install
claude mcp add loyaltylt-docs -- npx -y @loyaltylt/docs-mcpnpx @loyaltylt/docs-mcpClaude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json on macOS,
%APPDATA%\Claude\claude_desktop_config.json on Windows. Restart the app after editing.
{
"mcpServers": {
"loyaltylt-docs": {
"command": "npx",
"args": ["-y", "@loyaltylt/docs-mcp"]
}
}
}Cursor and Windsurf
The same object, in .cursor/mcp.json inside the project (or ~/.cursor/mcp.json to
have it everywhere). Windsurf reads ~/.codeium/windsurf/mcp_config.json.
opencode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"loyaltylt-docs": {
"type": "local",
"command": ["npx", "-y", "@loyaltylt/docs-mcp"],
"enabled": true
}
}
}opencode.json in the project, or ~/.config/opencode/opencode.json globally.
Tools
Five tools. The assistant picks them itself; the parameters are here so you can tell it exactly what to call when you already know.
search_docs
Keyword search across guides and endpoints. The right first call when neither the page path nor the endpoint id is known yet.
| Parameter | Type | Default | Meaning |
|---|---|---|---|
query | string, required | — | "award points", "redeem coupon", "qr login" |
kind | all · guides · endpoints | all | Narrow to written guides or to the API surface |
limit | 1–30 | 10 | How many hits to return |
get_page
One guide in full, as Markdown.
| Parameter | Type | Meaning |
|---|---|---|
path | string, required | /docs/api-reference/authentication, or just sdk/php/usage |
For endpoint pages use get_endpoint — it reads the contract itself, not the rendered
page.
list_topics
Browse the shape of the documentation before diving in.
| Parameter | Type | Meaning |
|---|---|---|
section | string, optional | api-reference, sdk, troubleshooting. Omit for an overview |
list_endpoints
The API surface, grouped by feature.
| Parameter | Type | Meaning |
|---|---|---|
tag | string, optional | Transactions, Coupons, Games, … Omit for every group |
auth | api-credentials · customer-jwt · none | Only endpoints using that scheme |
get_endpoint
One endpoint in full: parameters, body fields, requiredness, responses, auth scheme and a ready-to-run curl.
| Parameter | Type | Default | Meaning |
|---|---|---|---|
endpoint | string, required | — | Id (postShopTransactionsCreate) or method and path (POST /shop/transactions/create) |
environment | production · staging | staging | Which base URL the example uses |
The default is staging on purpose: an assistant that copies the example verbatim hits
https://staging-api.loyalty.lt, not your live data.
What is indexed
At the time of writing the index carries 22 guides and 48 endpoints, grouped as:
Transactions Loyalty Cards Coupons Games
Offers Shops Products XML Import
Authentication QR Card Scan Realtime System
External SMS APIGuide sections: api-reference, sdk, troubleshooting, plus the top-level pages.
Both servers from the spec are available to get_endpoint — https://api.loyalty.lt
and https://staging-api.loyalty.lt.
A worked example
Ask your assistant:
Award loyalty points for order
ORD-1(€25.50) in my Laravel checkout.
It calls search_docs with "award points", lands on postShopTransactionsCreate,
calls get_endpoint to see that order_id is required and the customer needs
user_id or user_email, reads the PHP SDK guide with get_page, and writes:
$sdk->createTransaction([
'user_email' => $order->customer_email,
'order_id' => 'ORD-1',
'order_total' => 25.50,
'currency' => 'EUR',
'shop_id' => $shopId,
]);Other prompts that route cleanly through the tools:
Which endpoints need X-API-Key and X-API-Secret rather than a customer token?
Show me the request body for redeeming a coupon, with every required field.
How does QR login work end to end? Give me the calls in order.
What does the XML product import expect, and what happens to unknown fields?How it stays correct
The index is generated from this repository's own source — the guide MDX and the scoped
openapi.json — by scripts/build-index.mjs at publish time. Nothing is scraped from
rendered HTML, so the server cannot drift from the site you are reading; when a guide or
an endpoint changes here, the next published package carries the change.
The server runs entirely offline over stdio. No network calls, no API key, no telemetry. That also means it is only as fresh as the installed package — see below.
Troubleshooting
The assistant quotes an endpoint that no longer exists. The package is cached. npx
keeps a copy, so force the current one:
npx -y @loyaltylt/docs-mcp@latestIn Claude Code, re-add the server with the same flag:
claude mcp remove loyaltylt-docs
claude mcp add loyaltylt-docs -- npx -y @loyaltylt/docs-mcp@latestThe server does not appear in the client. Check it starts on its own first — it should print nothing and wait, which is what a stdio MCP server looks like:
npx -y @loyaltylt/docs-mcpThen inspect the tool list directly:
npx @modelcontextprotocol/inspector npx -y @loyaltylt/docs-mcpThe assistant writes calls against production while testing. Tell it the
environment, or pass environment: "production" only when you mean it — get_endpoint
defaults to staging.
It answers about the account, not the docs. This server has no account access at all. What you want is the AI agent for partners.
Source: github.com/Loyalty-lt/docs.