GPMLogin MCP
by opendeti
README.md
# GPMLogin MCP (`@deti/gpmlogin-mcp`)
Plugin MCP chuẩn **kho plugin Deti** (transport `stdio`, khai báo tại [`deti-plugin.json`](deti-plugin.json)) kết nối trực tiếp tới **API MCP gốc (Streamable HTTP, MCP 2025-03-26)** của **GPMLogin Global phiên bản mới (v5.1+)**.
## Tính năng chính
- **Bọc trọn bộ 20 công cụ MCP gốc của GPMLogin v5.1+:** quản lý profile (liệt kê, xem fingerprint, tạo, cập nhật, xoá mềm/cứng, khởi chạy, đóng, tra phiên bản Chromium/Firefox), nhóm (`group`), proxy (`proxy`), và extension (`extension`).
- **Đa phiên / Đa máy chủ GPMLogin (`instanceId`):** lưu nhiều kết nối GPMLogin (cục bộ `127.0.0.1:9495` hoặc nhiều cổng/VPS từ xa) trong `$DETI_PLUGIN_DATA_DIR/instances.json`, mỗi instance giữ phiên `Mcp-Session-Id` riêng, tự động khởi tạo lại phiên khi GPMLogin khởi động lại.
- **Khởi chạy & đóng nhiều profile song song:** hỗ trợ `gpm_start_profiles_batch` (giới hạn `concurrency`, tự xếp lưới cửa sổ `tileLayout`, trả về `remote_debugging_port` & `websocket_debugging_url` từng profile), `gpm_stop_profiles_batch`, và `gpm_list_running_profiles` (kèm kiểm tra CDP `/json/version`).
- **Bảo mật & an toàn:**
- Không lưu cứng Bearer token trong mã nguồn; luôn che token và mật khẩu proxy trong log, lỗi và output (`tokenPreview: "abcd...wxyz"`).
- Khóa an toàn `gpm_delete_profile`: mặc định `mode: "soft"` (thùng rác); chặn `mode: "hard"` nếu thiếu `confirmHardDelete: true`.
- **Tương thích tương lai:** tích hợp `gpm_list_upstream_tools` và `gpm_call_raw` để gọi ngay các công cụ mới khi GPMLogin cập nhật.
## Cài đặt & kiểm tra
```bash
cd gpmlogin-mcp
npm install
npm run check
```
Lưu kết nối GPMLogin cục bộ qua CLI (hoặc truyền biến môi trường `GPMLOGIN_MCP_URL` + `GPMLOGIN_API_TOKEN`):
```bash
# Đặt token qua biến môi trường để tránh lưu vào lịch sử dòng lệnh
$env:GPMLOGIN_API_TOKEN = "<YOUR_GPMLOGIN_BEARER_TOKEN>"
npm run cli -- instance save default --url http://127.0.0.1:9495/mcp --label "GPMLogin Local" --default
npm run doctor
```
## Danh sách công cụ MCP (`30` tool `gpm_*`)
| Nhóm | Công cụ |
|---|---|
| Chẩn đoán & Kết nối | `gpm_doctor`, `gpm_list_instances`, `gpm_instance_save`, `gpm_set_default_instance`, `gpm_instance_remove`, `gpm_list_upstream_tools`, `gpm_call_raw` |
| Profile & Đa luồng CDP | `gpm_list_profiles`, `gpm_get_profile`, `gpm_create_profile`, `gpm_update_profile`, `gpm_delete_profile`, `gpm_start_profile`, `gpm_stop_profile`, `gpm_list_browser_versions`, `gpm_start_profiles_batch`, `gpm_stop_profiles_batch`, `gpm_list_running_profiles` |
| Nhóm (Groups) | `gpm_list_groups`, `gpm_get_group`, `gpm_create_group`, `gpm_update_group`, `gpm_delete_group` |
| Proxy | `gpm_list_proxies`, `gpm_get_proxy`, `gpm_create_proxy`, `gpm_update_proxy`, `gpm_delete_proxy` |
| Extension | `gpm_list_extensions`, `gpm_set_extension_state` |
## Biến môi trường hỗ trợ
| Biến | Mặc định | Mô tả |
|---|---|---|
| `DETI_PLUGIN_DATA_DIR` | Thư mục dữ liệu người dùng theo HĐH | Lưu `instances.json` |
| `GPMLOGIN_MCP_DATA_DIR` | *(dự phòng khi chưa có `DETI_PLUGIN_DATA_DIR`)* | Thư mục dữ liệu cục bộ |
| `GPMLOGIN_MCP_URL` | `http://127.0.0.1:9495/mcp` | URL endpoint MCP HTTP của GPMLogin |
| `GPMLOGIN_API_TOKEN` | *(trống)* | Bearer token dự phòng nếu chưa lưu trong `instances.json` |
| `GPMLOGIN_MCP_TIMEOUT_MS` | `25000` | Timeout mặc định (ms) |
| `GPMLOGIN_MCP_START_TIMEOUT_MS` | `60000` | Timeout cho lệnh `start_profile` (ms) |
| `GPMLOGIN_MCP_LOG_LEVEL` | `info` | `debug \| info \| warn \| error \| silent` |
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues