gearvn-pages-mcp-server 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,21 +69,32 @@ MCP (Model Context Protocol) Server cho việc deploy và quản lý các trang
69
69
  Deploy hoặc update một trang HTML tĩnh.
70
70
 
71
71
  **Parameters:**
72
- - `title` (string): Tiêu đề của trang - **AI Agent tự động generate dựa trên nội dung**
72
+ - `title` (string): Tiêu đề của trang - **AI Agent tự động generate**
73
73
  - `content` (string): HTML document đầy đủ với TailwindCSS CDN. JavaScript libraries được phép qua CDN (Alpine.js, Chart.js, GSAP, etc.)
74
- - `slug` (string): URL slug - **AI Agent tự động generate theo format kebab-case từ title hoặc nội dung**
74
+ - `slug` (string): URL slug - **AI Agent tự động generate hoặc dùng slug sẵn**
75
75
 
76
- **Lưu ý quan trọng:**
77
- - User **KHÔNG cần** cung cấp `title` và `slug`
78
- - AI Agent sẽ tự động generate dựa trên yêu cầu của user
79
- - dụ: "tạo website quản lý thu chi" → title: "Quản Lý Thu Chi", slug: "quan-ly-thu-chi"
76
+ **Workflow:**
77
+
78
+ **TẠO TRANG MỚI:**
79
+ 1. User: "Tạo website quản lý thu chi"
80
+ 2. AI generate slug đơn giản: `"quan-ly-thu-chi"`
81
+ 3. AI gọi deploy-page với slug: `"quan-ly-thu-chi"`
82
+ 4. Backend thêm timestamp: `"quan-ly-thu-chi-1730229600"`
83
+ 5. URL: `https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600`
84
+
85
+ **UPDATE TRANG CŨ:**
86
+ 1. User: "Sửa trang quản lý thu chi, thêm tính năng X"
87
+ 2. AI gọi `list-pages` → tìm thấy slug: `"quan-ly-thu-chi-1730229600"`
88
+ 3. AI gọi `deploy-page` với slug đầy đủ: `"quan-ly-thu-chi-1730229600"`
89
+ 4. Backend update trang cũ (không tạo mới)
90
+ 5. URL giữ nguyên: `https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600`
80
91
 
81
92
  **Response:**
82
93
  ```json
83
94
  {
84
95
  "success": true,
85
96
  "message": "Page deployed successfully",
86
- "url": "https://pages.react.uat.gearvn.xyz/pages/my-page-123"
97
+ "url": "https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600"
87
98
  }
88
99
  ```
89
100
 
@@ -172,13 +183,27 @@ Sử dụng gearvn-pages để: Tạo portfolio website cho developer với:
172
183
  - Thêm Alpine.js CDN cho dark mode
173
184
  - Deploy và trả về URL
174
185
 
175
- ### Liệt kê các pages đã tạo
186
+ ### Ví dụ 4: Liệt kê các pages đã tạo
176
187
 
177
188
  ```
178
189
  Sử dụng gearvn-pages để: Liệt kê tất cả các trang web mà tôi đã deploy
179
190
  ```
180
191
 
181
- Claude sẽ hiển thị danh sách pages với title, slug và thời gian tạo/cập nhật.
192
+ Claude sẽ hiển thị danh sách pages với title, slug (có timestamp) và thời gian tạo/cập nhật.
193
+
194
+ ### Ví dụ 5: Update trang đã tồn tại
195
+
196
+ **Prompt của user:**
197
+ ```
198
+ Sử dụng gearvn-pages để: Sửa trang quản lý thu chi của tôi, thêm tính năng filter theo tháng
199
+ ```
200
+
201
+ **AI Agent sẽ tự động:**
202
+ 1. ✅ Gọi `list-pages` để tìm trang quản lý thu chi
203
+ 2. ✅ Lấy slug đầy đủ có timestamp: `"quan-ly-thu-chi-ca-nhan-1730229600"`
204
+ 3. ✅ Gọi `deploy-page` với slug đầy đủ đó
205
+ 4. ✅ Backend update trang cũ (không tạo trang mới)
206
+ 5. ✅ URL giữ nguyên: `https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-ca-nhan-1730229600`
182
207
 
183
208
  ## Technical Requirements
184
209
 
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-page.d.ts","sourceRoot":"","sources":["../../src/tools/deploy-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI1D,eAAO,MAAM,gBAAgB,EAAE,IAyB9B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO;;;;;GAiCnD"}
1
+ {"version":3,"file":"deploy-page.d.ts","sourceRoot":"","sources":["../../src/tools/deploy-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI1D,eAAO,MAAM,gBAAgB,EAAE,IA2B9B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO;;;;;GAiCnD"}
@@ -11,11 +11,13 @@ export const DEPLOY_PAGE_TOOL = {
11
11
  },
12
12
  content: {
13
13
  type: "string",
14
- description: "The complete HTML content of the page. Must include <!DOCTYPE html>, <html>, <head> with TailwindCSS CDN link (https://cdn.tailwindcss.com), and <body> tags. Use TailwindCSS utility classes for all styling. JavaScript libraries are allowed but must be imported via CDN links in <script> tags (e.g., Alpine.js from CDN, Chart.js from CDN). Vanilla JavaScript is also acceptable. NO build tools, npm packages, or SPA frameworks (React/Vue/Angular). IMPORTANT: Properly escape all special characters in HTML for JSON (\" for double quotes, \\\\ for backslashes, \\n for newlines, etc.). Example: <div class=\"container\"> should be passed as <div class=\\\"container\\\">",
14
+ description: 'The complete HTML content of the page. Must include <!DOCTYPE html>, <html>, <head> with TailwindCSS CDN link (https://cdn.tailwindcss.com), and <body> tags. Use TailwindCSS utility classes for all styling. JavaScript libraries are allowed but must be imported via CDN links in <script> tags (e.g., Alpine.js from CDN, Chart.js from CDN). Vanilla JavaScript is also acceptable. NO build tools, npm packages, or SPA frameworks (React/Vue/Angular). IMPORTANT: Properly escape all special characters in HTML for JSON (" for double quotes, \\\\ for backslashes, \\n for newlines, etc.). Example: <div class="container"> should be passed as <div class=\\"container\\">',
15
15
  },
16
16
  slug: {
17
17
  type: "string",
18
- description: "The URL slug for the page. AI Agent should generate this automatically in kebab-case format based on the title or user's request (e.g., 'quan-ly-thu-chi-ca-nhan', 'landing-page-khoa-hoc'). This will be used in the URL as /pages/{slug}",
18
+ description: "The URL slug for the page. IMPORTANT BEHAVIOR: " +
19
+ "Generate a simple kebab-case slug (e.g., 'quan-ly-thu-chi', 'landing-page')." +
20
+ "FOR UPDATING EXISTING PAGES: Use the EXACT full slug including timestamp (e.g., 'quan-ly-thu-chi-1730229600') from the backend response. ",
19
21
  },
20
22
  },
21
23
  required: ["title", "content", "slug"],
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-page.js","sourceRoot":"","sources":["../../src/tools/deploy-page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,6sBAA6sB;IAC/sB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6FAA6F;aAChG;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8pBAA8pB;aACjqB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4OAA4O;aAC/O;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAa;IAClD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAsB,CAAC;IAExD,kBAAkB;IAClB,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;IACJ,CAAC;IAED,sBAAsB;IACtB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAqB,YAAY,EAAE,MAAM,EAAE;QACvE,KAAK;QACL,OAAO;QACP,IAAI;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E,MAAM,EAAE;QACvE,KAAK;QACL,OAAO;QACP,IAAI;KACL,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oBACE,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,4BAA4B;oBACrC,GAAG,EAAE,QAAQ,CAAC,GAAG;iBAClB,EACD,IAAI,EACJ,CAAC,CACF;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearvn-pages-mcp-server",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "MCP Server for GearVN Pages deployment and management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,12 +17,14 @@ export const DEPLOY_PAGE_TOOL: Tool = {
17
17
  content: {
18
18
  type: "string",
19
19
  description:
20
- "The complete HTML content of the page. Must include <!DOCTYPE html>, <html>, <head> with TailwindCSS CDN link (https://cdn.tailwindcss.com), and <body> tags. Use TailwindCSS utility classes for all styling. JavaScript libraries are allowed but must be imported via CDN links in <script> tags (e.g., Alpine.js from CDN, Chart.js from CDN). Vanilla JavaScript is also acceptable. NO build tools, npm packages, or SPA frameworks (React/Vue/Angular). IMPORTANT: Properly escape all special characters in HTML for JSON (\" for double quotes, \\\\ for backslashes, \\n for newlines, etc.). Example: <div class=\"container\"> should be passed as <div class=\\\"container\\\">",
20
+ 'The complete HTML content of the page. Must include <!DOCTYPE html>, <html>, <head> with TailwindCSS CDN link (https://cdn.tailwindcss.com), and <body> tags. Use TailwindCSS utility classes for all styling. JavaScript libraries are allowed but must be imported via CDN links in <script> tags (e.g., Alpine.js from CDN, Chart.js from CDN). Vanilla JavaScript is also acceptable. NO build tools, npm packages, or SPA frameworks (React/Vue/Angular). IMPORTANT: Properly escape all special characters in HTML for JSON (" for double quotes, \\\\ for backslashes, \\n for newlines, etc.). Example: <div class="container"> should be passed as <div class=\\"container\\">',
21
21
  },
22
22
  slug: {
23
23
  type: "string",
24
24
  description:
25
- "The URL slug for the page. AI Agent should generate this automatically in kebab-case format based on the title or user's request (e.g., 'quan-ly-thu-chi-ca-nhan', 'landing-page-khoa-hoc'). This will be used in the URL as /pages/{slug}",
25
+ "The URL slug for the page. IMPORTANT BEHAVIOR: " +
26
+ "Generate a simple kebab-case slug (e.g., 'quan-ly-thu-chi', 'landing-page')." +
27
+ "FOR UPDATING EXISTING PAGES: Use the EXACT full slug including timestamp (e.g., 'quan-ly-thu-chi-1730229600') from the backend response. ",
26
28
  },
27
29
  },
28
30
  required: ["title", "content", "slug"],