gearvn-pages-mcp-server
v1.10.0
Published
MCP Server for GearVN Pages deployment and management
Downloads
125
Maintainers
Readme
GearVN Pages MCP Server
MCP (Model Context Protocol) Server cho việc deploy và quản lý các trang HTML tĩnh lên GearVN Pages.
Cài đặt
Prerequisites
- Node.js 18+
- API key từ GearVN Pages (liên hệ admin để lấy)
Sử dụng với Claude Desktop
Bước 1: Mở file config
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Bước 2: Thêm MCP server config
{
"mcpServers": {
"gearvn-pages": {
"command": "npx",
"args": [
"-y",
"gearvn-pages-mcp-server"
],
"env": {
"API_KEY": "sk-your-api-key-here"
}
}
}
}Bước 3: Restart Claude Desktop
Sử dụng với Cline (VS Code)
Bước 1: Mở VS Code Settings
- Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
- "Preferences: Open User Settings (JSON)"
Bước 2: Thêm config
{
"cline.mcpServers": {
"gearvn-pages": {
"command": "npx",
"args": [
"-y",
"gearvn-pages-mcp-server"
],
"env": {
"API_KEY": "sk-your-api-key-here"
}
}
}
}Bước 3: Reload VS Code
Tính năng
1. deploy-page
Deploy hoặc update một trang HTML tĩnh.
Parameters:
title(string): Tiêu đề của trang - AI Agent tự động generatecontent(string): HTML document đầy đủ với TailwindCSS CDN. JavaScript libraries được phép qua CDN (Alpine.js, Chart.js, GSAP, etc.)slug(string): URL slug - AI Agent tự động generate hoặc dùng slug có sẵn
Workflow:
TẠO TRANG MỚI:
- User: "Tạo website quản lý thu chi"
- AI generate slug đơn giản:
"quan-ly-thu-chi" - AI gọi deploy-page với slug:
"quan-ly-thu-chi" - Backend thêm timestamp:
"quan-ly-thu-chi-1730229600" - URL:
https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600
UPDATE TRANG CŨ:
- User: "Sửa trang quản lý thu chi, thêm tính năng X"
- AI gọi
list-pages→ tìm thấy slug:"quan-ly-thu-chi-1730229600" - AI gọi
deploy-pagevới slug đầy đủ:"quan-ly-thu-chi-1730229600" - Backend update trang cũ (không tạo mới)
- URL giữ nguyên:
https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600
Response:
{
"success": true,
"message": "Page deployed successfully",
"url": "https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-1730229600"
}2. list-pages
Liệt kê tất cả các pages của API key.
Response:
{
"success": true,
"count": 2,
"pages": [
{
"id": 1,
"slug": "my-page-123",
"title": "My Page",
"created_at": "2025-01-20T10:00:00Z",
"updated_at": "2025-01-20T10:00:00Z"
}
]
}Ví dụ sử dụng trong Claude
Ví dụ 1: Tạo website quản lý thu chi cá nhân
Prompt của user (đơn giản):
Sử dụng gearvn-pages để: Tạo cho tôi một trang web quản lý thu chi cá nhân với các tính năng:
- Form thêm giao dịch (loại: thu/chi, số tiền, mô tả, ngày)
- Hiển thị danh sách giao dịch dưới dạng bảng
- Tổng thu, tổng chi, số dư
- Biểu đồ cột thu chi theo tháng (dùng Chart.js)
- Lưu dữ liệu vào localStorage
- Có thể xóa và sửa giao dịch
- Responsive mobileAI Agent sẽ tự động:
- ✅ Generate title: "Quản Lý Thu Chi Cá Nhân"
- ✅ Generate slug: "quan-ly-thu-chi-ca-nhan"
- ✅ Tạo complete HTML document với TailwindCSS CDN
- ✅ Thêm Chart.js CDN để vẽ biểu đồ
- ✅ Code vanilla JavaScript để xử lý logic
- ✅ Deploy và trả về URL
Response:
✅ Đã deploy thành công!
URL: https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-ca-nhanVí dụ 2: Landing page bán hàng
Prompt của user:
Sử dụng gearvn-pages để: Tạo landing page bán khóa học lập trình với:
- Hero section với CTA button
- Sections: Lợi ích, Nội dung khóa học, Giảng viên, Testimonials
- Pricing table với 3 gói
- Form đăng ký
- FooterAI Agent tự động:
- Title: "Landing Page Khóa Học Lập Trình"
- Slug: "landing-page-khoa-hoc-lap-trinh"
- Deploy và trả về URL
Ví dụ 3: Portfolio cá nhân
Prompt của user:
Sử dụng gearvn-pages để: Tạo portfolio website cho developer với:
- About me section
- Skills với progress bars
- Projects showcase với images
- Contact form
- Dark mode toggle (dùng Alpine.js)AI Agent tự động:
- Title: "Portfolio Developer"
- Slug: "portfolio-developer"
- Thêm Alpine.js CDN cho dark mode
- Deploy và trả về URL
Ví dụ 4: Liệt kê các pages đã tạo
Sử dụng gearvn-pages để: Liệt kê tất cả các trang web mà tôi đã deployClaude sẽ hiển thị danh sách pages với title, slug (có timestamp) và thời gian tạo/cập nhật.
Ví dụ 5: Update trang đã tồn tại
Prompt của user:
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ángAI Agent sẽ tự động:
- ✅ Gọi
list-pagesđể tìm trang quản lý thu chi - ✅ Lấy slug đầy đủ có timestamp:
"quan-ly-thu-chi-ca-nhan-1730229600" - ✅ Gọi
deploy-pagevới slug đầy đủ đó - ✅ Backend update trang cũ (không tạo trang mới)
- ✅ URL giữ nguyên:
https://pages.react.uat.gearvn.xyz/pages/quan-ly-thu-chi-ca-nhan-1730229600
Technical Requirements
HTML Structure:
- Complete HTML5 document
- TailwindCSS CDN:
https://cdn.tailwindcss.com - JavaScript libraries via CDN only (Alpine.js, Chart.js, GSAP, etc.)
- No build tools, npm packages, or SPA frameworks
Example HTML Template:
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Title</title>
<script src="https://cdn.tailwindcss.com"></script>
<!-- Additional CDN libraries if needed -->
</head>
<body class="bg-gray-100">
<!-- Your content with Tailwind classes -->
<script>
// Your vanilla JavaScript
</script>
</body>
</html>Troubleshooting
MCP server không xuất hiện
- Kiểm tra config JSON format đúng
- Verify API_KEY trong env
- Restart Claude Desktop / VS Code
- Check console logs: Claude Desktop → View → Toggle Developer Tools
API Key không hoạt động
Liên hệ admin để verify API key còn active.
License
MIT
