Giao diện
@digiforce-nc/plugin-mcp-server
Plugin MCP Server — triển khai Model Context Protocol, biến Digiforce thành tool server cho AI assistants (Claude, GPT, Copilot) truy cập dữ liệu và thực thi thao tác.
Plugin này làm gì?
Model Context Protocol (MCP) là giao thức chuẩn cho phép AI assistants truy cập dữ liệu và công cụ bên ngoài. Plugin biến Digiforce thành MCP server — AI assistant có thể query collection, tạo record, chạy action, và duyệt schema Digiforce qua giao thức MCP chuẩn.
Ba nhiệm vụ chính
| # | Nhiệm vụ | Chi tiết |
|---|---|---|
| 1 | Tool registry | Expose collection CRUD + custom actions thành MCP tools |
| 2 | Schema introspection | Cho AI xem cấu trúc collections, fields, relations |
| 3 | Action execution | Thực thi thao tác trên Digiforce theo yêu cầu AI |
Kiến trúc
Luồng xử lý MCP request
API endpoints
| Endpoint | Mô tả |
|---|---|
mcp:listTools | Danh sách MCP tools có sẵn (tên, mô tả, input schema) |
mcp:callTool | Thực thi MCP tool (tên tool + arguments) |
mcp:listResources | Danh sách MCP resources |
mcp:readResource | Đọc resource data (schema hoặc records) |
mcp:config | Cấu hình MCP server (admin only) |
mcp:auditLog | Xem audit log thao tác AI (admin only) |
Cấu hình
| Tham số | Mô tả |
|---|---|
apiKey | API key để AI assistant xác thực |
enabledCollections | Danh sách collections expose cho AI (mặc định: tất cả) |
readOnly | Chế độ chỉ đọc — AI chỉ query, không tạo/sửa/xóa |
rateLimit | Giới hạn request/phút từ AI |
auditEnabled | Bật/tắt ghi audit log |
Thành phần client
| Thành phần | Mô tả |
|---|---|
MCPConfigForm | Form cấu hình MCP server (Settings → MCP Server) |
MCPToolList | Danh sách tools đã expose — bật/tắt từng tool |
MCPAuditLog | Bảng audit log — xem thao tác AI đã thực hiện |
Dependencies
| Package | Vai trò |
|---|---|
@digiforce-nc/server | Server framework (peer) |
@digiforce-nc/database | Database ORM (peer) |
@digiforce-nc/client | Client UI framework (peer) |
@digiforce-nc/acl | Kiểm tra quyền trước khi thực thi tool |