### Install Local Development Dependencies Source: https://github.com/sekinal/camoufox-mcp/blob/master/README.md Commands to set up the local development environment, including dependency installation via uv and browser binary setup. ```bash cd camoufox-mcp uv sync uv run python -c "from camoufox.sync_api import Camoufox; print('OK')" uv run playwright install firefox ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/sekinal/camoufox-mcp/blob/master/README.md Example configuration for the .env file to manage VNC settings, screenshot storage, and browser behavior. ```bash ENABLE_VNC=true VNC_PORT=5900 NOVNC_PORT=6080 CAMOUFOX_SCREENSHOT_DIR=/tmp/camoufox_screenshots CAMOUFOX_SCREENSHOT_AUTO_SAVE=true ``` -------------------------------- ### Deploy Camoufox MCP Server with Docker Source: https://github.com/sekinal/camoufox-mcp/blob/master/README.md Commands to start the Camoufox MCP server using Docker Compose or direct Docker execution. Includes options for VNC debugging and standard headless operation. ```bash # Start the server docker compose up -d camoufox # Or with VNC debugging docker compose --profile debug up -d ``` ```bash # Build the image docker build -t camoufox-mcp . # Run for MCP docker run -i --rm camoufox-mcp ``` -------------------------------- ### Get HTML Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves the HTML content of an element or the entire page, with options for inner or outer HTML. ```APIDOC ## GET /get_html ### Description Retrieves the HTML content of a specified element or the entire page. ### Method GET ### Endpoint /get_html ### Parameters #### Query Parameters - **selector** (string) - Optional - The CSS selector of the element for which to get HTML. If omitted, returns the full page HTML. - **outer** (boolean) - Optional - If true, returns the outer HTML (including the element itself). If false, returns the inner HTML. Defaults to true. ### Request Example ```json { "selector": ".product-card", "outer": true } ``` ### Response #### Success Response (200) - **html** (string) - The retrieved HTML content. ``` -------------------------------- ### Get Text Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Extracts text content from a specified element or the entire page. ```APIDOC ## GET /get_text ### Description Extracts the text content from an element or the entire page. ### Method GET ### Endpoint /get_text ### Parameters #### Query Parameters - **selector** (string) - Optional - The CSS selector of the element from which to extract text. If omitted, extracts all page text. ### Request Example ```json { "selector": ".article-body" } ``` ### Response #### Success Response (200) - **text** (string) - The extracted text content. ``` -------------------------------- ### Get Attribute Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves the value of a specific attribute from an element. ```APIDOC ## GET /get_attribute ### Description Retrieves the value of a specified attribute from an element. ### Method GET ### Endpoint /get_attribute ### Parameters #### Query Parameters - **selector** (string) - Required - The CSS selector of the element. - **attribute** (string) - Required - The name of the attribute to retrieve (e.g., 'href', 'src', 'value'). ### Request Example ```json { "selector": "a.download-link", "attribute": "href" } ``` ### Response #### Success Response (200) - **value** (string) - The value of the specified attribute. ``` -------------------------------- ### Click Element by ARIA Role Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Clicks an element identified by its ARIA role and accessible name, promoting accessibility in automation. Examples include clicking buttons or links. ```javascript await click_role(role="button", name="Submit Form") await click_role(role="link", name="Home") ``` -------------------------------- ### Get Element Attribute Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves the value of a specific attribute from a given element. Requires the element's selector and the attribute name. ```javascript await get_attribute(selector="a.download-link", attribute="href") ``` -------------------------------- ### Fill by Placeholder Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Finds an input element by its placeholder text and fills it. ```APIDOC ## POST /fill_placeholder ### Description Finds an input element using its placeholder text and fills it with the provided value. ### Method POST ### Endpoint /fill_placeholder ### Parameters #### Query Parameters - **placeholder** (string) - Required - The placeholder text of the input field. - **value** (string) - Required - The value to fill into the input field. ### Request Example ```json { "placeholder": "Search...", "value": "query" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Filled input with placeholder 'Search...'"). ``` -------------------------------- ### Keyboard Actions Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Simulates keyboard input, including shortcuts and typing on specific elements. ```APIDOC ## POST /press_key ### Description Simulates pressing a keyboard key or a key combination. ### Method POST ### Endpoint /press_key ### Parameters #### Query Parameters - **key** (string) - Required - The key or key combination to press (e.g., 'Control+a', 'Tab'). - **selector** (string) - Optional - The CSS selector of the element to focus on before pressing the key. ### Request Example ```json { "key": "Control+a" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Pressed key: Control+a"). ``` -------------------------------- ### Analyze resource loading performance Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Evaluates page load performance, including DNS lookup, TTFB, and render-blocking resources. Provides a breakdown of resource types and sizes. ```python await analyze_resource_loading() ``` -------------------------------- ### Browser Navigation Actions Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Provides functionalities for navigating the browser, including going to a specific URL with wait conditions, reloading the current page, moving back and forth through history, and retrieving the current URL or page title. ```python await goto( url="https://example.com", wait_until="networkidle", timeout=30000 ) await reload(wait_until="domcontentloaded") await go_back() await go_forward() await get_url() await get_page_title() ``` -------------------------------- ### Inject initialization scripts for API hooking Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Injects custom JavaScript that executes before page scripts load. This is primarily used to modify browser properties to bypass anti-bot detection mechanisms. ```python await inject_init_script( script=""" Object.defineProperty(navigator, 'webdriver', { get: () => undefined }); """, name="hide-webdriver" ) ``` -------------------------------- ### Manage Browser Pages/Tabs Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Handles the creation, switching, and listing of browser pages (tabs). New pages can be created with unique IDs for parallel operations or multi-step workflows. Users can switch between existing pages and retrieve a list of all open pages with their status. ```python await new_page(page_id="search") await new_page(page_id="checkout") await switch_page(page_id="search") await list_pages() ``` -------------------------------- ### Batch Actions Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Executes multiple actions in a single, efficient call. ```APIDOC ## POST /batch_actions ### Description Executes a sequence of actions in a single API call. The sequence stops if any action fails. ### Method POST ### Endpoint /batch_actions ### Parameters #### Request Body - **actions** (array) - Required - A list of action objects to execute. - Each object should have an `action` key (e.g., 'click', 'fill', 'type', 'press', 'select', 'check', 'uncheck', 'hover', 'wait', 'wait_for') and other relevant parameters for that action. ### Request Example ```json { "actions": [ {"action": "fill", "selector": "#username", "value": "john"}, {"action": "fill", "selector": "#password", "value": "secret123"}, {"action": "check", "selector": "#remember-me"}, {"action": "wait", "ms": 500}, {"action": "click", "selector": "button[type='submit']"} ] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message detailing the actions performed (e.g., "Completed 5 actions: filled #username, filled #password, checked #remember-me, waited 500ms, clicked button[type='submit']"). ``` -------------------------------- ### Launch and Close Camoufox Browser Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Launches or closes the Camoufox browser instance. Launch options include headless mode, proxy configuration, OS spoofing, humanized cursor movement, and image blocking. Closing the browser cleans up all associated resources. ```python await launch_browser() await launch_browser( headless=False, proxy_server="http://proxy.example.com:8080", proxy_username="user", proxy_password="secret", os_type="windows", humanize=True, block_images=True, locale="en-US" ) await close_browser() ``` -------------------------------- ### Wait for Browser States and Conditions Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Provides various synchronization utilities to pause execution until specific page conditions, network states, or element visibility criteria are met. ```python await wait_for_selector(selector=".loading-spinner", state="hidden") await wait_for_selector(selector=".results", state="visible", timeout=10000) await wait_for_load_state(state="networkidle") await wait(milliseconds=2000) await wait_for_url(url_pattern="/dashboard") await wait_for_function(expression="() => document.querySelector('.data-loaded') !== null", timeout=10000) ``` -------------------------------- ### Waiting Utilities Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Provides functions to pause execution until specific conditions are met, ensuring synchronization with page states or element availability. ```APIDOC ## POST /wait_for_selector ### Description Wait for an element to reach a specific state. ### Method POST ### Endpoint /wait_for_selector ### Parameters #### Request Body - **selector** (string) - Required - CSS selector for the target element. - **state** (string) - Required - The desired state of the element ('visible', 'hidden', 'attached', 'detached'). - **timeout** (integer) - Optional - Maximum time in milliseconds to wait. ### Request Example ```json { "selector": ".loading-spinner", "state": "hidden" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the element reached the specified state. #### Response Example ```json { "message": "Element '.loading-spinner' is now hidden." } ``` ## POST /wait_for_load_state ### Description Wait for the page to reach a specific load state. ### Method POST ### Endpoint /wait_for_load_state ### Parameters #### Request Body - **state** (string) - Required - The desired load state ('start', 'ready', 'load', 'domcontentloaded', 'networkidle'). - **timeout** (integer) - Optional - Maximum time in milliseconds to wait. ### Request Example ```json { "state": "networkidle" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the page reached the specified state. #### Response Example ```json { "message": "Page reached 'networkidle' state." } ``` ## POST /wait ### Description Wait for a specified duration. ### Method POST ### Endpoint /wait ### Parameters #### Request Body - **milliseconds** (integer) - Required - The duration to wait in milliseconds. ### Request Example ```json { "milliseconds": 2000 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the wait duration. #### Response Example ```json { "message": "Waited 2000ms." } ``` ## POST /wait_for_url ### Description Wait for the page URL to match a pattern. ### Method POST ### Endpoint /wait_for_url ### Parameters #### Request Body - **url_pattern** (string) - Required - The URL pattern to match (can be a string or a regular expression). ### Request Example ```json { "url_pattern": "/dashboard" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the URL matched the pattern. #### Response Example ```json { "message": "URL matched pattern. Current URL: https://example.com/dashboard" } ``` ## POST /wait_for_function ### Description Wait for a JavaScript condition to become truthy. ### Method POST ### Endpoint /wait_for_function ### Parameters #### Request Body - **expression** (string) - Required - JavaScript expression that should evaluate to a truthy value. - **timeout** (integer) - Optional - Maximum time in milliseconds to wait. ### Request Example ```json { "expression": "() => document.querySelector('.data-loaded') !== null" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the function returned a truthy value. #### Response Example ```json { "message": "Function returned truthy value." } ``` ``` -------------------------------- ### Configure Camoufox environment variables Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Defines the operational parameters for the Camoufox server, including logging levels, browser viewport settings, timeouts, and network capture behavior. ```bash CAMOUFOX_LOG_LEVEL=INFO CAMOUFOX_HEADLESS=true CAMOUFOX_HUMANIZE=true CAMOUFOX_VIEWPORT_WIDTH=1920 CAMOUFOX_VIEWPORT_HEIGHT=1080 CAMOUFOX_TIMEOUT_NAVIGATION=30000 CAMOUFOX_NETWORK_CAPTURE=true ``` -------------------------------- ### Fill Input by Placeholder Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Fills an input field based on its placeholder text. This is useful when labels are not present or easily selectable. ```javascript await fill_placeholder(placeholder="Search...", value="query") ``` -------------------------------- ### Navigation API Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Endpoints for controlling page navigation and history. ```APIDOC ## POST /goto ### Description Navigate to a specific URL with configurable wait conditions. ### Method POST ### Parameters #### Request Body - **url** (string) - Required - The target URL. - **wait_until** (string) - Optional - Wait condition (load, domcontentloaded, networkidle). - **timeout** (integer) - Optional - Timeout in milliseconds. ### Response #### Success Response (200) - **success** (boolean) - Navigation status. - **status** (integer) - HTTP status code. - **url** (string) - Final URL. ``` -------------------------------- ### Screenshot and Viewport Management Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Functions to capture visual snapshots of the page or specific elements and to configure the browser viewport dimensions. ```python await screenshot(full_page=True, path="/tmp/full-page.png") await set_viewport_size(width=1280, height=720) ``` -------------------------------- ### Fill Form Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Fills multiple form fields simultaneously and optionally submits the form. ```APIDOC ## POST /fill_form ### Description Fills multiple form fields at once and can optionally submit the form using a specified selector. ### Method POST ### Endpoint /fill_form ### Parameters #### Request Body - **fields** (object) - Required - A key-value map where keys are CSS selectors for input fields and values are the data to fill. - **submit_selector** (string) - Optional - The CSS selector of the submit button to click after filling the fields. ### Request Example ```json { "fields": { "#first-name": "John", "#last-name": "Doe", "#email": "john@example.com", "#phone": "555-1234" }, "submit_selector": "button.submit" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Filled 4 fields, clicked button.submit"). ``` -------------------------------- ### Hover Action Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Simulates hovering over an element to trigger hover states or tooltips. ```APIDOC ## POST /hover ### Description Simulates hovering the mouse pointer over a specified element. ### Method POST ### Endpoint /hover ### Parameters #### Query Parameters - **selector** (string) - Required - The CSS selector of the element to hover over. ### Request Example ```json { "selector": ".dropdown-trigger" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Hovering over: .dropdown-trigger"). ``` -------------------------------- ### Press Keyboard Shortcut Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Simulates pressing keyboard shortcuts like Ctrl+A. It can target the entire page or a specific element using a CSS selector. ```javascript await press_key(key="Control+a") # Select all await press_key(key="Tab", selector="#username") ``` -------------------------------- ### Configure Claude Code for Camoufox Source: https://github.com/sekinal/camoufox-mcp/blob/master/README.md JSON configuration snippets for the ~/.claude/settings.json file to integrate the Camoufox MCP server via Docker or local Python execution. ```json { "mcpServers": { "camoufox": { "command": "docker", "args": ["run", "-i", "--rm", "camoufox-mcp"] } } } ``` ```json { "mcpServers": { "camoufox": { "command": "uv", "args": ["--directory", "/absolute/path/to/camoufox-mcp", "run", "python", "main.py"] } } } ``` -------------------------------- ### Track browser state changes with snapshots Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Captures the browser state before an action and compares it afterwards to identify changes in cookies, localStorage, DOM, and network activity. This is useful for debugging automation workflows and verifying data persistence. ```python await snapshot_state(snapshot_id="before_login") await fill_form(fields={"#email": "user@example.com", "#password": "secret"}) await click_text(text="Sign In") await diff_state(snapshot_id="before_login") ``` -------------------------------- ### File Upload Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Uploads a file to a file input element. ```APIDOC ## POST /upload_file ### Description Uploads a file to a file input element. ### Method POST ### Endpoint /upload_file ### Parameters #### Query Parameters - **selector** (string) - Required - The CSS selector of the file input element. - **file_path** (string) - Required - The absolute path to the file to upload. ### Request Example ```json { "selector": "input[type='file']", "file_path": "/path/to/document.pdf" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Uploaded file to 'input[type='file']'."). ``` -------------------------------- ### Frames & Dialogs Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Utilities for interacting with iframes, handling JavaScript dialogs, and capturing console logs. ```APIDOC ## GET /list_frames ### Description List all frames in the current page. ### Method GET ### Endpoint /list_frames ### Response #### Success Response (200) - **frames** (array) - An array of frame objects, each with 'name', 'url', and 'is_main' properties. #### Response Example ```json { "frames": [ {"name": "", "url": "https://example.com", "is_main": true}, {"name": "ad-frame", "url": "https://ads.example.com/banner", "is_main": false} ] } ``` ## POST /frame_locator ### Description Interact with elements inside iframes. ### Method POST ### Endpoint /frame_locator ### Parameters #### Request Body - **frame_selector** (string) - Required - CSS selector for the iframe. - **element_selector** (string) - Required - CSS selector for the element within the iframe. - **action** (string) - Required - The action to perform ('fill', 'click', 'get_text', etc.). - **fill_value** (string) - Optional - The value to fill if the action is 'fill'. ### Request Example ```json { "frame_selector": "iframe#payment-form", "element_selector": "#card-number", "action": "fill", "fill_value": "4111111111111111" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the action was performed. #### Response Example ```json { "message": "Filled element in frame." } ``` ## POST /handle_dialog ### Description Set up automatic handling for JavaScript dialogs (alert, confirm, prompt). ### Method POST ### Endpoint /handle_dialog ### Parameters #### Request Body - **action** (string) - Required - The action to perform ('accept' or 'dismiss'). - **prompt_text** (string) - Optional - The text to enter if the dialog is a prompt. ### Request Example ```json { "action": "accept", "prompt_text": "My response" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the dialog handler was set. #### Response Example ```json { "message": "Dialog handler set: accept with text 'My response'" } ``` ## POST /get_console_logs ### Description Capture and retrieve browser console logs. ### Method POST ### Endpoint /get_console_logs ### Parameters #### Request Body - **clear** (boolean) - Optional - If true, clears the logs after retrieval. Defaults to false. ### Request Example ```json { "clear": true } ``` ### Response #### Success Response (200) - **logs** (array) - An array of log objects, each containing 'type', 'text', and 'location'. If capture just started, a message is returned instead. #### Response Example ```json { "logs": [ {"type": "log", "text": "Page loaded", "location": "app.js:42"}, {"type": "error", "text": "Failed to load resource", "location": null} ] } ``` ``` -------------------------------- ### Browser Management API Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Endpoints for controlling the lifecycle and state of the Camoufox browser instance. ```APIDOC ## POST /launch_browser ### Description Launch a Camoufox browser with anti-detect capabilities including OS spoofing, proxy support, and human-like cursor movement. ### Method POST ### Parameters #### Request Body - **headless** (boolean) - Optional - Run browser in headless mode. - **proxy_server** (string) - Optional - Proxy URL. - **os_type** (string) - Optional - OS to spoof (e.g., "windows"). - **humanize** (boolean) - Optional - Enable human-like cursor movement. ### Response #### Success Response (200) - **message** (string) - Confirmation of browser launch. --- ## POST /close_browser ### Description Close the browser and clean up all resources. ### Method POST ### Response #### Success Response (200) - **message** (string) - Confirmation of browser closure. ``` -------------------------------- ### Page Interaction: Click, Fill, Type, Press Key Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Enables interaction with web page elements. Supports clicking elements using various selectors (CSS, XPath, text), filling input fields, typing text character by character with delays for human-like input, and pressing keyboard keys. ```python # Click actions await click(selector="#submit-button") await click(selector="//button[@type='submit']") await click( selector=".context-menu-trigger", button="right", click_count=2, delay=100 ) # Fill input fields await fill(selector="#username", value="john_doe") await fill(selector="textarea.comment", value="This is a multi-line\ncomment") # Type text with delay await type_text( selector="#search-input", text="search query", delay=50 ) # Press keyboard keys await press_key(key="Enter") ``` -------------------------------- ### Detect anti-bot protection systems Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Analyzes the current page for common anti-bot mechanisms like Cloudflare, Akamai, and CAPTCHAs. Returns a detailed object indicating detected services and specific indicators found. ```python await detect_antibot_protection() ``` -------------------------------- ### Manage Cookies and Local/Session Storage Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Tools for retrieving, setting, and clearing browser cookies, as well as accessing and modifying Web Storage (localStorage and sessionStorage). ```python await get_cookies() await set_cookie(name="auth_token", value="secret_token_value", domain=".example.com", path="/", http_only=True, secure=True, same_site="Strict") await get_local_storage() await set_local_storage(key="user_preferences", value="{\"theme\":\"light\"}") ``` -------------------------------- ### Interact with Frames and Dialogs Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Enables interaction with nested iframes and provides mechanisms to handle browser-level dialogs (alerts, prompts) and capture console output. ```python await list_frames() await frame_locator(frame_selector="iframe#payment-form", element_selector="#card-number", action="fill", fill_value="4111111111111111") await handle_dialog(action="accept", prompt_text="My response") await get_console_logs(clear=True) ``` -------------------------------- ### Fill by Label Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Finds an input element associated with a given label text and fills it. ```APIDOC ## POST /fill_by_label ### Description Finds an input element using its associated label text and fills it with the provided value. ### Method POST ### Endpoint /fill_by_label ### Parameters #### Query Parameters - **label** (string) - Required - The text of the label associated with the input field. - **value** (string) - Required - The value to fill into the input field. - **exact** (boolean) - Optional - If true, performs an exact match for the label text. Defaults to false (partial match). ### Request Example ```json { "label": "Email Address", "value": "user@example.com" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Filled input labeled 'Email Address'"). ``` -------------------------------- ### Batch Actions Execution Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Executes a sequence of multiple actions in a single API call for efficiency. The batch stops if any action fails. Supported actions include click, fill, type, press, select, check, uncheck, hover, wait, and wait_for. ```javascript await batch_actions(actions=[ {"action": "fill", "selector": "#username", "value": "john"}, {"action": "fill", "selector": "#password", "value": "secret123"}, {"action": "check", "selector": "#remember-me"}, {"action": "wait", "ms": 500}, {"action": "click", "selector": "button[type='submit']"} ]) ``` -------------------------------- ### Upload File Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Uploads a file to a file input element on the page. Requires the CSS selector for the input and the local file path. ```javascript await upload_file( selector="input[type='file']", file_path="/path/to/document.pdf" ) ``` -------------------------------- ### Analyze DOM page structure Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Examines the DOM to identify complexity, shadow DOM usage, iframes, and frameworks. Useful for determining the feasibility of scraping specific page elements. ```python await analyze_page_structure() ``` -------------------------------- ### Page Interaction API Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Endpoints for interacting with DOM elements on the page. ```APIDOC ## POST /click ### Description Click an element using CSS, XPath, or text selectors. ### Method POST ### Parameters #### Request Body - **selector** (string) - Required - Element selector. - **button** (string) - Optional - Mouse button (left, right, middle). - **click_count** (integer) - Optional - Number of clicks. ### Response #### Success Response (200) - **message** (string) - Confirmation of click action. --- ## POST /fill ### Description Fill a text input or textarea with a value. ### Method POST ### Parameters #### Request Body - **selector** (string) - Required - Input selector. - **value** (string) - Required - Text to input. ### Response #### Success Response (200) - **message** (string) - Confirmation of fill action. ``` -------------------------------- ### Click Role Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Clicks an element based on its ARIA role and accessible name. ```APIDOC ## POST /click_role ### Description Clicks an element identified by its ARIA role and accessible name, promoting accessibility. ### Method POST ### Endpoint /click_role ### Parameters #### Query Parameters - **role** (string) - Required - The ARIA role of the element (e.g., 'button', 'link'). - **name** (string) - Required - The accessible name of the element (e.g., the text content or aria-label). ### Request Example ```json { "role": "button", "name": "Submit Form" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Clicked element with role=button, name='Submit Form'"). ``` -------------------------------- ### Cookies & Storage Management Source: https://context7.com/sekinal/camoufox-mcp/llms.txt APIs for retrieving, setting, and clearing browser cookies, as well as managing local and session storage. ```APIDOC ## GET /get_cookies ### Description Get all cookies, optionally filtered by URL. ### Method GET ### Endpoint /get_cookies ### Parameters #### Query Parameters - **url** (string) - Optional - Filter cookies by this URL. ### Request Example ```json { "url": "https://api.example.com" } ``` ### Response #### Success Response (200) - **cookies** (array) - An array of cookie objects. Each object contains 'name', 'value', 'domain', etc. #### Response Example ```json { "cookies": [ {"name": "session_id", "value": "abc123", "domain": ".example.com", ...} ] } ``` ## POST /set_cookie ### Description Set a cookie with full control over attributes. ### Method POST ### Endpoint /set_cookie ### Parameters #### Request Body - **name** (string) - Required - The name of the cookie. - **value** (string) - Required - The value of the cookie. - **domain** (string) - Optional - The domain for which the cookie is set. - **path** (string) - Optional - The path for which the cookie is set. - **expires** (integer) - Optional - Unix timestamp for cookie expiration. - **http_only** (boolean) - Optional - Whether the cookie is HTTP only. - **secure** (boolean) - Optional - Whether the cookie is secure. - **same_site** (string) - Optional - The SameSite attribute ('Strict', 'Lax', 'None'). ### Request Example ```json { "name": "auth_token", "value": "secret_token_value", "domain": ".example.com", "path": "/", "expires": 1735689600, "http_only": true, "secure": true, "same_site": "Strict" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the cookie was set. #### Response Example ```json { "message": "Cookie 'auth_token' set." } ``` ## POST /clear_cookies ### Description Clear all cookies from the browser context. ### Method POST ### Endpoint /clear_cookies ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating all cookies were cleared. #### Response Example ```json { "message": "All cookies cleared." } ``` ## GET /get_local_storage ### Description Get all data from localStorage. ### Method GET ### Endpoint /get_local_storage ### Response #### Success Response (200) - **storage** (object) - An object containing key-value pairs from localStorage. #### Response Example ```json { "storage": { "user_preferences": "{\"theme\":\"dark\"}", "cart_items": "[1,2,3]" } } ``` ## POST /set_local_storage ### Description Set a key-value pair in localStorage. ### Method POST ### Endpoint /set_local_storage ### Parameters #### Request Body - **key** (string) - Required - The key to set. - **value** (string) - Required - The value to set for the key. ### Request Example ```json { "key": "user_preferences", "value": "{\"theme\":\"light\"}" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the localStorage item was set. #### Response Example ```json { "message": "localStorage['user_preferences'] set." } ``` ## GET /get_session_storage ### Description Get all data from sessionStorage. ### Method GET ### Endpoint /get_session_storage ### Response #### Success Response (200) - **storage** (object) - An object containing key-value pairs from sessionStorage. #### Response Example ```json { "storage": { "temp_data": "value", "form_draft": "{...}" } } ``` ## POST /set_session_storage ### Description Set a key-value pair in sessionStorage. ### Method POST ### Endpoint /set_session_storage ### Parameters #### Request Body - **key** (string) - Required - The key to set. - **value** (string) - Required - The value to set for the key. ### Request Example ```json { "key": "temp_data", "value": "new_value" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the sessionStorage item was set. #### Response Example ```json { "message": "sessionStorage['temp_data'] set." } ``` ``` -------------------------------- ### Validate CSS and XPath selectors Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Tests the effectiveness of a given selector and provides feedback on its uniqueness and potential fragility. Returns sample elements matching the selector. ```python await test_selector(selector=".product-card", max_samples=3) ``` -------------------------------- ### Inspect DOM Elements Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves detailed metadata about a specific DOM element, including computed styles, bounding box coordinates, and attributes. ```python await inspect_element(selector="#main-button") ``` -------------------------------- ### Fill Input by Label Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Finds an input field by its associated label text and fills it with a specified value. Supports exact matching for label text. ```javascript await fill_by_label(label="Email Address", value="user@example.com") await fill_by_label(label="Password", value="secret", exact=True) ``` -------------------------------- ### Fill Form Fields Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Fills multiple form fields simultaneously and optionally submits the form. Fields are provided as a dictionary mapping selectors to values. ```javascript await fill_form( fields={ "#first-name": "John", "#last-name": "Doe", "#email": "john@example.com", "#phone": "555-1234" }, submit_selector="button.submit" ) ``` -------------------------------- ### Click Text Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Clicks an element based on its visible text content, with options for exact matching and tag filtering. ```APIDOC ## POST /click_text ### Description Clicks an element identified by its visible text content. ### Method POST ### Endpoint /click_text ### Parameters #### Query Parameters - **text** (string) - Required - The text content to match. - **exact** (boolean) - Optional - If true, performs an exact text match. Defaults to false (partial match). - **tag** (string) - Optional - Filters the search to elements with the specified HTML tag. ### Request Example ```json { "text": "Sign In" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Clicked element with text: 'Learn More'"). ``` -------------------------------- ### Select Dropdown Option Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Selects an option from a dropdown element. Options can be specified by their value, visible label text, or zero-based index. ```python # By value await select_option(selector="#country", value="US") # By label text await select_option(selector="#country", label="United States") # By index (0-based) await select_option(selector="#country", index=0) ``` -------------------------------- ### Scrolling Actions Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Scrolls the page or a specific element into view. ```APIDOC ## POST /scroll ### Description Scrolls the page or a specific element. ### Method POST ### Endpoint /scroll ### Parameters #### Query Parameters - **x** (integer) - Optional - The number of pixels to scroll horizontally. Defaults to 0. - **y** (integer) - Optional - The number of pixels to scroll vertically. Defaults to 0. - **selector** (string) - Optional - The CSS selector of the element to scroll into view. If provided, x and y are ignored. ### Request Example ```json { "y": 500 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Scrolled by (0, 500)." or "Scrolled '#footer' into view."). ``` -------------------------------- ### Hover Over Element Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Simulates a mouse hover action over a specified element. This is useful for triggering tooltips or dropdown menus. ```javascript await hover(selector=".dropdown-trigger") ``` -------------------------------- ### Identify embedded data sources Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Scans the page for structured data formats such as JSON-LD, Next.js state, and inline JSON objects. Facilitates direct data extraction without complex parsing. ```python await find_data_sources() ``` -------------------------------- ### Analyze network traffic patterns Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Inspects captured network requests to identify API endpoints, GraphQL queries, and WebSocket connections. Helps in mapping out backend data sources. ```python await analyze_network_patterns() ``` -------------------------------- ### Network Traffic Analysis Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Tools for logging, filtering, and waiting for network requests and responses. Useful for debugging API interactions and monitoring background traffic. ```python await get_network_log(url_filter="/api/", limit=20) await set_network_capture(enabled=True, capture_bodies=True) await wait_for_response(url_pattern="/api/products", timeout=15000, include_body=True) ``` -------------------------------- ### JavaScript Execution Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Executes arbitrary JavaScript within the browser context to modify page state or extract complex data structures. ```python await evaluate(expression="document.title") await evaluate(expression=""" () => { return document.querySelectorAll('.item').length; } """) ``` -------------------------------- ### Dropdown Option Selection Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Selects an option from a dropdown element by its value, label, or index. ```APIDOC ## POST /select_option ### Description Selects an option from a dropdown element. ### Method POST ### Endpoint /select_option ### Parameters #### Query Parameters - **selector** (string) - Required - The CSS selector of the dropdown element. - **value** (string) - Optional - The value of the option to select. - **label** (string) - Optional - The visible text label of the option to select. - **index** (integer) - Optional - The 0-based index of the option to select. ### Request Example ```json { "selector": "#country", "value": "US" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Selected option in '#country'."). ``` -------------------------------- ### Execute JavaScript on Elements Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Executes custom JavaScript expressions within the context of a specific DOM element. Useful for extracting data or performing complex transformations on page elements. ```python await evaluate_on_element( selector="#price-display", expression="el => el.textContent.replace('$', '')" ) await evaluate_on_element( selector="form#checkout", expression="el => new FormData(el).entries().reduce((acc, [k,v]) => ({...acc, [k]: v}), {})" ) ``` -------------------------------- ### Export network logs as HAR Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Generates a HAR (HTTP Archive) file containing the captured network logs for external analysis in browser developer tools. ```python await export_har() ``` -------------------------------- ### Drag and Drop Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Performs drag and drop operations between two elements. ```APIDOC ## POST /drag_and_drop ### Description Performs a drag and drop operation from a source element to a target element. ### Method POST ### Endpoint /drag_and_drop ### Parameters #### Query Parameters - **source_selector** (string) - Required - The CSS selector of the element to drag. - **target_selector** (string) - Required - The CSS selector of the element to drop onto. - **source_position** (object) - Optional - An object with x and y coordinates for the offset within the source element. - **x** (integer) - The x-coordinate. - **y** (integer) - The y-coordinate. - **target_position** (object) - Optional - An object with x and y coordinates for the offset within the target element. - **x** (integer) - The x-coordinate. - **y** (integer) - The y-coordinate. ### Request Example ```json { "source_selector": "#draggable-item", "target_selector": "#drop-zone", "target_position": {"x": 50, "y": 50} } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Dragged '#draggable-item' to '#drop-zone'."). ``` -------------------------------- ### Click Element by Text Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Clicks an element based on its visible text content, without needing a specific CSS selector. Supports partial and exact text matching, and can be filtered by tag name. ```javascript # Partial text match await click_text(text="Sign In") # Exact text match await click_text(text="Submit", exact=True) # Filter by tag await click_text(text="Learn More", tag="button") ``` -------------------------------- ### Extract Text Content Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves the text content from an element or the entire web page. If no selector is provided, it defaults to extracting all text from the page. ```javascript # Get all page text await get_text() # Get text from specific element await get_text(selector=".article-body") ``` -------------------------------- ### Extract Element Attributes and Content Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Methods for retrieving specific attributes or multiple elements from the DOM. These functions are essential for web scraping and data extraction tasks. ```python await get_attribute(selector="img.product-image", attribute="src") await query_selector_all( selector=".product-title", extract="text", limit=10 ) ``` -------------------------------- ### Drag and Drop Elements Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Performs a drag-and-drop operation between two elements. Optional source and target positions can be specified for precise control. ```javascript await drag_and_drop( source_selector="#draggable-item", target_selector="#drop-zone", source_position={"x": 10, "y": 10}, # Optional offset within source target_position={"x": 50, "y": 50} # Optional offset within target ) ``` -------------------------------- ### Extract HTML Content Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Retrieves the HTML content of an element or the entire page. Can fetch either the inner HTML or the outer HTML (including the element itself). ```javascript # Get outer HTML (includes the element itself) await get_html(selector=".product-card", outer=True) # Get inner HTML only await get_html(selector=".product-card", outer=False) # Get full page HTML await get_html() ``` -------------------------------- ### Scroll Page or Element Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Scrolls the page vertically by a specified number of pixels or scrolls a particular element into the viewport. ```javascript # Scroll page down by 500 pixels await scroll(x=0, y=500) # Scroll element into view await scroll(selector="#footer") ``` -------------------------------- ### Checkbox/Radio Button Toggle Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Toggles the state of checkboxes and radio buttons. ```APIDOC ## POST /check or /uncheck ### Description Checks or unchecks a checkbox or radio button. ### Method POST ### Endpoint /check or /uncheck ### Parameters #### Query Parameters - **selector** (string) - Required - The CSS selector of the checkbox or radio button. ### Request Example ```json { "selector": "#agree-terms" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message (e.g., "Checked: #agree-terms" or "Unchecked: #newsletter"). ``` -------------------------------- ### evaluate_on_element Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Executes JavaScript code within the context of a specific DOM element. This is useful for extracting data or performing actions on elements that require custom JavaScript logic. ```APIDOC ## POST /evaluate_on_element ### Description Executes JavaScript on a specific element. ### Method POST ### Endpoint /evaluate_on_element ### Parameters #### Request Body - **selector** (string) - Required - CSS selector for the target element. - **expression** (string) - Required - JavaScript expression to execute. The element is available as `el`. ### Request Example ```json { "selector": "#price-display", "expression": "el => el.textContent.replace('$', '')" } ``` ### Response #### Success Response (200) - **result** (any) - The return value of the JavaScript expression. #### Response Example ```json { "result": "29.99" } ``` ``` -------------------------------- ### Toggle Checkbox/Radio Button Source: https://context7.com/sekinal/camoufox-mcp/llms.txt Checks or unchecks checkboxes and radio buttons. It requires a CSS selector to identify the target input element. ```javascript await check(selector="#agree-terms") await uncheck(selector="#newsletter") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.