@salbot/kiotviet-mcp-server
# @salbot/kiotviet-mcp-server
MCP server độc lập cho KiotViet Retail và FnB, gồm 71 công cụ Retail hoặc 17 công cụ FnB. Kết nối qua stdio với MCP SDK chính thức. Yêu cầu Node.js 22+.
Cài và build bằng `pnpm install && pnpm build`; cấu hình MCP host chạy `node` với đường dẫn tuyệt đối tới `dist/cli.js`. Truyền thông tin kết nối qua `env` của host.
- Bật Public API trong thiết lập gian hàng KiotViet để lấy **Client ID** và **Client Secret**. Xem hướng dẫn [Retail](https://www.kiotviet.vn/huong-dan-su-dung-kiotviet/retail-ket-noi-api/public-api/) hoặc [FnB](https://www.kiotviet.vn/huong-dan-su-dung-kiotviet/fnb-ket-noi-api/public-api/).
- Đặt `KIOTVIET_RETAILER` là tên gian hàng trước `.kiotviet.vn`, `KIOTVIET_EDITION` là `retail` hoặc `fnb`, cùng `KIOTVIET_CLIENT_ID` và `KIOTVIET_CLIENT_SECRET`. Server tự lấy và gia hạn token.
- Nếu đã có bearer token, dùng `KIOTVIET_ACCESS_TOKEN` thay cho cặp Client ID/Secret; khi token hết hạn cần cập nhật và khởi động lại. Mỗi kết nối dùng một gian hàng.
Phát triển bởi **Toan Doan** — <toandev.95@gmail.com>.
TDQS
Scored across 71 tools
Most tools map cleanly to a distinct resource+action, and descriptions explicitly disambiguate the tricky pairs (list_orders vs list_invoices vs list_supplier_orders vs list_purchase_orders, get_* vs get_*_by_code). A few clusters remain easy to confuse at a glance — the many get_X/get_X_by_code variants and get_store vs get_settings — but the descriptions resolve them.
Every tool follows the same kiotviet_ prefix plus a consistent snake_case verb_noun pattern (list_/get_/create_/update_/delete_/generate_). No mixed casing or divergent verb styles across the 71 tools.
71 tools is far beyond the 25+ threshold and makes the surface heavy for an agent to navigate, even though the retail/POS domain is genuinely broad. The breadth justifies many tools, but the count still feels oversized and would benefit from consolidation (e.g. unified get-by-id-or-code).
Core sales lifecycle is well covered (products, customers, orders, invoices, payments, transfers, purchase orders with create/update/delete), but several resources are read-only or partial: no create_supplier, no create_category (only update/delete), no create_webhook, no create_return, no create_voucher/pricebook/branch/user. These gaps will force agents to abandon some workflows.