### Install Camoufox Browser Binary Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Fetches and installs the Camoufox browser binary using uvx or pip. Includes commands for installing Linux dependencies if needed. ```bash # Using uvx uvx camoufox fetch # Using pip python -m camoufox fetch # Linux dependencies sudo apt install -y libgtk-3-0 libx11-xcb1 libasound2 ``` -------------------------------- ### Python Proxy Configuration Example Source: https://github.com/rlgrpe/camoufox-mcp-python/blob/main/README.md An example of how to configure proxy settings using a Python dictionary. This includes the server address, username, and password for proxy authentication. ```python proxy = { 'server': 'http://proxy.example.com:8080', 'username': 'user', 'password': 'pass' } ``` -------------------------------- ### browser_install Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Installs the Camoufox browser binary if it is not already present on the system. ```APIDOC ## browser_install ### Description Install the Camoufox browser binary if not already installed. ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python await browser_install() ``` ### Response #### Success Response - **message** (string) - A confirmation message indicating successful installation and download details (e.g., "Camoufox installed successfully.\nDownloaded camoufox-133.0..."). #### Response Example ```json "Camoufox installed successfully.\nDownloaded camoufox-133.0..." ``` ``` -------------------------------- ### Install Camoufox Browser (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Installs the Camoufox browser binary if it is not already present on the system. This is a prerequisite for running any browser automation tasks with Camoufox. ```python await browser_install() # Returns: "Camoufox installed successfully.\nDownloaded camoufox-133.0..." ``` -------------------------------- ### Install Camoufox MCP Server Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Installs the Camoufox MCP Server using package managers like uvx, pipx, or pip. Ensure you have the necessary Python environment set up. ```bash # Using uvx (recommended) uvx camoufox-mcp # Using pipx pipx run camoufox-mcp # Using pip pip install camoufox-mcp camoufox-mcp ``` -------------------------------- ### Development Commands (Bash) Source: https://github.com/rlgrpe/camoufox-mcp-python/blob/main/README.md Common development commands for the project using 'uv' and 'pytest'. These commands cover installing dependencies, running tests, formatting code, and linting. ```bash # Install dev dependencies uv sync --dev # Run tests uv run pytest # Format code uv run ruff format # Lint uv run ruff check ``` -------------------------------- ### Get Browser Network Requests Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Retrieves a list of all network requests made by the web page. Can optionally include static assets like images and stylesheets. ```python # Get non-static requests (documents, XHR, fetch) await browser_network_requests(include_static=False) # Returns: # [GET] https://api.example.com/data - 200 (fetch) # [POST] https://api.example.com/login - 201 (xhr) ``` ```python # Include all requests (images, fonts, stylesheets) await browser_network_requests(include_static=True) # Returns: # [GET] https://example.com/ - 200 (document) # [GET] https://example.com/styles.css - 200 (stylesheet) # [GET] https://example.com/logo.png - 200 (image) # [GET] https://api.example.com/data - 200 (fetch) ``` -------------------------------- ### Drag and Drop Browser Elements Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Performs a drag-and-drop operation between a starting element and an ending element. Both elements require references. ```python await browser_drag( start_element="Draggable item", start_ref="listitem:Item 1", end_element="Drop zone", end_ref="region:Drop here" ) # Returns: "Dragged from Draggable item to Drop zone" ``` -------------------------------- ### Navigate Browser Page Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Navigates the browser to a specified URL. The browser is initialized lazily on the first call and maintains its session for subsequent operations. ```python # MCP Tool Call await browser_navigate(url="https://example.com") # Returns: "Navigated to https://example.com\nPage title: Example Domain" ``` -------------------------------- ### Configure Browser Proxy (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Sets up proxy configurations for the browser before the first navigation. Supports various formats including IP:port, user:pass@ip:port, and ip:port:login:password. This is crucial for routing browser traffic through a proxy server. ```python # Configure with login:password@ip:port format await browser_configure(proxy="user:pass@proxy.example.com:8080") # Returns: "Proxy configured: http://proxy.example.com:8080" # Configure with ip:port:login:password format await browser_configure(proxy="192.168.1.1:8080:username:password") # Returns: "Proxy configured: http://192.168.1.1:8080" # Configure without auth await browser_configure(proxy="proxy.example.com:8080") # Returns: "Proxy configured: http://proxy.example.com:8080" ``` -------------------------------- ### browser_configure Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Configures proxy settings for the browser. This must be called before the first navigation. ```APIDOC ## browser_configure ### Description Configure proxy settings before launching the browser. Must be called before first navigation. ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments - **proxy** (string) - Required - The proxy configuration string. Can be in `user:password@ip:port` or `ip:port:user:password` format, or just `ip:port` for unauthenticated proxies. ### Request Example ```python # Configure with login:password@ip:port format await browser_configure(proxy="user:pass@proxy.example.com:8080") # Configure with ip:port:login:password format await browser_configure(proxy="192.168.1.1:8080:username:password") # Configure without auth await browser_configure(proxy="proxy.example.com:8080") ``` ### Response #### Success Response - **message** (string) - A confirmation message indicating the proxy configuration (e.g., "Proxy configured: http://proxy.example.com:8080"). #### Response Example ```json "Proxy configured: http://proxy.example.com:8080" ``` ``` -------------------------------- ### Configure Claude Desktop for Camoufox MCP Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt JSON configuration for Claude Desktop to connect to the Camoufox MCP server. Specifies the command and arguments to launch the server. ```json { "mcpServers": { "camoufox-mcp": { "command": "uvx", "args": ["camoufox-mcp"] } } } ``` -------------------------------- ### Capture Page Snapshot Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Captures an accessibility snapshot of the current web page. Returns a structured tree view of elements with references for interaction. ```python # MCP Tool Call await browser_snapshot() # Returns accessibility tree: # WebArea "Example Domain" # heading "Example Domain" # paragraph # StaticText "This domain is for use in illustrative examples" # link "More information..." [ref=link:More information...] ``` -------------------------------- ### Browser Configuration Object (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Defines a comprehensive configuration object for customizing Camoufox browser behavior. It allows setting OS fingerprint, headless mode, humanization, geolocation, proxy, privacy settings, and more. This object must be configured before the first browser navigation. ```python from camoufox_mcp.config import BrowserConfig config = BrowserConfig( # OS fingerprint spoofing os="windows", # "windows", "macos", "linux", or None for auto # Headless mode headless=False, # True, False, or "virtual" for virtual display # Human-like behavior humanize=True, # True, False, or float for movement duration # Geolocation from IP geoip=True, # Proxy configuration proxy={ "server": "http://proxy.example.com:8080", "username": "user", "password": "pass" }, # Privacy settings block_webrtc=True, # Prevent WebRTC IP leaks block_webgl=False, # Block WebGL fingerprinting block_images=False, # Block image loading for speed # Browser settings locale="en-US", viewport={"width": 1920, "height": 1080}, enable_cache=True, timeout=30000, # Page load timeout in ms wait_strategy="domcontentloaded", # "domcontentloaded", "load", "networkidle" # Extensions ublock=False, # Enable uBlock Origin ) # Convert to launch kwargs launch_kwargs = config.to_launch_kwargs() ``` -------------------------------- ### Manage Browser Tabs (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Provides functionality to list, create, select, and close browser tabs. It allows for precise control over the browser's tabbed interface, enabling complex multi-tab workflows. Operations can target specific tab indices or the currently active tab. ```python # List all open tabs await browser_tabs(action="list") # Returns: # [0] (active) Google - https://google.com # [1] GitHub - https://github.com # [2] Documentation - https://docs.example.com # Create new tab await browser_tabs(action="new") # Returns: "Created new tab at index 3" # Select specific tab await browser_tabs(action="select", index=1) # Returns: "Selected tab 1: GitHub" # Close current tab await browser_tabs(action="close") # Returns: "Closed tab at index current" # Close specific tab await browser_tabs(action="close", index=2) # Returns: "Closed tab at index 2" ``` -------------------------------- ### browser_handle_dialog Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Handles browser dialogs such as alerts, confirmations, prompts, and beforeunload events. It can accept or dismiss dialogs and provide text for prompt dialogs. ```APIDOC ## browser_handle_dialog ### Description Handles browser dialogs (alert, confirm, prompt, beforeunload). ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments - **accept** (boolean) - Required - Whether to accept (`True`) or dismiss (`False`) the dialog. - **prompt_text** (string) - Optional - The text to enter into a prompt dialog if `accept` is `True`. ### Request Example ```python # Accept an alert await browser_handle_dialog(accept=True) # Dismiss a confirm dialog await browser_handle_dialog(accept=False) # Accept prompt with text await browser_handle_dialog(accept=True, prompt_text="My response") ``` ### Response #### Success Response - **message** (string) - A confirmation message indicating the dialog action (e.g., "Dialog accepted", "Dialog dismissed"). #### Response Example ```json "Dialog accepted" ``` ``` -------------------------------- ### Press Keys with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Simulates key presses on the browser, including standard keys, arrow keys, and combinations with modifier keys like Ctrl. ```python await browser_press_key(key="Escape") # Returns: "Pressed key: Escape" ``` ```python await browser_press_key(key="ArrowDown") # Returns: "Pressed key: ArrowDown" ``` ```python await browser_press_key(key="Control+a") # Returns: "Pressed key: Control+a" ``` -------------------------------- ### browser_file_upload Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Initiates a file upload process, simulating the selection of files in a file chooser dialog. ```APIDOC ## POST /browser/file_upload ### Description Simulates the process of uploading files through a file input element. This function is triggered when a file chooser dialog is opened by the browser. ### Method POST ### Endpoint /browser/file_upload ### Parameters #### Query Parameters - **paths** (array of strings or null) - Required - An array of absolute file paths to upload. If set to `null`, it simulates cancelling the file chooser dialog. ### Request Body ```json { "paths": ["string"] | null } ``` ### Request Example ```json { "paths": [ "/path/to/image1.jpg", "/path/to/image2.jpg" ] } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the files uploaded or that the chooser was cancelled. Example: "Uploaded files: /path/to/image1.jpg, /path/to/image2.jpg" or "File chooser cancelled". #### Response Example ```json { "message": "Uploaded files: /path/to/image1.jpg, /path/to/image2.jpg" } ``` ``` -------------------------------- ### Upload Files with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Handles file uploads when a file chooser dialog is triggered by the browser. Supports uploading single or multiple files, or cancelling the dialog. ```python # Upload single file await browser_file_upload(paths=["/path/to/document.pdf"]) # Returns: "Uploaded files: /path/to/document.pdf" ``` ```python # Upload multiple files await browser_file_upload(paths=[ "/path/to/image1.jpg", "/path/to/image2.jpg", "/path/to/image3.jpg" ]) # Returns: "Uploaded files: /path/to/image1.jpg, /path/to/image2.jpg, /path/to/image3.jpg" ``` ```python # Cancel file chooser await browser_file_upload(paths=None) # Returns: "File chooser cancelled" ``` -------------------------------- ### BrowserConfig Class Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Provides configuration options for customizing Camoufox browser behavior, including OS fingerprinting, headless mode, proxy settings, and privacy features. Must be set before the first navigation. ```APIDOC ## BrowserConfig ### Description Configuration options for customizing Camoufox browser behavior. Set before first navigation. ### Method Class instantiation and method call ### Endpoint N/A (Direct class usage) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Class Initialization Arguments - **os** (string) - Optional - Operating system fingerprint to spoof. Options: "windows", "macos", "linux", or `None` for auto-detection. - **headless** (boolean or string) - Optional - Headless mode. `True` for standard headless, `False` for headed mode, or `"virtual"` for virtual display. - **humanize** (boolean or float) - Optional - Enables human-like mouse movements. `True` for default duration, `False` to disable, or a float for custom duration. - **geoip** (boolean) - Optional - Enables geolocation spoofing based on IP address. - **proxy** (object or dictionary) - Optional - Proxy configuration. Should be an object with `server`, `username`, and `password` keys, or a dictionary. - **server** (string) - Required if proxy is set - The proxy server URL (e.g., "http://proxy.example.com:8080"). - **username** (string) - Optional - Proxy username. - **password** (string) - Optional - Proxy password. - **block_webrtc** (boolean) - Optional - Prevent WebRTC IP leaks. Defaults to `True`. - **block_webgl** (boolean) - Optional - Block WebGL fingerprinting. Defaults to `False`. - **block_images** (boolean) - Optional - Block image loading for faster performance. Defaults to `False`. - **locale** (string) - Optional - Browser locale (e.g., "en-US"). - **viewport** (object or dictionary) - Optional - Viewport dimensions. - **width** (integer) - Required if viewport is set - Viewport width in pixels. - **height** (integer) - Required if viewport is set - Viewport height in pixels. - **enable_cache** (boolean) - Optional - Enable browser cache. Defaults to `True`. - **timeout** (integer) - Optional - Page load timeout in milliseconds. Defaults to `30000`. - **wait_strategy** (string) - Optional - Strategy for waiting for page load. Options: "domcontentloaded", "load", "networkidle". Defaults to "domcontentloaded". - **ublock** (boolean) - Optional - Enable uBlock Origin ad blocker. Defaults to `False`. ### Methods - **to_launch_kwargs()**: Converts the `BrowserConfig` object into a dictionary suitable for launching the browser. ### Request Example ```python from camoufox_mcp.config import BrowserConfig config = BrowserConfig( os="windows", headless=False, humanize=True, geoip=True, proxy={ "server": "http://proxy.example.com:8080", "username": "user", "password": "pass" }, block_webrtc=True, locale="en-US", viewport={"width": 1920, "height": 1080}, wait_strategy="domcontentloaded", ublock=False ) # Convert to launch kwargs launch_kwargs = config.to_launch_kwargs() ``` ### Response #### Success Response - **launch_kwargs** (object) - A dictionary containing arguments for launching the browser based on the configuration. #### Response Example ```json { "os": "windows", "headless": false, "humanize": true, "geoip": true, "proxy": { "server": "http://proxy.example.com:8080", "username": "user", "password": "pass" }, "block_webrtc": true, "locale": "en-US", "viewport": { "width": 1920, "height": 1080 }, "wait_strategy": "domcontentloaded", "ublock": false } ``` ``` -------------------------------- ### Navigate Browser Back Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Navigates the browser back to the previous page in its history. This function is useful for undoing navigation actions. ```python # MCP Tool Call await browser_navigate_back() # Returns: "Navigated back to https://previous-page.com\nPage title: Previous Page" ``` -------------------------------- ### Wait for Page Conditions Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Waits for specific conditions on the page, such as text appearing, text disappearing, or a set amount of time passing. Useful for synchronizing actions. ```python # Wait for text to appear await browser_wait_for(text="Loading complete") # Returns: "Text 'Loading complete' appeared on the page" # Wait for text to disappear await browser_wait_for(text_gone="Loading...") # Returns: "Text 'Loading...' is no longer visible" # Wait for specified time (seconds) await browser_wait_for(time=2.5) # Returns: "Waited for 2.5 seconds" ``` -------------------------------- ### Execute JavaScript with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Executes arbitrary JavaScript code within the browser context, either globally or on a specific element. Can be used to retrieve page information or perform actions. ```python # Get page title via JavaScript await browser_evaluate(function="() => document.title") # Returns: "Example Domain" ``` ```python # Get all links on page await browser_evaluate( function="() => Array.from(document.querySelectorAll('a')).map(a => a.href)" ) # Returns: '["https://example.com/page1", "https://example.com/page2"]' ``` ```python # Execute on specific element await browser_evaluate( function="(element) => element.innerText", element="Main heading", ref="heading:Welcome" ) # Returns: "Welcome to our site" ``` ```python # Scroll page await browser_evaluate(function="() => window.scrollTo(0, document.body.scrollHeight)") # Returns: "Evaluation completed (returned undefined)" ``` -------------------------------- ### browser_tabs Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Manages browser tabs, allowing listing, creation, selection, and closing of tabs. ```APIDOC ## browser_tabs ### Description Manages browser tabs - list, create, close, or select. ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments - **action** (string) - Required - The action to perform: "list", "new", "select", "close". - **index** (integer) - Optional - The index of the tab to select or close. Required for "select" and "close" if not operating on the current tab. ### Request Example ```python # List all open tabs await browser_tabs(action="list") # Create new tab await browser_tabs(action="new") # Select specific tab await browser_tabs(action="select", index=1) # Close current tab await browser_tabs(action="close") # Close specific tab await browser_tabs(action="close", index=2) ``` ### Response #### Success Response - **list** (array of objects) - When action is "list", returns an array describing each tab (index, active status, title, URL). - **message** (string) - For other actions, returns a confirmation message (e.g., "Created new tab at index 3", "Selected tab 1: GitHub", "Closed tab at index current"). #### Response Example ```json // For action: "list" [ "[0] (active) Google - https://google.com", "[1] GitHub - https://github.com", "[2] Documentation - https://docs.example.com" ] // For action: "new" "Created new tab at index 3" ``` ``` -------------------------------- ### Press Keyboard Key Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Simulates pressing a keyboard key, including special keys like 'Enter'. Modifiers can also be specified if needed. ```python # Press Enter await browser_press_key(key="Enter") # Returns: "Pressed key: Enter" ``` -------------------------------- ### browser_press_key Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Simulates pressing a key on the keyboard, optionally with modifier keys. ```APIDOC ## POST /browser/press_key ### Description Simulates pressing a key on the keyboard. This can include standard keys, arrow keys, and combinations with modifier keys like Control, Shift, or Alt. ### Method POST ### Endpoint /browser/press_key ### Parameters #### Query Parameters - **key** (string) - Required - The key to press (e.g., "Escape", "ArrowDown", "Control+a"). ### Request Body ```json { "key": "string" } ``` ### Request Example ```json { "key": "Control+a" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the key press. Example: "Pressed key: Control+a" #### Response Example ```json { "message": "Pressed key: Control+a" } ``` ``` -------------------------------- ### browser_fill_form Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Fills multiple form fields simultaneously with provided values. ```APIDOC ## POST /browser/fill_form ### Description Fills out multiple form fields within a page at once. This function accepts an array of field objects, each specifying the field's name, selector, type, and value. ### Method POST ### Endpoint /browser/fill_form ### Parameters #### Query Parameters - **fields** (array of objects) - Required - An array where each object represents a form field to be filled. Each field object should contain: - **name** (string) - A human-readable name for the field. - **ref** (string) - A selector to identify the form field (e.g., "textbox:username"). - **type** (string) - The type of the form field (e.g., "textbox", "checkbox", "combobox"). - **value** (string or boolean) - The value to set for the field. For checkboxes, use "true" or "false". ### Request Body ```json { "fields": [ { "name": "string", "ref": "string", "type": "string", "value": "string | boolean" } ] } ``` ### Request Example ```json { "fields": [ { "name": "Username", "ref": "textbox:username", "type": "textbox", "value": "johndoe" }, { "name": "Remember me", "ref": "checkbox:remember", "type": "checkbox", "value": "true" } ] } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message listing the fields that were filled. Example: "Filled fields: Username, Remember me" #### Response Example ```json { "message": "Filled fields: Username, Remember me" } ``` ``` -------------------------------- ### browser_evaluate Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Executes arbitrary JavaScript code within the browser context. ```APIDOC ## POST /browser/evaluate ### Description Executes JavaScript code either on the entire page or within a specific element's context. This allows for dynamic data retrieval and manipulation. ### Method POST ### Endpoint /browser/evaluate ### Parameters #### Query Parameters - **function** (string) - Required - The JavaScript function to execute. Can be a string representation of a function or an arrow function. - **element** (string) - Optional - A human-readable name for the element context, used in logs and return messages. - **ref** (string) - Optional - A selector to identify the specific element context for the JavaScript execution. ### Request Body ```json { "function": "string", "element": "string", "ref": "string" } ``` ### Request Example ```json { "function": "() => document.title" } ``` ### Response #### Success Response (200) - **result** (any) - The return value of the executed JavaScript function. The type depends on what the JavaScript function returns. #### Response Example ```json { "result": "Example Domain" } ``` ``` -------------------------------- ### browser_network_requests Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Retrieves a list of all network requests made by the page. ```APIDOC ## GET /browser/network_requests ### Description Retrieves a list of all network requests initiated by the browser while loading the page. Can optionally exclude static assets like images and stylesheets. ### Method GET ### Endpoint /browser/network_requests ### Parameters #### Query Parameters - **include_static** (boolean) - Optional - If true, includes static assets (images, CSS, JS). Defaults to false. ### Request Example ```json { "include_static": true } ``` ### Response #### Success Response (200) - **requests** (array of objects) - An array of network request details. Each object typically includes: - **method** (string) - The HTTP method (e.g., "GET", "POST"). - **url** (string) - The requested URL. - **status** (integer) - The HTTP status code. - **type** (string) - The type of resource requested (e.g., "document", "fetch", "stylesheet"). #### Response Example ```json [ { "method": "GET", "url": "https://example.com/styles.css", "status": 200, "type": "stylesheet" } ] ``` ``` -------------------------------- ### browser_take_screenshot Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Captures a screenshot of the browser viewport, full page, or a specific element. ```APIDOC ## POST /browser/take_screenshot ### Description Takes a screenshot of the current browser view. Supports capturing the visible viewport, the entire scrollable page, or a specific element identified by a selector. Screenshots can be saved with custom filenames and formats. ### Method POST ### Endpoint /browser/take_screenshot ### Parameters #### Query Parameters - **full_page** (boolean) - Optional - If true, captures the entire scrollable page. Defaults to false (visible viewport). - **filename** (string) - Optional - The desired filename for the screenshot. If not provided, a default name with a timestamp will be used. - **type** (string) - Optional - The image format for the screenshot (e.g., "png", "jpeg"). Defaults to "png". - **element** (string) - Optional - A human-readable name for the element to capture. - **ref** (string) - Optional - A selector to identify the specific element to capture. ### Request Body ```json { "full_page": "boolean", "filename": "string", "type": "string", "element": "string", "ref": "string" } ``` ### Request Example ```json { "full_page": true, "filename": "homepage.png", "type": "png" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the screenshot has been saved and its location. Example: "Screenshot saved to: /path/screenshots/homepage.png" #### Response Example ```json { "message": "Screenshot saved to: /path/screenshots/homepage.png" } ``` ``` -------------------------------- ### Handle Browser Dialogs (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Manages browser dialogs such as alerts, confirms, and prompts. It can accept or dismiss dialogs and provide text for prompt dialogs. This function is essential for automating interactions with JavaScript-generated dialog boxes. ```python await browser_handle_dialog(accept=True) # Returns: "Dialog accepted" await browser_handle_dialog(accept=False) # Returns: "Dialog dismissed" await browser_handle_dialog(accept=True, prompt_text="My response") # Returns: "Dialog accepted" ``` -------------------------------- ### Select Dropdown Options with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Selects options within dropdown or select elements on a web page. Supports single and multiple selections. ```python # Single selection await browser_select_option( element="Country dropdown", ref="combobox:country", values=["United States"] ) # Returns: "Selected 'United States' in Country dropdown" ``` ```python # Multiple selection (for multi-select dropdowns) await browser_select_option( element="Interests", ref="combobox:interests", values=["Technology", "Science", "Art"] ) # Returns: "Selected 'Technology, Science, Art' in Interests" ``` -------------------------------- ### Fill Form Fields with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Fills multiple form fields simultaneously, supporting various input types like textboxes, checkboxes, and comboboxes. Requires field names, references, types, and values. ```python await browser_fill_form(fields=[ { "name": "Username", "ref": "textbox:username", "type": "textbox", "value": "johndoe" }, { "name": "Email", "ref": "textbox:email", "type": "textbox", "value": "john@example.com" }, { "name": "Remember me", "ref": "checkbox:remember", "type": "checkbox", "value": "true" }, { "name": "Country", "ref": "combobox:country", "type": "combobox", "value": "United States" } ]) # Returns: "Filled fields: Username, Email, Remember me, Country" ``` -------------------------------- ### Hover Over Browser Element Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Hovers the mouse cursor over a specified element to trigger hover states or display tooltips. Requires an element reference. ```python await browser_hover( element="Menu item", ref="menuitem:Settings" ) # Returns: "Hovering over Menu item" ``` -------------------------------- ### browser_resize Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Resizes the browser viewport to specified dimensions. ```APIDOC ## browser_resize ### Description Resize the browser viewport to specific dimensions. ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments - **width** (integer) - Required - The desired width of the viewport in pixels. - **height** (integer) - Required - The desired height of the viewport in pixels. ### Request Example ```python await browser_resize(width=1920, height=1080) # Mobile viewport await browser_resize(width=375, height=812) ``` ### Response #### Success Response - **message** (string) - A confirmation message indicating the new dimensions (e.g., "Resized browser to 1920x1080"). #### Response Example ```json "Resized browser to 1920x1080" ``` ``` -------------------------------- ### Retrieve Browser Console Messages Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Fetches console messages logged by the browser, allowing filtering by severity level (info, warning, error). Useful for debugging. ```python # Get info level and above (info, warning, error) await browser_console_messages(level="info") # Returns: # [INFO] Application loaded # [WARNING] (https://example.com:42) Deprecated API usage # [ERROR] (https://example.com:15) Failed to load resource ``` ```python # Get only errors await browser_console_messages(level="error") # Returns: # [ERROR] (https://example.com:15) Failed to load resource ``` -------------------------------- ### Capture Screenshots with Browser Automation Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Takes screenshots of the browser viewport, full page, or specific elements. Supports custom filenames and image formats like JPEG. ```python # Screenshot of visible viewport await browser_take_screenshot() # Returns: "Screenshot saved to: /path/screenshots/page-20240115_143022.png" ``` ```python # Full page screenshot await browser_take_screenshot(full_page=True) # Returns: "Screenshot saved to: /path/screenshots/page-20240115_143025.png" ``` ```python # Screenshot with custom filename await browser_take_screenshot(filename="login-page.png") # Returns: "Screenshot saved to: /path/screenshots/login-page.png" ``` ```python # JPEG format screenshot await browser_take_screenshot(type="jpeg", filename="preview.jpeg") # Returns: "Screenshot saved to: /path/screenshots/preview.jpeg" ``` ```python # Element screenshot await browser_take_screenshot( element="Product card", ref="article:product-1" ) # Returns: "Screenshot of Product card saved to: /path/screenshots/page-20240115_143030.png" ``` -------------------------------- ### Click Browser Element Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Performs a click action on a specified element using its reference. Supports single clicks, double clicks, and right clicks. ```python # Single click await browser_click( element="Submit button", ref="button:Submit", button="left" ) # Returns: "Clicked on Submit button" # Double click await browser_click( element="Filename", ref="textbox:filename", double_click=True ) # Returns: "Double-clicked on Filename" # Right click for context menu await browser_click( element="Image", ref="img:profile", button="right" ) # Returns: "Clicked on Image" ``` -------------------------------- ### browser_select_option Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Selects options within a dropdown or select element on the page. ```APIDOC ## POST /browser/select_option ### Description Selects one or more options within a dropdown or select element. This is useful for interacting with form elements that present choices to the user. ### Method POST ### Endpoint /browser/select_option ### Parameters #### Query Parameters - **element** (string) - Required - A human-readable name for the element, used in logs and return messages. - **ref** (string) - Required - A selector to identify the target dropdown/select element (e.g., "combobox:country"). - **values** (array of strings) - Required - An array of strings representing the options to select. For single-select, provide one value; for multi-select, provide all desired values. ### Request Body ```json { "element": "string", "ref": "string", "values": ["string"] } ``` ### Request Example ```json { "element": "Interests", "ref": "combobox:interests", "values": ["Technology", "Science", "Art"] } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the selected options and the element. Example: "Selected 'Technology, Science, Art' in Interests" #### Response Example ```json { "message": "Selected 'Technology, Science, Art' in Interests" } ``` ``` -------------------------------- ### Resize Browser Viewport (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Resizes the browser's viewport to specified dimensions. This is useful for testing responsive web designs or simulating different device screen sizes. Both standard and mobile viewport sizes can be configured. ```python await browser_resize(width=1920, height=1080) # Returns: "Resized browser to 1920x1080" # Mobile viewport await browser_resize(width=375, height=812) # Returns: "Resized browser to 375x812" ``` -------------------------------- ### browser_close Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Closes the browser instance and releases all associated resources. ```APIDOC ## browser_close ### Description Close the browser and clean up all resources. ### Method Asynchronous function call (implied by `await` in examples) ### Endpoint N/A (Direct function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python await browser_close() ``` ### Response #### Success Response - **message** (string) - A confirmation message indicating successful closure (e.g., "Browser closed successfully"). #### Response Example ```json "Browser closed successfully" ``` ``` -------------------------------- ### Type Text into Browser Element Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Types text into an editable element, with options for fast replacement, slow character-by-character typing, and form submission. ```python # Fast fill (replaces content) await browser_type( element="Search box", ref="textbox:Search", text="python automation" ) # Returns: "Typed 'python automation' into Search box" # Slow typing (character by character, triggers key handlers) await browser_type( element="Username field", ref="textbox:username", text="myuser", slowly=True ) # Returns: "Typed 'myuser' into Username field" # Type and submit await browser_type( element="Search input", ref="textbox:q", text="camoufox browser", submit=True ) # Returns: "Typed and submitted 'camoufox browser' into Search input" ``` -------------------------------- ### browser_console_messages Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Retrieves console messages logged by the browser, with optional filtering by severity. ```APIDOC ## GET /browser/console_messages ### Description Fetches console messages (like logs, warnings, and errors) generated by the browser during page execution. Allows filtering by severity level. ### Method GET ### Endpoint /browser/console_messages ### Parameters #### Query Parameters - **level** (string) - Optional - The minimum severity level to retrieve. Options: "info", "warning", "error". Defaults to "info" if not specified. ### Request Example ```json { "level": "error" } ``` ### Response #### Success Response (200) - **messages** (array of objects) - An array containing console messages. Each object typically includes: - **level** (string) - The severity level (e.g., "INFO", "WARNING", "ERROR"). - **text** (string) - The message content. - **url** (string) - The URL where the message originated (if applicable). - **line** (integer) - The line number where the message originated (if applicable). #### Response Example ```json [ { "level": "ERROR", "text": "Failed to load resource", "url": "https://example.com:15", "line": 15 } ] ``` ``` -------------------------------- ### Close Browser Instance (Python) Source: https://context7.com/rlgrpe/camoufox-mcp-python/llms.txt Closes the Camoufox browser instance and releases all associated resources. This function should be called to properly shut down the browser session after automation tasks are completed. ```python await browser_close() # Returns: "Browser closed successfully" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.