跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Loyverse,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
Loyverse 收银系统后台:销售和退款小票,班次和现金,带规格的商品,分类、修饰项、折扣和税,各门店库存,会员顾客,员工、门店、POS 设备、支付方式、供应商和 webhook。退款和删除在安装时关闭。
试试这样问
Loyverse 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Loyverse、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Loyverse + ChatGPT
Loyverse 收银系统后台:销售和退款小票,班次和现金,带规格的商品,分类、修饰项、折扣和税,各门店库存,会员顾客,员工、门店、POS 设备、支付方式、供应商和 webhook。退款和删除在安装时关闭。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
LOYVERSE_ACCESS_TOKEN
步骤 1 — 获取凭证
设置大约需要 2 分钟。你需要 Loyverse 账户的所有者登录。
- 以所有者身份登录 Loyverse Back Office,打开 Settings、Access tokens(
https://r.loyverse.com/dashboard/#/integrations/tokens)。在部分套餐中,访问令牌属于 Integrations 附加功能。 - 点击 Add access token,填写名称,如需要也可设置到期日,然后保存。复制令牌。
- 把它粘贴到
LOYVERSE_ACCESS_TOKEN。它以Authorization: Bearer <token>发送,拥有账户的完全访问权限,请妥善保管。 - 安装连接器并运行
loyverse_get_merchant:它会显示商户名称和币种,并确认令牌可用。
连接器与 Loyverse API v1.0(https://api.loyverse.com/v1.0)通信,这是 Loyverse 收银系统的后台 API。
读取内容:账户用 loyverse_get_merchant(币种及小数位数),门店用 loyverse_list_stores 和 loyverse_get_store,POS 设备用 loyverse_list_pos_devices。销售:loyverse_list_receipts 按门店和日期范围(created_at_min/created_at_max)或小票号查询,最新的在前,包含明细、折扣、税、付款、员工和顾客;loyverse_get_receipt 按小票号读取一张小票。班次和现金:loyverse_list_shifts 和 loyverse_get_shift(现金进出、应有现金和实际现金、总销售额和净销售额、税、按支付方式的付款)。支付方式用 loyverse_list_payment_types 和 loyverse_get_payment_type。商品目录:loyverse_list_items、loyverse_get_item,带 SKU、条码和分门店价格的规格用 loyverse_list_variants(按 sku 搜索)和 loyverse_get_variant,还有分类、修饰项、折扣、税和供应商。库存:loyverse_list_inventory 给出每个规格在每个门店的 in_stock。顾客用 loyverse_list_customers(按 email 搜索)和 loyverse_get_customer,包含到店次数、累计消费和会员积分;员工用 loyverse_list_employees 和 loyverse_get_employee;webhook 用 loyverse_list_webhooks。
写入内容:loyverse_create_receipt 记录在其他地方(例如其他渠道)完成的销售:它会扣减启用库存跟踪的商品库存并计入报表,且付款合计必须等于小票总额。保存类工具不带 id 时创建记录,带 id 时更新记录:loyverse_save_item、loyverse_save_variant、loyverse_save_category、loyverse_save_discount、loyverse_save_tax 和 loyverse_save_customer(total_points 设置积分余额)。更新会替换整条记录,所以 AI 会先读取,并带上所有需要保留的字段。loyverse_set_inventory 在 stock_after 中接收新的绝对数量,而不是增减量。loyverse_create_webhook 为一个 HTTPS 地址订阅一个事件(小票、商品、顾客、库存变动或已结班次);事件类型加地址必须唯一。在创建小票或修改库存之前,AI 会先展示明细、金额或新的库存数,等你同意。
安装时关闭:loyverse_refund_receipt、loyverse_delete_item 和 loyverse_delete_customer。它们无法撤销,因此在团队需要时由工作区管理员开启。
数据格式:ID 是 UUID;小票通过 receipt_number(例如 1-1001)指定。金额是账户币种的小数(见 loyverse_get_merchant)。小票的 receipt_type 为 SALE 或 REFUND;退款以正数金额记录,因此 AI 在汇总销售额时会将其扣除,cancelled_at 标记已作废的小票。所有时间均为 UTC(ISO 8601);按天分组前,AI 会把它们换算成门店时区。在 Back Office 中删除的记录默认隐藏,除非 show_deleted 为 true。
分页:列表工具返回 limit 条记录(默认 50,最多 250),只要还有更多就返回 cursor;AI 会把它作为 cursor 传回,直到不再出现。门店、POS 设备、支付方式、折扣和税会一次全部返回。
限制和常见错误:每个账户每 300 秒 300 个请求;超出时 Loyverse 返回 429 RATE_LIMITED。错误以 errors: [{code, details, field}] 返回。401 UNAUTHORIZED 表示令牌错误或已过期:请重新复制或新建一个。402 PAYMENT_REQUIRED 表示订阅或包含 API 的附加功能已到期。403 FORBIDDEN,404 NOT_FOUND 表示 ID 错误,400 INVALID_VALUE 或 MISSING_REQUIRED_PARAMETER 会指明出错的字段。
使用安装时开启的工具,连接器不会对小票退款,也不会删除任何内容。门店、POS 设备、支付方式、员工、修饰项和供应商只读,不会创建或修改,也不会删除 webhook。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 ChatGPT 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
ChatGPT 在网页版的 Plugins 页面把 MCP 服务器添加为插件,仅付费套餐可用,不再需要开发者模式。在 Business 工作区中只有管理员和所有者可以添加;在 Enterprise 和 Edu 中,管理员可以授予 Create plugins with MCPs 权限。
- 前往 chatgpt.com/plugins,点击 Add,然后选择 Add custom MCP server。
- 填写名称,例如 Name:
Loyverse。 - 在 Connection 下的 Server URL 中填入
https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,Authentication 保持为 OAuth。 - 选择 I understand and want to continue,然后点击 Create as a plugin。ChatGPT 提示时,登录 AnythingMCP 并允许访问。
- 在个人插件中安装这个新插件,然后在对话中输入 @ 并选择它。
可用工具
| Tool | What it does |
|---|---|
loyverse_get_merchant | Get the Loyverse account (merchant) behind the token: business name, email, country and currency with its decimal places |
loyverse_list_stores | List the stores of the account with name, address, phone and description |
loyverse_get_store | Get one store by its id (UUID) with name, address, phone number and description, as shown in the Back Office |
loyverse_list_pos_devices | List the POS devices (registers) of the account, optionally for one store, with name, store id and whether the device is activated |
loyverse_list_receipts | List sales and refund receipts, newest first, with line items, discounts, taxes, payments, totals, store, employee, customer and POS device |
loyverse_get_receipt | Get one receipt by its receipt number (e.g. 1-1001) with all line items, modifiers, discounts, taxes, payments and the refund link |
loyverse_create_receipt | Record a sales receipt in Loyverse (e.g. a sale made in another channel) |
loyverse_refund_receipt | Create a refund receipt for some or all lines of a sales receipt |
loyverse_list_shifts | List closed cash register shifts with opening and closing time, cash movements, expected and actual cash, gross and net sales, taxes and… |
loyverse_get_shift | Get one shift by id with cash drawer amounts, cash movements, sales totals, taxes and payment totals per payment type |
loyverse_list_payment_types | List payment types (cash, card, check and custom ones) with their id and type |
loyverse_get_payment_type | Get one payment type by id with its name, type (CASH, NONINTEGRATEDCARD, CHECK, OTHER and so on) and stores |
loyverse_list_items | List items of the catalog with category, taxes, modifiers, options and their variants (SKU, barcode, cost, default price and price per… |
loyverse_get_item | Get one item by id with its variants, prices per store, category, tax ids, modifier ids, stock tracking and composite components |
loyverse_save_item | Create an item, or update it when id is given (Loyverse upserts with POST) |
loyverse_delete_item | Delete an item and its variants from the catalog |
loyverse_list_variants | List item variants with SKU, barcode, option values, cost, default price and per-store price and availability |
loyverse_get_variant | Get one item variant by id with SKU, barcode, option values, cost and the price and availability in each store |
loyverse_save_variant | Create a variant of an existing item, or update it when variant_id is given (upsert with POST) |
loyverse_list_categories | List item categories with name and colour |
loyverse_get_category | Get one item category by id (UUID) with its name, colour and creation and deletion times |
loyverse_save_category | Create an item category, or rename or recolour it when id is given (Loyverse upserts with POST) |
loyverse_list_modifiers | List modifiers (e.g |
loyverse_list_discounts | List discounts with type (fixed or variable, percent or amount, by points), value, stores and whether access is restricted |
loyverse_get_discount | Get one discount by id (UUID) with its type, amount or percent, stores and restricted access flag |
loyverse_save_discount | Create a discount, or update it when id is given (upsert with POST) |
loyverse_list_taxes | List taxes with rate, type (included in the price or added to it) and stores |
loyverse_get_tax | Get one tax by id (UUID) with its name, rate in percent, type (INCLUDED or ADDED) and stores |
loyverse_save_tax | Create a tax, or update it when id is given (upsert with POST) |
loyverse_list_suppliers | List suppliers with contact name, email, phone, website, address and note |
loyverse_list_inventory | List stock levels per item variant and store (in_stock) |
loyverse_set_inventory | Set the stock of item variants in stores. stock_after is the new absolute quantity, not a change: read the current level first and confirm… |
loyverse_list_customers | List loyalty customers with contact details, customer code, note, first and last visit, total visits, total spent and points balance |
loyverse_get_customer | Get one customer by id with contact details, address, customer code, visits, total spent and loyalty points |
loyverse_save_customer | Create a customer, or update one when id is given (upsert with POST). total_points sets the loyalty balance |
loyverse_delete_customer | Delete a customer with their loyalty points |
loyverse_list_employees | List employees with name, email, phone, role and the stores they work in |
loyverse_get_employee | Get one employee by id (UUID) with name, email, phone number, owner flag and the stores they work in |
loyverse_list_webhooks | List the webhooks of the account with event type, target URL and status (ENABLED or DISABLED after failed deliveries) |
loyverse_create_webhook | Subscribe an HTTPS URL to one event: receipts, items, customers or inventory changes, or closed shifts |
示例提示
- “昨天每个门店扣除退款后的净销售额是多少?”
- “给我看市中心门店最近一个已结班次,包括应有现金和实际现金。”
- “市中心门店哪些规格的库存少于 5 件?”
- “把市中心门店 SKU LATTE-CUP-12 的库存设为 200。先给我看当前库存。”
- “找到邮箱为 [email protected] 的顾客,显示他的到店次数、累计消费和积分。”
FAQ
ChatGPT 免费套餐能用自定义 MCP 服务器吗? OpenAI 只为付费套餐提供自定义 MCP 服务器的说明,Free 套餐不在其列。
下一步
这份指南对你有帮助吗?