{
  "server_name": "clogin-mcp",
  "protocol_version": "2025-03-26",
  "version": "1.0.1",
  "tools": [
    {
      "name": "clogin_status",
      "category": "Hệ thống",
      "description": "Xem trạng thái Clogin: phiên bản, cổng API/MCP, số profile, số trình duyệt đang chạy, proxy và thư mục.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_list_profiles",
      "category": "Profiles",
      "description": "Liệt kê các profile trình duyệt trong Clogin kèm trạng thái running, PID và địa chỉ CDP. Có thể lọc theo folder, từ khóa hoặc chỉ profile đang chạy.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "folder": { "type": "string", "description": "Chỉ lấy profile trong thư mục này (tùy chọn)" },
          "search": { "type": "string", "description": "Tìm theo tên, ghi chú hoặc ID (tùy chọn)" },
          "running_only": { "type": "boolean", "description": "Chỉ trả về profile đang mở (mặc định false)" }
        }
      }
    },
    {
      "name": "clogin_get_profile",
      "category": "Profiles",
      "description": "Xem chi tiết toàn bộ cấu hình và thông tin CDP của một profile theo profile_id.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID của profile" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_create_profile",
      "category": "Profiles",
      "description": "Tạo profile trình duyệt anti-detect mới với vân tay chuẩn tự sinh từ kho 1.001 thiết bị của Clogin.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Tên profile" },
          "platform": { "type": "string", "description": "windows | macos | linux | android (mặc định theo máy hiện tại)" },
          "folder": { "type": "string", "description": "Tên thư mục lưu profile (tùy chọn)" },
          "notes": { "type": "string", "description": "Ghi chú (tùy chọn)" },
          "proxy": { "type": "string", "description": "Chuỗi proxy vd socks5://user:pass@host:port (tùy chọn)" },
          "proxy_id": { "type": "string", "description": "ID proxy đã có trong Clogin (tùy chọn)" },
          "color": { "type": "string", "description": "Màu nhận diện #rrggbb (tùy chọn)" },
          "refresh_rate": { "type": "integer", "description": "Tần số quét màn hình Hz (24-480, tùy chọn)" }
        },
        "required": ["name"]
      }
    },
    {
      "name": "clogin_create_temp_profile",
      "category": "Profiles",
      "description": "Tạo profile tạm (ẩn, tự động xóa sạch dữ liệu ngay sau khi đóng trình duyệt).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Tên phiên tạm (tùy chọn)" },
          "platform": { "type": "string", "description": "windows | macos | linux | android" },
          "proxy": { "type": "string", "description": "Proxy dùng riêng cho phiên tạm (tùy chọn)" }
        }
      }
    },
    {
      "name": "clogin_edit_profile",
      "category": "Profiles",
      "description": "Cập nhật thông tin một profile (tên, ghi chú, thư mục, proxy, màu sắc, tần số quét).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile cần sửa" },
          "name": { "type": "string" },
          "notes": { "type": "string" },
          "folder": { "type": "string", "description": "Chuỗi rỗng để bỏ khỏi thư mục" },
          "proxy_id": { "type": "string", "description": "Chuỗi rỗng để gỡ proxy" },
          "proxy": { "type": "string", "description": "Chuỗi proxy mới để lưu và gán" },
          "color": { "type": "string" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_delete_profile",
      "category": "Profiles",
      "description": "Chuyển một profile vào Thùng rác (có thể khôi phục lại).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_start_profile",
      "category": "Profiles",
      "description": "Khởi chạy trình duyệt cho profile với CDP bật sẵn. Trả về PID và web_socket_debugger_url để điều khiển trang.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile cần mở" },
          "headless": { "type": "boolean", "description": "Chạy ẩn không hiện cửa sổ (mặc định false)" },
          "fresh": { "type": "boolean", "description": "Mở sạch không khôi phục tab cũ (mặc định false)" },
          "proxy": { "type": "string", "description": "Ghi đè proxy chỉ cho lần mở này (tùy chọn)" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_stop_profile",
      "category": "Profiles",
      "description": "Đóng trình duyệt của một profile đang chạy.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile cần đóng" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_list_running",
      "category": "Profiles",
      "description": "Liệt kê toàn bộ trình duyệt đang chạy cùng PID và thông tin kết nối CDP.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_browser_tabs",
      "category": "Trình duyệt (CDP)",
      "description": "Liệt kê các tab/trang đang mở bên trong trình duyệt của một profile đang chạy.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_browser_navigate",
      "category": "Trình duyệt (CDP)",
      "description": "Điều hướng tab đang mở tới một URL mới (hoặc mở tab mới nếu new_tab=true).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "url": { "type": "string", "description": "Đường dẫn web (vd https://example.com)" },
          "target_id": { "type": "string", "description": "ID tab cụ thể từ clogin_browser_tabs (tùy chọn)" },
          "new_tab": { "type": "boolean", "description": "Mở ở tab mới (mặc định false)" }
        },
        "required": ["profile_id", "url"]
      }
    },
    {
      "name": "clogin_browser_eval",
      "category": "Trình duyệt (CDP)",
      "description": "Thực thi mã JavaScript trực tiếp trong tab trình duyệt của profile qua CDP và trả về kết quả.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "expression": { "type": "string", "description": "Biểu thức JS (hỗ trợ Promise/await)" },
          "target_id": { "type": "string", "description": "ID tab cụ thể (tùy chọn)" }
        },
        "required": ["profile_id", "expression"]
      }
    },
    {
      "name": "clogin_browser_dom_text",
      "category": "Trình duyệt (CDP)",
      "description": "Đọc nhanh tiêu đề, URL, nội dung văn bản hiển thị và các nút/link/ô nhập liệu chính trên trang hiện tại.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "target_id": { "type": "string", "description": "ID tab cụ thể (tùy chọn)" },
          "max_chars": { "type": "integer", "description": "Giới hạn ký tự văn bản trả về (mặc định 8000)" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_browser_click",
      "category": "Trình duyệt (CDP)",
      "description": "Tìm và click vào phần tử trên trang theo CSS selector (tự cuộn vào khung nhìn).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "selector": { "type": "string", "description": "CSS selector của phần tử cần click" },
          "target_id": { "type": "string", "description": "ID tab cụ thể (tùy chọn)" }
        },
        "required": ["profile_id", "selector"]
      }
    },
    {
      "name": "clogin_browser_type",
      "category": "Trình duyệt (CDP)",
      "description": "Nhập văn bản vào ô input/textarea theo CSS selector (phát sự kiện input/change chuẩn React/Vue).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "selector": { "type": "string", "description": "CSS selector của ô nhập" },
          "text": { "type": "string", "description": "Nội dung cần nhập" },
          "clear": { "type": "boolean", "description": "Xóa nội dung cũ trước khi nhập (mặc định true)" },
          "submit": { "type": "boolean", "description": "Nhấn Enter / submit form sau khi nhập (mặc định false)" },
          "target_id": { "type": "string", "description": "ID tab cụ thể (tùy chọn)" }
        },
        "required": ["profile_id", "selector", "text"]
      }
    },
    {
      "name": "clogin_browser_screenshot",
      "category": "Trình duyệt (CDP)",
      "description": "Chụp ảnh màn hình tab đang mở dưới dạng PNG (trả về chuẩn MCP image cho AI Vision).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string", "description": "ID profile đang chạy" },
          "target_id": { "type": "string", "description": "ID tab cụ thể (tùy chọn)" },
          "full_page": { "type": "boolean", "description": "Chụp toàn trang cuộn (mặc định false)" }
        },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_export_cookies",
      "category": "Cookies",
      "description": "Xuất toàn bộ cookies đã lưu của một profile.",
      "inputSchema": {
        "type": "object",
        "properties": { "profile_id": { "type": "string" } },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_import_cookies",
      "category": "Cookies",
      "description": "Nhập cookies vào profile đang đóng (hỗ trợ chuỗi Netscape, JSON, hoặc Facebook cookie).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile_id": { "type": "string" },
          "text": { "type": "string", "description": "Chuỗi cookie (JSON / Netscape / FB)" }
        },
        "required": ["profile_id", "text"]
      }
    },
    {
      "name": "clogin_list_folders",
      "category": "Thư mục",
      "description": "Liệt kê tất cả thư mục hiện có trong Clogin.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_rename_folder",
      "category": "Thư mục",
      "description": "Đổi tên một thư mục profile.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "old_name": { "type": "string" },
          "new_name": { "type": "string" }
        },
        "required": ["old_name", "new_name"]
      }
    },
    {
      "name": "clogin_delete_folder",
      "category": "Thư mục",
      "description": "Xóa thư mục (mặc định giữ lại profile và bỏ phân loại; đặt delete_profiles=true để xóa cả profile).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "folder": { "type": "string" },
          "delete_profiles": { "type": "boolean" }
        },
        "required": ["folder"]
      }
    },
    {
      "name": "clogin_list_fingerprints",
      "category": "Fingerprint",
      "description": "Tìm kiếm và liệt kê các mẫu vân tay thiết bị trong kho Clogin.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "platform": { "type": "string", "description": "Windows | macOS | Linux | Android" },
          "query": { "type": "string", "description": "Từ khóa GPU / tên thiết bị" },
          "limit": { "type": "integer", "description": "Số lượng tối đa (mặc định 30)" }
        }
      }
    },
    {
      "name": "clogin_new_fingerprint",
      "category": "Fingerprint",
      "description": "Sinh ngẫu nhiên một bộ cấu hình vân tay thiết bị mới theo nền tảng.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "platform": { "type": "string", "description": "windows | macos | linux | android" }
        }
      }
    },
    {
      "name": "clogin_list_proxies",
      "category": "Proxy",
      "description": "Liệt kê danh sách proxy đã lưu trong Clogin (ẩn mật khẩu).",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_add_proxy",
      "category": "Proxy",
      "description": "Thêm proxy mới vào thư viện (hỗ trợ chuỗi scheme://user:pass@host:port hoặc host:port:user:pass).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "proxy": { "type": "string", "description": "Chuỗi proxy" },
          "name": { "type": "string", "description": "Tên gợi nhớ (tùy chọn)" },
          "country": { "type": "string", "description": "Mã quốc gia vd VN, US (tùy chọn)" }
        },
        "required": ["proxy"]
      }
    },
    {
      "name": "clogin_test_proxy",
      "category": "Proxy",
      "description": "Kiểm tra kết nối TCP, UDP và GeoIP của một proxy đã lưu theo proxy_id.",
      "inputSchema": {
        "type": "object",
        "properties": { "proxy_id": { "type": "string" } },
        "required": ["proxy_id"]
      }
    },
    {
      "name": "clogin_delete_proxy",
      "category": "Proxy",
      "description": "Xóa một proxy khỏi thư viện theo proxy_id.",
      "inputSchema": {
        "type": "object",
        "properties": { "proxy_id": { "type": "string" } },
        "required": ["proxy_id"]
      }
    },
    {
      "name": "clogin_list_extensions",
      "category": "Tiện ích & Dấu trang",
      "description": "Liệt kê thư viện tiện ích mở rộng (extensions) của Clogin.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_list_bookmarks",
      "category": "Tiện ích & Dấu trang",
      "description": "Liệt kê dấu trang (bookmarks) quản lý tập trung.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_save_bookmark",
      "category": "Tiện ích & Dấu trang",
      "description": "Thêm hoặc cập nhật một dấu trang.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "url": { "type": "string" },
          "title": { "type": "string" },
          "folder": { "type": "string" }
        },
        "required": ["url"]
      }
    },
    {
      "name": "clogin_list_trash",
      "category": "Thùng rác",
      "description": "Liệt kê các profile đang nằm trong Thùng rác.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_restore_trash",
      "category": "Thùng rác",
      "description": "Khôi phục một profile từ Thùng rác theo profile_id.",
      "inputSchema": {
        "type": "object",
        "properties": { "profile_id": { "type": "string" } },
        "required": ["profile_id"]
      }
    },
    {
      "name": "clogin_list_automations",
      "category": "Tự động hoá",
      "description": "Liệt kê các dự án kịch bản tự động hoá trong Clogin.",
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "clogin_run_automation",
      "category": "Tự động hoá",
      "description": "Khởi chạy một dự án tự động hoá theo project_id.",
      "inputSchema": {
        "type": "object",
        "properties": { "project_id": { "type": "string" } },
        "required": ["project_id"]
      }
    },
    {
      "name": "clogin_stop_automation",
      "category": "Tự động hoá",
      "description": "Dừng dự án tự động hoá đang chạy theo project_id.",
      "inputSchema": {
        "type": "object",
        "properties": { "project_id": { "type": "string" } },
        "required": ["project_id"]
      }
    },
    {
      "name": "clogin_automation_status",
      "category": "Tự động hoá",
      "description": "Xem tiến độ và trạng thái các worker của dự án tự động hoá (bỏ trống project_id để xem tất cả phiên đang chạy).",
      "inputSchema": {
        "type": "object",
        "properties": { "project_id": { "type": "string" } }
      }
    }
  ],
  "resources": [
    {
      "uri": "clogin://status",
      "name": "Clogin Status",
      "description": "Trạng thái hiện tại của Clogin, số profile, proxy và trình duyệt đang mở",
      "mimeType": "application/json"
    },
    {
      "uri": "clogin://profiles",
      "name": "Clogin Profiles",
      "description": "Danh sách toàn bộ profile cùng trạng thái running & CDP",
      "mimeType": "application/json"
    },
    {
      "uri": "clogin://running",
      "name": "Running Browsers",
      "description": "Các trình duyệt đang chạy kèm PID và WebSocket CDP",
      "mimeType": "application/json"
    },
    {
      "uri": "clogin://proxies",
      "name": "Saved Proxies",
      "description": "Thư viện proxy đã cấu hình trong Clogin",
      "mimeType": "application/json"
    },
    {
      "uri": "clogin://folders",
      "name": "Profile Folders",
      "description": "Danh sách các thư mục profile",
      "mimeType": "application/json"
    }
  ]
}
