kiotviet-mcp
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., "@kiotviet-mcp What products are running low?"
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.
kiotviet-mcp
A voice-first Model Context Protocol server for shops that run on KiotViet, the POS used by a very large number of Vietnamese grocery and convenience stores.
It lets any MCP client (Alexa+, Claude, IDE agents, your own Bedrock agent) answer a shop owner's questions in one spoken sentence:
"What's running low?"
"How many cartons of milk do we have?"
"How were sales yesterday?"
"What sold best this week?"
"What should I reorder?" → "Draft it." → "Yes, send it."
Every tool returns two things:
content[0].text: a sentence written to be spoken, at most 35 words, with rounded numbers and units, and never more than 3 list items read aloud.structuredContent: data that matches the tool's declaredoutputSchema.
Tools carry MCP annotations (readOnlyHint, destructiveHint, idempotentHint).
It was extracted from ShopVoice, the Alexa+ MCP project in vansyson1308/groceryclaw, built for the Build, Ship, Shape Amazon Developer Hackathon. This package has no GroceryClaw dependencies: it talks to the KiotViet Public API directly.
Tools
Tool | Type | What it does |
| read | Products at or below KiotViet |
| read | On hand plus days of cover for a product name, product code or barcode; asks which one when several match |
| read | Today, yesterday, the last 7 days or the last 28 days, against the previous equal period (same weekday last week for single days) |
| read | Top or bottom sellers by units |
| read | (lead time + cover days) × forecast − on hand |
| write, not destructive | Drafts a purchase order and returns a |
| write, destructive, idempotent | Sends the draft to KiotViet ( |
It also exposes a resource, shop://profile. Start with --read-only to hide the two purchase-order tools entirely.
Related MCP server: jumia-vendor-center
Quick start
npm install
npm run build
# Try it without KiotViet credentials (built-in demo shop), over stdio:
node dist/cli.js --demo
# Real shop:
export KIOTVIET_CLIENT_ID=... KIOTVIET_CLIENT_SECRET=... KIOTVIET_RETAILER=your-retailer
export KIOTVIET_BRANCH_ID=12345 # optional, used for purchase orders
node dist/cli.js # stdio
KIOTVIET_MCP_TOKEN=$(openssl rand -hex 24) node dist/cli.js --http 8787 # Streamable HTTP on 127.0.0.1:8787/mcpClaude Desktop / any stdio client
{
"mcpServers": {
"kiotviet": {
"command": "node",
"args": ["/path/to/kiotviet-mcp/dist/cli.js", "--read-only"],
"env": { "KIOTVIET_CLIENT_ID": "...", "KIOTVIET_CLIENT_SECRET": "...", "KIOTVIET_RETAILER": "..." }
}
}
}Inspect it
npx @modelcontextprotocol/inspector@2.8.0 --cli node dist/cli.js -e KIOTVIET_MCP_DEMO=1 --method tools/listHow it uses the KiotViet Public API
Auth:
POST https://id.kiotviet.vn/connect/token(client credentials, scopePublicApi.Access). The token is cached until shortly before it expires, and every call sendsAuthorization: Bearer …plus theRetailerheader.Products:
GET /products?includeInventory=true(paged by 100). On hand is summed across branches (onHand − reserved), and the minimum stock comes fromminQuantity.Sales:
GET /invoices?fromPurchaseDate=…&toPurchaseDate=…for the last 28 days, aggregated frominvoiceDetailsby product code. Cancelled invoices are skipped.Purchase orders:
POST /purchaseorders, and only fromconfirm_purchase_order.
Responses are read defensively, so missing fields fall back to safe defaults. A snapshot is cached for 60 seconds to stay within API rate limits.
Safety
Two-step writes. The draft token is random (96 bits), stored only as a SHA-256 hash, expires after 5 minutes, and confirming twice sends nothing new.
The HTTP mode binds to
127.0.0.1, requires a bearer token (compared in constant time), and rejects non-loopback browserOrigins, which protects against DNS rebinding.KiotViet credentials are read from the environment only and never logged.
Development
npm test # builds, then runs node:test against a fake KiotViet API and the demo shopPinned: @modelcontextprotocol/sdk 1.30.1 (MCP protocol 2025-11-25), zod 4.6.5, Node ≥ 20.
License
MIT, see LICENSE.
Available Tools
7 toolsconfirm_purchase_orderSend the purchase order (step 2 of 2)ADestructiveIdempotent
Sends the drafted purchase order to KiotViet (POST /purchaseorders). Requires the confirmation_token from create_purchase_order_draft; expires after 5 minutes. Call only after the user explicitly confirms.
Inputs: confirmation_token (required). Returns: status, kiotviet_code
create_purchase_order_draftDraft a purchase order (step 1 of 2)A
Drafts a KiotViet purchase order from the current suggestions (or the given product codes) and returns a confirmation_token valid for 5 minutes. Nothing is sent to KiotViet until confirm_purchase_order is called after the user says yes.
Inputs: items. Returns: lines, est_total, confirmation_token, expires_in_seconds
get_low_stockWhat is running lowARead-onlyIdempotent
Products at or below their KiotViet minimum stock (minQuantity), most urgent first by days of cover.
Inputs: no named parameters. Returns: items, total_low
get_sales_summarySales summaryARead-onlyIdempotent
Revenue and units for today, yesterday, the last 7 days or the last 28 days, compared with the previous equal period (same weekday last week for single days).
Inputs: period. Returns: to, from, units, period, +3 more
get_stock_levelStock level for one productARead-onlyIdempotent
On-hand quantity and days of cover for a product by name, product code or barcode. Asks which one if several match.
Inputs: product (required). Returns: status, matches
get_top_moversBest and slowest sellersBRead-onlyIdempotent
Top or bottom products by units sold over the last N days.
Inputs: days, limit, direction. Returns: items
suggest_reorderSuggest a reorderARead-onlyIdempotent
What to reorder now: items at/below minimum. Quantity = (lead time 2 + 7 days) x 14-day average daily sales - on hand. Read-only.
Inputs: no named parameters. Returns: lines, est_total
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct, but get_low_stock and suggest_reorder both surface items at or below minimum stock, which could cause some confusion. The descriptions clarify that one is a status report while the other provides specific reorder quantities, so the boundary is workable.
All tool names follow a consistent verb_noun pattern: get_*, suggest_reorder, create_purchase_order_draft, confirm_purchase_order. The naming clearly communicates the action and object, with no mixed conventions or vague verbs.
Seven tools is well-scoped for a KiotViet inventory and purchasing assistant. Each tool covers a meaningful step in the workflow from stock and sales visibility to reorder suggestions and purchase order confirmation.
The tool set covers the core inventory, sales, and purchase-order workflow end to end, including the important two-phase draft/confirm purchase order flow. Minor gaps exist, such as no ability to list or cancel existing purchase orders or adjust stock, but these do not break the primary use case.
Maintenance
Related MCP Connectors
Connect e-commerce and marketing data to AI assistants via MCP.
JooVoice lets your AI assistant make real phone calls for you through MCP. Ask it to book a table or appointment, change a reservation, cancel a subscription, request a refund, or check stock and opening hours. Get the outcome back in your chat, with the call recording and transcript. You choose when calls need your approval. Personal calls, such as birthday wishes or family check-ins, use a recipient consent link. Learn more at https://joovoice.com.
Hosted MCP for e-commerce: live product catalog, stock, and pricing for AI agents.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables store operations including inventory and sales queries and automated replenishment ordering through natural language.3-
- FlicenseAqualityCmaintenanceEnables MCP clients to manage Jumia Vendor Center catalogs and orders through natural language, including product creation/updates, inventory sync, order fulfillment, shipping labels, and payout monitoring.27-
- AlicenseNot gradedqualityCmaintenanceEnables hands-busy small online sellers to use voice-driven MCP tools for deterministic margin and listing checks and to draft ad headlines, 30-second shorts scripts, and detail page outlines.MIT
- AlicenseNot gradedqualityBmaintenanceEnables small shopkeepers to record credit and payment entries, check balances, list dues, and get ranked collection plans with drafted reminders through natural voice commands, including code-mixed Tamil/Hindi/English speech. It returns short spoken-style responses over a self-hosted Streamable HTTP MCP server backed by Amazon Bedrock, with a regex fallback when Bedrock is unavailable.MIT