KiotViet MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
KiotViet MCP Server
MCP (Model Context Protocol) Server cho KiotViet Public API — Kết nối AI assistant với hệ thống quản lý bán hàng KiotViet.
Tính năng
36 tools bao phủ đầy đủ KiotViet Public API
Auto token refresh — Token 1 giờ được tự động làm mới trước khi hết hạn
Middleware chain — Error handler, validation, rate limit, pagination
2 transport mode — stdio (Claude Desktop) và HTTP (multi-session, Streamable HTTP + SSE legacy)
5 preset — Chọn nhóm tool phù hợp với nhu cầu
Docker ready — Build và deploy với Docker Compose
Related MCP server: Haravan MCP
Yêu cầu
Node.js >= 18
Tài khoản KiotViet với quyền truy cập Public API
Client ID,Client Secret,Retailer nametừ Thiết lập cửa hàng → Thiết lập kết nối API
Cài đặt
# Clone và cài dependencies
git clone <repo-url>
cd kiotviet-mcp
npm install
npm run buildCấu hình
Tạo file .env từ template:
cp .env.example .envĐiền thông tin:
KIOTVIET_CLIENT_ID=your_client_id
KIOTVIET_CLIENT_SECRET=your_client_secret
KIOTVIET_RETAILER=your_retailer_nameSử dụng
Claude Desktop (stdio)
Thêm vào claude_desktop_config.json:
{
"mcpServers": {
"kiotviet": {
"command": "node",
"args": ["/path/to/kiotviet-mcp/dist/cli.js", "mcp"],
"env": {
"KIOTVIET_CLIENT_ID": "your_client_id",
"KIOTVIET_CLIENT_SECRET": "your_client_secret",
"KIOTVIET_RETAILER": "your_retailer_name"
}
}
}
}Chạy thủ công
# stdio mode
node dist/cli.js mcp --client-id X --client-secret Y --retailer Z
# HTTP mode
node dist/cli.js mcp --client-id X --client-secret Y --retailer Z --mode http --port 3000Docker
# Build image
docker build -t kiotviet-mcp .
# Chạy container
docker run -d -p 3000:3000 \
-e KIOTVIET_CLIENT_ID=your_client_id \
-e KIOTVIET_CLIENT_SECRET=your_client_secret \
-e KIOTVIET_RETAILER=your_retailer_name \
kiotviet-mcpEndpoints:
Health check:
http://localhost:3000/healthStreamable HTTP (khuyến nghị):
http://localhost:3000/mcpSSE legacy:
http://localhost:3000/sse
Tools
Xem danh sách tools
# Tất cả tools
node dist/cli.js tools
# Theo project
node dist/cli.js tools --project products
# Xem presets
node dist/cli.js tools --presetsDanh sách tools theo nhóm
Nhóm | Tools |
categories |
|
products |
|
customers |
|
customers |
|
orders |
|
invoices |
|
purchase-orders |
|
branches |
|
users |
|
suppliers |
|
bank-accounts |
|
cashbook |
|
webhooks |
|
Presets
Preset | Mô tả | Số tools |
| Tất cả tools | 36 |
| Chỉ GET — an toàn cho môi trường read-only | 21 |
| Hàng hóa + nhóm hàng | 7 |
| Đơn hàng + hóa đơn + khách hàng | 17 |
| Hàng hóa + nhập kho + nhà cung cấp | 11 |
Kích hoạt preset qua CLI:
node dist/cli.js mcp --tools "preset.readonly" ...F&B Mode
Dùng cho nhà hàng, quán cà phê (API F&B):
KIOTVIET_BASE_URL=https://publicfnb.kiotapi.comXác thực
KiotViet dùng OAuth 2.0 Client Credentials. Token có hiệu lực 1 giờ và được tự động làm mới trước khi hết hạn (buffer 5 phút).
Token endpoint: https://id.kiotviet.vn/connect/token
Cấu trúc dự án
src/
├── auth/
│ └── token-manager.ts # Client Credentials + auto-refresh
├── mcp-server/
│ ├── init.ts # Khởi tạo server, đăng ký tools
│ └── transport/
│ ├── stdio.ts # stdio transport
│ └── sse.ts # HTTP/SSE transport
├── mcp-tool/
│ ├── types.ts # McpTool, MiddlewareContext...
│ ├── handler.ts # KiotViet API handler
│ ├── registry.ts # Đăng ký tất cả tools + presets
│ ├── presets.ts # Resolver preset/filter
│ ├── middleware/
│ │ ├── chain.ts
│ │ ├── error-handler.ts
│ │ ├── rate-limiter.ts
│ │ ├── pagination.ts
│ │ └── validation.ts
│ └── tools/ # 13 modules tool definitions
└── utils/
├── config.ts
├── http-client.ts
└── logger.ts
Dockerfile
docker/
└── docker-compose.ymlScripts
npm run build # Build TypeScript → dist/
npm run dev # Chạy trực tiếp với ts-node
npm run format # Format code với Prettier
npm test # Chạy tests
npm run test:coverageGiới hạn API
Thông số | Giá trị |
pageSize tối đa | 100 bản ghi/request |
Token TTL | 3600 giây (1 giờ) |
Webhook timeout | 5 giây |
Base URL Retail |
|
Base URL F&B |
|
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Enable AI assistants to interact seamlessly with Feeef e-commerce stores, products, and orders usi…
Connect AI to store orders, products and inventory with scoped access and human approvals.
Malaysian SME accounting, e-Invoice and payroll for your AI. 77 tools; writes are approved drafts.
Connect AI agents to 1000+ apps with managed authentication and tool-calling.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with the Finizi B4B platform through 15 comprehensive tools for managing business entities, invoices, vendors, and products. Features secure JWT authentication, automatic retries, and full business-to-business workflow integration through natural language commands.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Haravan e-commerce platforms via MCP protocol for natural language management of stores. Provides 7 smart analytics tools for insights and 63 base tools for CRUD operations on products, orders, customers, and inventory.21Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage Vietnamese e-commerce POS operations including orders, products, customers, inventory, supply chain, sales, CRM, and multi-channel integration via Pancake POS API.32MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to manage restaurant operations by integrating with Toast POS, including orders, menus, employees, payments, inventory, and reporting through 50+ tools and 18 React apps.816MIT