======================================================================
Kapture MCP Server Started

HTTP Endpoints:
  MCP clients: http://127.0.0.1:61822/clients
  Resources: http://127.0.0.1:61822/tabs
  Tab info: http://127.0.0.1:61822/tab/{tabId}
  Console: http://127.0.0.1:61822/tab/{tabId}/console
  Screenshot: http://127.0.0.1:61822/tab/{tabId}/screenshot
  View image: http://127.0.0.1:61822/tab/{tabId}/screenshot/view
  Elements: http://127.0.0.1:61822/tab/{tabId}/elements
  Point query: http://127.0.0.1:61822/tab/{tabId}/elementsFromPoint
  DOM: http://127.0.0.1:61822/tab/{tabId}/dom
  Commands: POST http://127.0.0.1:61822/tab/{tabId}/{command}
  New tab: POST http://127.0.0.1:61822/tabs
  Close tab: DELETE http://127.0.0.1:61822/tab/{tabId}
======================================================================
[90m[2026-06-16T11:15:43.791Z][0m New WebSocket connection: /mcp
[90m[2026-06-16T11:15:43.804Z][0m MCP IN: {"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"ssh-kapture","version":"1.0.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-16T11:15:43.813Z][0m MCP client connected (ws-1781608543792-cz4pef6lc): ssh-kapture v1.0.0
[90m[2026-06-16T11:15:43.813Z][0m MCP OUT: {"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":true},"resources":{}},"serverInfo":{"name":"kapture-mcp","version":"2.4.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-16T11:15:44.117Z][0m MCP IN: {"method":"notifications/initialized","jsonrpc":"2.0"}
[90m[2026-06-16T11:15:44.119Z][0m Client initialized (ws-1781608543792-cz4pef6lc)
[90m[2026-06-16T11:15:44.120Z][0m MCP IN: {"method":"tools/list","jsonrpc":"2.0","id":1}
[90m[2026-06-16T11:15:44.121Z][0m MCP OUT: {"result":{"tools":[{"name":"list_tabs","description":"List all connected browser tabs","inputSchema":{"type":"object","properties":{}}},{"name":"tab_detail","description":"Get detailed information about a specific tab","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"navigate","description":"Navigate browser tab to specified URL","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"url":{"type":"string","format":"url","description":"URL to navigate to"},"timeout":{"type":"number","description":"Navigation timeout in milliseconds","default":30000}},"required":["tabId","url"]}},{"name":"back","description":"Navigate back in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"forward","description":"Navigate forward in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"click","description":"Click on a page element using CSS selector or XPath. Only the first  matching element will be clicked. Returns the unique selector of the  clicked element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"hover","description":"Hover over a page element using CSS selector or XPath. Only the first  matching element will be hovered. Returns the unique selector of the  hovered element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"focus","description":"Set focus on a page element using CSS selector or XPath. Only the first  matching element will be focused. Returns the unique selector of the  focused element. Useful for form inputs, buttons, and other interactive  elements.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"blur","description":"Remove focus (blur) from a page element using CSS selector or XPath. Only  the first matching element will be blurred. Returns the unique selector of  the blurred element. Also removes focus from document.activeElement if  different.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"fill","description":"Fill an input field with a value using CSS selector or XPath. Only the  first matching element will be filled. Returns the unique selector of  the filled element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value to fill in the input"}},"required":["tabId","value"]}},{"name":"select","description":"Select an option from an HTML <select> dropdown element using CSS  selector or XPath. Only the first matching select element will be used.  Returns the unique selector of the select element. Note: Only works with  native HTML select elements, not custom dropdowns.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value attribute of the option to select"}},"required":["tabId","value"]}},{"name":"keypress","description":"Send a keypress event to the current tab or a specific element. Uses  Chrome DevTools Protocol for proper key simulation including navigation  keys (Tab, PageDown, arrows) and function keys. When delay > 500ms,  automatically simulates holding the key down with repeated events.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"key":{"type":"string","description":"The key combination to press. Can be a single key (e.g., \"a\",  \"Enter\", \"Tab\", \"PageDown\", \"F5\") or a combination with modifiers  (e.g., \"Control+a\", \"Shift+Tab\", \"Alt+F4\", \"Meta+Shift+p\").  Special keys: Enter, Tab, Delete, Backspace, Escape, Space,  ArrowUp/Down/Left/Right, PageUp/Down, Home, End, Insert, F1-F12.  Modifiers: Control (or Ctrl), Shift, Alt, Meta (or Cmd on Mac)"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between keydown and keyup events. Default:  50ms. Range: 0-60000ms. When > 500ms, simulates holding the key  down with auto-repeat","default":50,"minimum":0,"maximum":60000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Default: 5000ms. Automatically  extended for long delays","minimum":1000,"maximum":70000}},"required":["tabId","key"]}},{"name":"type","description":"Type a string as individual keystrokes (real keydown/keyup/input events per character) via Chrome DevTools Protocol. Unlike `fill`, this works on \"fake\" inputs and rich editors that ignore element.value and react to actual keypresses (autocomplete, input masks, contenteditable). Optionally focuses a target element first (CSS selector or XPath); otherwise types into the currently focused element. Types at the cursor (does not clear - use the `clear` tool first to replace existing content).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to type, character by character"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between each keystroke. Default 0. Increase for sites that debounce or throttle input.","default":0,"minimum":0,"maximum":5000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Auto-extended based on text length and delay when not specified.","minimum":1000,"maximum":120000}},"required":["tabId","text"]}},{"name":"insertText","description":"Insert a whole string at once into the focused element via Chrome DevTools Protocol (like an IME commit or paste - fires input/beforeinput but no per-key events). Best for large blocks of text and editors that accept inserted text (e.g. Google Docs). For inputs that require real keystrokes, use `type` instead. Optionally focuses a target element first (CSS selector or XPath); otherwise inserts at the currently focused element's cursor.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to insert"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId","text"]}},{"name":"clear","description":"Clear a text field by selecting all of its contents and deleting them with real key events (Ctrl/Cmd+A then Backspace) via Chrome DevTools Protocol. Works on inputs, textareas, contenteditable, and \"fake\" inputs that ignore element.value. Optionally focuses a target element first (CSS selector or XPath); otherwise clears the currently focused element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"screenshot","description":"Capture a screenshot of the page or specific element using CSS selector or XPath. When a selector/xpath is provided, only the first matching  element will be captured. Returns the unique selector of the captured  element if applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"scale":{"type":"number","description":"Scale factor (0.1-1.0) to reduce screenshot size (default 0.3)","default":0.3,"minimum":0.1,"maximum":1},"format":{"type":"string","description":"Image format (default webp for best compression)","default":"webp","enum":["webp","jpeg","png"]},"quality":{"type":"number","description":"Compression quality for webp/jpeg (0.1-1.0, default 0.85)","default":0.85,"minimum":0.1,"maximum":1}},"required":["tabId"]}},{"name":"dom","description":"Get outerHTML of the body or a specific element using CSS selector or  XPath. When a selector/xpath is provided, only the first matching  element will be used. Returns the unique selector of the element if  applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"elements","description":"Query all elements matching a CSS selector or XPath and get detailed  information about each element. Use the visible parameter to filter  elements by visibility status.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"visible":{"type":"string","description":"Filter elements by visibility (true = only visible, false = only hidden, all = all elements)","default":"all","enum":["true","false","all"]}},"required":["tabId"]}},{"name":"scroll","description":"Scroll the page or an element. Selector/xpath alone brings the element into view (centered vertically, nested scroll containers handled). x and/or y alone scrolls the document to that absolute coordinate. BOTH together scrolls within the element itself to that offset (e.g. an inner pane or infinite list) and returns the clamped landing position as elementScroll. A missing axis keeps the current offset (e.g. y:0 jumps to the top). Returns the resulting scroll position.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"x":{"type":"number","description":"Absolute horizontal scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"},"y":{"type":"number","description":"Absolute vertical scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"}},"required":["tabId"]}},{"name":"elementsFromPoint","description":"Get information about all elements at a specific coordinate in the viewport","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"x":{"type":"number","description":"X coordinate relative to the viewport"},"y":{"type":"number","description":"Y coordinate relative to the viewport"}},"required":["tabId","x","y"]}},{"name":"console_logs","description":"Get the browser tab's console contents - what you would see in the DevTools console, including console messages, uncaught exceptions, and browser-generated entries (network errors, violations, etc.). Returns newest first.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"before":{"type":"string","description":"Get logs before this timestamp (for pagination)"},"limit":{"type":"integer","description":"Maximum number of logs to return","default":100,"minimum":1,"maximum":500},"level":{"type":"string","description":"Filter logs by level (log, info, warn, error, debug, trace, table, group, groupCollapsed, groupEnd)","enum":["log","info","warn","error","debug","trace","table","group","groupCollapsed","groupEnd"]}},"required":["tabId"]}},{"name":"watch_console","description":"Watch a browser tab's console in real time. Collects console messages, uncaught exceptions, and browser-generated entries as they happen for the timeout duration, then returns them in chronological order. Useful for observing the result of an action (e.g. click something, then watch what the page logs).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"timeout":{"type":"number","description":"How long to watch, in milliseconds","minimum":1000,"maximum":60000}},"required":["tabId","timeout"]}},{"name":"network_monitor","description":"Turn network monitoring on or off for a browser tab. While on, Kapture stays attached to the tab and records every network request (url, method, status, type, size, timing) into a buffer you read with `network_requests`; fetch an individual request/response body with `network_body`. The capture has NO history - it only sees requests that happen while monitoring is on, so enable it BEFORE the traffic you want to observe (e.g. before navigating or clicking). Enable is idempotent per caller: each watching client is tracked by identity, monitoring stays on until every watcher has disabled (or `force` is used), and a client's watchers are released automatically when it disconnects. The request buffer is cleared when monitoring fully stops. Extension 1.1.0+.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"enabled":{"type":"boolean","description":"true to start monitoring, false to stop"},"clientId":{"type":"string","description":"Watcher identity for HTTP callers - pass the same value to enable and disable. MCP clients are identified automatically and should omit this. HTTP calls without one share a single 'http' identity."},"force":{"type":"boolean","description":"With enabled:false, remove ALL watchers and stop monitoring unconditionally"}},"required":["tabId","enabled"]}},{"name":"network_requests","description":"List the network requests captured since monitoring was enabled. Returns lean metadata per request (plus `hasPostData` when the request carried a payload) and a `requestId` to pass to `network_body`. Each request has a monotonic `seq`; poll incrementally by passing the `cursor` from the previous call as `since` to get only newer requests. Returns monitoring:false (and an empty list) if monitoring is not currently on.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"since":{"type":"number","description":"Only return requests with a seq greater than this cursor (use the `cursor` from a prior call). Omit for all buffered requests.","minimum":0},"limit":{"type":"number","description":"Maximum number of requests to return","default":50,"minimum":1,"maximum":1000}},"required":["tabId"]}},{"name":"network_body","description":"Fetch the bodies for a single captured request by `requestId` (from network_requests). Monitoring must be on. Returns the request payload as `requestBody` (when the request had one - see `hasPostData` in the list) and the response body as `body`, plus the request/response headers. The response body is read live from the browser, so it may be unavailable - evicted, from a page that has since navigated away, or a streaming (text/event-stream) response that CDP cannot read - which returns a `bodyError` instead. Binary bodies come back base64-encoded (base64Encoded:true).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"requestId":{"type":"string","description":"The requestId from a network_requests entry"},"maxBytes":{"type":"number","description":"Maximum body bytes to return inline; longer bodies are truncated (bodyTruncated:true) while `size` still reports the full length","default":65536,"minimum":1024,"maximum":1048576}},"required":["tabId","requestId"]}},{"name":"compose","description":"Run a sequence of commands against a single tab in one call. The script is one command per line in the form `<tool>?<query-string>` - a URL query string whose keys are exactly that tool's own parameters. URL-encode each value: spaces as %20 or +, and especially &, %, and newlines (%0A). For example, two lines: `fill?selector=%23q&value=tom%20%26%20jerry` then `wait?t=500`. Commands run in order and stop at the first failure (a command erroring or not finding its element). The whole script is validated first, so an invalid script runs nothing. Returns an array of the per-command responses in order; on failure the last entry holds the error. Eligible commands: navigate, back, forward, reload, click, hover, focus, blur, fill, type, insertText, clear, select, keypress, scroll - plus `wait?t=<ms>` to pause between steps. Data-returning (screenshot, dom, elements, etc.), lifecycle (new_tab, close, show), and evaluate commands are not eligible.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"script":{"type":"string","description":"One command per line, each as `<tool>?<query-string>`"}},"required":["tabId","script"]}},{"name":"new_tab","description":"Opens a new browser tab with the Kapture MCP usage documentation page.  The page will automatically connect to the Kapture server. Returns the  tab ID of the newly opened tab once it connects.","inputSchema":{"type":"object","properties":{"browser":{"type":"string","description":"Optional browser to use. Supported values: chrome, edge, brave, opera, vivaldi. If not specified, uses the system default browser.","enum":["chrome","edge","brave","opera","vivaldi"]}}}},{"name":"close","description":"Closes a browser tab. The tab will be immediately closed and removed  from the connected tabs list.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"reload","description":"Reloads the current page in the browser tab. Performs a standard page  reload similar to pressing F5 or clicking the browser's refresh button.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"show","description":"Brings the browser tab to the front and focuses it. This will switch to  the tab's window and make it the active tab. Useful for directing user  attention to a specific tab when managing multiple browser tabs.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}}]},"jsonrpc":"2.0","id":1}
[90m[2026-06-17T04:47:32.775Z][0m WebSocket transport closed
[90m[2026-06-17T04:47:32.778Z][0m MCP server connection closed (ws-1781608543792-cz4pef6lc)
[90m[2026-06-17T04:47:32.779Z][0m MCP WebSocket client disconnected (ws-1781608543792-cz4pef6lc)
[90m[2026-06-26T04:37:28.190Z][0m New WebSocket connection: /mcp
[90m[2026-06-26T04:37:28.196Z][0m MCP IN: {"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"ssh-kapture","version":"1.0.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-26T04:37:28.198Z][0m MCP client connected (ws-1782448648191-x2m2w89so): ssh-kapture v1.0.0
[90m[2026-06-26T04:37:28.198Z][0m MCP OUT: {"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":true},"resources":{}},"serverInfo":{"name":"kapture-mcp","version":"2.4.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-26T04:37:28.505Z][0m MCP IN: {"method":"notifications/initialized","jsonrpc":"2.0"}
[90m[2026-06-26T04:37:28.506Z][0m Client initialized (ws-1782448648191-x2m2w89so)
[90m[2026-06-26T04:37:28.507Z][0m MCP IN: {"method":"tools/list","jsonrpc":"2.0","id":1}
[90m[2026-06-26T04:37:28.509Z][0m MCP OUT: {"result":{"tools":[{"name":"list_tabs","description":"List all connected browser tabs","inputSchema":{"type":"object","properties":{}}},{"name":"tab_detail","description":"Get detailed information about a specific tab","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"navigate","description":"Navigate browser tab to specified URL","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"url":{"type":"string","format":"url","description":"URL to navigate to"},"timeout":{"type":"number","description":"Navigation timeout in milliseconds","default":30000}},"required":["tabId","url"]}},{"name":"back","description":"Navigate back in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"forward","description":"Navigate forward in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"click","description":"Click on a page element using CSS selector or XPath. Only the first  matching element will be clicked. Returns the unique selector of the  clicked element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"hover","description":"Hover over a page element using CSS selector or XPath. Only the first  matching element will be hovered. Returns the unique selector of the  hovered element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"focus","description":"Set focus on a page element using CSS selector or XPath. Only the first  matching element will be focused. Returns the unique selector of the  focused element. Useful for form inputs, buttons, and other interactive  elements.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"blur","description":"Remove focus (blur) from a page element using CSS selector or XPath. Only  the first matching element will be blurred. Returns the unique selector of  the blurred element. Also removes focus from document.activeElement if  different.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"fill","description":"Fill an input field with a value using CSS selector or XPath. Only the  first matching element will be filled. Returns the unique selector of  the filled element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value to fill in the input"}},"required":["tabId","value"]}},{"name":"select","description":"Select an option from an HTML <select> dropdown element using CSS  selector or XPath. Only the first matching select element will be used.  Returns the unique selector of the select element. Note: Only works with  native HTML select elements, not custom dropdowns.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value attribute of the option to select"}},"required":["tabId","value"]}},{"name":"keypress","description":"Send a keypress event to the current tab or a specific element. Uses  Chrome DevTools Protocol for proper key simulation including navigation  keys (Tab, PageDown, arrows) and function keys. When delay > 500ms,  automatically simulates holding the key down with repeated events.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"key":{"type":"string","description":"The key combination to press. Can be a single key (e.g., \"a\",  \"Enter\", \"Tab\", \"PageDown\", \"F5\") or a combination with modifiers  (e.g., \"Control+a\", \"Shift+Tab\", \"Alt+F4\", \"Meta+Shift+p\").  Special keys: Enter, Tab, Delete, Backspace, Escape, Space,  ArrowUp/Down/Left/Right, PageUp/Down, Home, End, Insert, F1-F12.  Modifiers: Control (or Ctrl), Shift, Alt, Meta (or Cmd on Mac)"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between keydown and keyup events. Default:  50ms. Range: 0-60000ms. When > 500ms, simulates holding the key  down with auto-repeat","default":50,"minimum":0,"maximum":60000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Default: 5000ms. Automatically  extended for long delays","minimum":1000,"maximum":70000}},"required":["tabId","key"]}},{"name":"type","description":"Type a string as individual keystrokes (real keydown/keyup/input events per character) via Chrome DevTools Protocol. Unlike `fill`, this works on \"fake\" inputs and rich editors that ignore element.value and react to actual keypresses (autocomplete, input masks, contenteditable). Optionally focuses a target element first (CSS selector or XPath); otherwise types into the currently focused element. Types at the cursor (does not clear - use the `clear` tool first to replace existing content).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to type, character by character"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between each keystroke. Default 0. Increase for sites that debounce or throttle input.","default":0,"minimum":0,"maximum":5000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Auto-extended based on text length and delay when not specified.","minimum":1000,"maximum":120000}},"required":["tabId","text"]}},{"name":"insertText","description":"Insert a whole string at once into the focused element via Chrome DevTools Protocol (like an IME commit or paste - fires input/beforeinput but no per-key events). Best for large blocks of text and editors that accept inserted text (e.g. Google Docs). For inputs that require real keystrokes, use `type` instead. Optionally focuses a target element first (CSS selector or XPath); otherwise inserts at the currently focused element's cursor.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to insert"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId","text"]}},{"name":"clear","description":"Clear a text field by selecting all of its contents and deleting them with real key events (Ctrl/Cmd+A then Backspace) via Chrome DevTools Protocol. Works on inputs, textareas, contenteditable, and \"fake\" inputs that ignore element.value. Optionally focuses a target element first (CSS selector or XPath); otherwise clears the currently focused element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"screenshot","description":"Capture a screenshot of the page or specific element using CSS selector or XPath. When a selector/xpath is provided, only the first matching  element will be captured. Returns the unique selector of the captured  element if applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"scale":{"type":"number","description":"Scale factor (0.1-1.0) to reduce screenshot size (default 0.3)","default":0.3,"minimum":0.1,"maximum":1},"format":{"type":"string","description":"Image format (default webp for best compression)","default":"webp","enum":["webp","jpeg","png"]},"quality":{"type":"number","description":"Compression quality for webp/jpeg (0.1-1.0, default 0.85)","default":0.85,"minimum":0.1,"maximum":1}},"required":["tabId"]}},{"name":"dom","description":"Get outerHTML of the body or a specific element using CSS selector or  XPath. When a selector/xpath is provided, only the first matching  element will be used. Returns the unique selector of the element if  applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"elements","description":"Query all elements matching a CSS selector or XPath and get detailed  information about each element. Use the visible parameter to filter  elements by visibility status.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"visible":{"type":"string","description":"Filter elements by visibility (true = only visible, false = only hidden, all = all elements)","default":"all","enum":["true","false","all"]}},"required":["tabId"]}},{"name":"scroll","description":"Scroll the page or an element. Selector/xpath alone brings the element into view (centered vertically, nested scroll containers handled). x and/or y alone scrolls the document to that absolute coordinate. BOTH together scrolls within the element itself to that offset (e.g. an inner pane or infinite list) and returns the clamped landing position as elementScroll. A missing axis keeps the current offset (e.g. y:0 jumps to the top). Returns the resulting scroll position.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"x":{"type":"number","description":"Absolute horizontal scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"},"y":{"type":"number","description":"Absolute vertical scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"}},"required":["tabId"]}},{"name":"elementsFromPoint","description":"Get information about all elements at a specific coordinate in the viewport","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"x":{"type":"number","description":"X coordinate relative to the viewport"},"y":{"type":"number","description":"Y coordinate relative to the viewport"}},"required":["tabId","x","y"]}},{"name":"console_logs","description":"Get the browser tab's console contents - what you would see in the DevTools console, including console messages, uncaught exceptions, and browser-generated entries (network errors, violations, etc.). Returns newest first.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"before":{"type":"string","description":"Get logs before this timestamp (for pagination)"},"limit":{"type":"integer","description":"Maximum number of logs to return","default":100,"minimum":1,"maximum":500},"level":{"type":"string","description":"Filter logs by level (log, info, warn, error, debug, trace, table, group, groupCollapsed, groupEnd)","enum":["log","info","warn","error","debug","trace","table","group","groupCollapsed","groupEnd"]}},"required":["tabId"]}},{"name":"watch_console","description":"Watch a browser tab's console in real time. Collects console messages, uncaught exceptions, and browser-generated entries as they happen for the timeout duration, then returns them in chronological order. Useful for observing the result of an action (e.g. click something, then watch what the page logs).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"timeout":{"type":"number","description":"How long to watch, in milliseconds","minimum":1000,"maximum":60000}},"required":["tabId","timeout"]}},{"name":"network_monitor","description":"Turn network monitoring on or off for a browser tab. While on, Kapture stays attached to the tab and records every network request (url, method, status, type, size, timing) into a buffer you read with `network_requests`; fetch an individual request/response body with `network_body`. The capture has NO history - it only sees requests that happen while monitoring is on, so enable it BEFORE the traffic you want to observe (e.g. before navigating or clicking). Enable is idempotent per caller: each watching client is tracked by identity, monitoring stays on until every watcher has disabled (or `force` is used), and a client's watchers are released automatically when it disconnects. The request buffer is cleared when monitoring fully stops. Extension 1.1.0+.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"enabled":{"type":"boolean","description":"true to start monitoring, false to stop"},"clientId":{"type":"string","description":"Watcher identity for HTTP callers - pass the same value to enable and disable. MCP clients are identified automatically and should omit this. HTTP calls without one share a single 'http' identity."},"force":{"type":"boolean","description":"With enabled:false, remove ALL watchers and stop monitoring unconditionally"}},"required":["tabId","enabled"]}},{"name":"network_requests","description":"List the network requests captured since monitoring was enabled. Returns lean metadata per request (plus `hasPostData` when the request carried a payload) and a `requestId` to pass to `network_body`. Each request has a monotonic `seq`; poll incrementally by passing the `cursor` from the previous call as `since` to get only newer requests. Returns monitoring:false (and an empty list) if monitoring is not currently on.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"since":{"type":"number","description":"Only return requests with a seq greater than this cursor (use the `cursor` from a prior call). Omit for all buffered requests.","minimum":0},"limit":{"type":"number","description":"Maximum number of requests to return","default":50,"minimum":1,"maximum":1000}},"required":["tabId"]}},{"name":"network_body","description":"Fetch the bodies for a single captured request by `requestId` (from network_requests). Monitoring must be on. Returns the request payload as `requestBody` (when the request had one - see `hasPostData` in the list) and the response body as `body`, plus the request/response headers. The response body is read live from the browser, so it may be unavailable - evicted, from a page that has since navigated away, or a streaming (text/event-stream) response that CDP cannot read - which returns a `bodyError` instead. Binary bodies come back base64-encoded (base64Encoded:true).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"requestId":{"type":"string","description":"The requestId from a network_requests entry"},"maxBytes":{"type":"number","description":"Maximum body bytes to return inline; longer bodies are truncated (bodyTruncated:true) while `size` still reports the full length","default":65536,"minimum":1024,"maximum":1048576}},"required":["tabId","requestId"]}},{"name":"compose","description":"Run a sequence of commands against a single tab in one call. The script is one command per line in the form `<tool>?<query-string>` - a URL query string whose keys are exactly that tool's own parameters. URL-encode each value: spaces as %20 or +, and especially &, %, and newlines (%0A). For example, two lines: `fill?selector=%23q&value=tom%20%26%20jerry` then `wait?t=500`. Commands run in order and stop at the first failure (a command erroring or not finding its element). The whole script is validated first, so an invalid script runs nothing. Returns an array of the per-command responses in order; on failure the last entry holds the error. Eligible commands: navigate, back, forward, reload, click, hover, focus, blur, fill, type, insertText, clear, select, keypress, scroll - plus `wait?t=<ms>` to pause between steps. Data-returning (screenshot, dom, elements, etc.), lifecycle (new_tab, close, show), and evaluate commands are not eligible.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"script":{"type":"string","description":"One command per line, each as `<tool>?<query-string>`"}},"required":["tabId","script"]}},{"name":"new_tab","description":"Opens a new browser tab with the Kapture MCP usage documentation page.  The page will automatically connect to the Kapture server. Returns the  tab ID of the newly opened tab once it connects.","inputSchema":{"type":"object","properties":{"browser":{"type":"string","description":"Optional browser to use. Supported values: chrome, edge, brave, opera, vivaldi. If not specified, uses the system default browser.","enum":["chrome","edge","brave","opera","vivaldi"]}}}},{"name":"close","description":"Closes a browser tab. The tab will be immediately closed and removed  from the connected tabs list.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"reload","description":"Reloads the current page in the browser tab. Performs a standard page  reload similar to pressing F5 or clicking the browser's refresh button.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"show","description":"Brings the browser tab to the front and focuses it. This will switch to  the tab's window and make it the active tab. Useful for directing user  attention to a specific tab when managing multiple browser tabs.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}}]},"jsonrpc":"2.0","id":1}
[90m[2026-06-30T14:37:12.805Z][0m WebSocket transport closed
[90m[2026-06-30T14:37:12.809Z][0m MCP server connection closed (ws-1782448648191-x2m2w89so)
[90m[2026-06-30T14:37:12.809Z][0m MCP WebSocket client disconnected (ws-1782448648191-x2m2w89so)
[90m[2026-06-30T14:38:28.776Z][0m New WebSocket connection: /mcp
[90m[2026-06-30T14:38:28.783Z][0m MCP IN: {"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"ssh-kapture","version":"1.0.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-30T14:38:28.785Z][0m MCP client connected (ws-1782830308776-ox4e5j876): ssh-kapture v1.0.0
[90m[2026-06-30T14:38:28.785Z][0m MCP OUT: {"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":true},"resources":{}},"serverInfo":{"name":"kapture-mcp","version":"2.4.0"}},"jsonrpc":"2.0","id":0}
[90m[2026-06-30T14:38:29.169Z][0m MCP IN: {"method":"notifications/initialized","jsonrpc":"2.0"}
[90m[2026-06-30T14:38:29.174Z][0m Client initialized (ws-1782830308776-ox4e5j876)
[90m[2026-06-30T14:38:29.174Z][0m MCP IN: {"method":"tools/list","jsonrpc":"2.0","id":1}
[90m[2026-06-30T14:38:29.176Z][0m MCP OUT: {"result":{"tools":[{"name":"list_tabs","description":"List all connected browser tabs","inputSchema":{"type":"object","properties":{}}},{"name":"tab_detail","description":"Get detailed information about a specific tab","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"navigate","description":"Navigate browser tab to specified URL","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"url":{"type":"string","format":"url","description":"URL to navigate to"},"timeout":{"type":"number","description":"Navigation timeout in milliseconds","default":30000}},"required":["tabId","url"]}},{"name":"back","description":"Navigate back in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"forward","description":"Navigate forward in browser history","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"click","description":"Click on a page element using CSS selector or XPath. Only the first  matching element will be clicked. Returns the unique selector of the  clicked element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"hover","description":"Hover over a page element using CSS selector or XPath. Only the first  matching element will be hovered. Returns the unique selector of the  hovered element. Note: May experience delays if Kapture DevTools panel  is not the active tab.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"focus","description":"Set focus on a page element using CSS selector or XPath. Only the first  matching element will be focused. Returns the unique selector of the  focused element. Useful for form inputs, buttons, and other interactive  elements.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"blur","description":"Remove focus (blur) from a page element using CSS selector or XPath. Only  the first matching element will be blurred. Returns the unique selector of  the blurred element. Also removes focus from document.activeElement if  different.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"fill","description":"Fill an input field with a value using CSS selector or XPath. Only the  first matching element will be filled. Returns the unique selector of  the filled element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value to fill in the input"}},"required":["tabId","value"]}},{"name":"select","description":"Select an option from an HTML <select> dropdown element using CSS  selector or XPath. Only the first matching select element will be used.  Returns the unique selector of the select element. Note: Only works with  native HTML select elements, not custom dropdowns.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"value":{"type":"string","description":"Value attribute of the option to select"}},"required":["tabId","value"]}},{"name":"keypress","description":"Send a keypress event to the current tab or a specific element. Uses  Chrome DevTools Protocol for proper key simulation including navigation  keys (Tab, PageDown, arrows) and function keys. When delay > 500ms,  automatically simulates holding the key down with repeated events.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"key":{"type":"string","description":"The key combination to press. Can be a single key (e.g., \"a\",  \"Enter\", \"Tab\", \"PageDown\", \"F5\") or a combination with modifiers  (e.g., \"Control+a\", \"Shift+Tab\", \"Alt+F4\", \"Meta+Shift+p\").  Special keys: Enter, Tab, Delete, Backspace, Escape, Space,  ArrowUp/Down/Left/Right, PageUp/Down, Home, End, Insert, F1-F12.  Modifiers: Control (or Ctrl), Shift, Alt, Meta (or Cmd on Mac)"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between keydown and keyup events. Default:  50ms. Range: 0-60000ms. When > 500ms, simulates holding the key  down with auto-repeat","default":50,"minimum":0,"maximum":60000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Default: 5000ms. Automatically  extended for long delays","minimum":1000,"maximum":70000}},"required":["tabId","key"]}},{"name":"type","description":"Type a string as individual keystrokes (real keydown/keyup/input events per character) via Chrome DevTools Protocol. Unlike `fill`, this works on \"fake\" inputs and rich editors that ignore element.value and react to actual keypresses (autocomplete, input masks, contenteditable). Optionally focuses a target element first (CSS selector or XPath); otherwise types into the currently focused element. Types at the cursor (does not clear - use the `clear` tool first to replace existing content).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to type, character by character"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"delay":{"type":"number","description":"Delay in milliseconds between each keystroke. Default 0. Increase for sites that debounce or throttle input.","default":0,"minimum":0,"maximum":5000},"timeout":{"type":"number","description":"Command timeout in milliseconds. Auto-extended based on text length and delay when not specified.","minimum":1000,"maximum":120000}},"required":["tabId","text"]}},{"name":"insertText","description":"Insert a whole string at once into the focused element via Chrome DevTools Protocol (like an IME commit or paste - fires input/beforeinput but no per-key events). Best for large blocks of text and editors that accept inserted text (e.g. Google Docs). For inputs that require real keystrokes, use `type` instead. Optionally focuses a target element first (CSS selector or XPath); otherwise inserts at the currently focused element's cursor.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"text":{"type":"string","description":"The text to insert"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId","text"]}},{"name":"clear","description":"Clear a text field by selecting all of its contents and deleting them with real key events (Ctrl/Cmd+A then Backspace) via Chrome DevTools Protocol. Works on inputs, textareas, contenteditable, and \"fake\" inputs that ignore element.value. Optionally focuses a target element first (CSS selector or XPath); otherwise clears the currently focused element.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"screenshot","description":"Capture a screenshot of the page or specific element using CSS selector or XPath. When a selector/xpath is provided, only the first matching  element will be captured. Returns the unique selector of the captured  element if applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"scale":{"type":"number","description":"Scale factor (0.1-1.0) to reduce screenshot size (default 0.3)","default":0.3,"minimum":0.1,"maximum":1},"format":{"type":"string","description":"Image format (default webp for best compression)","default":"webp","enum":["webp","jpeg","png"]},"quality":{"type":"number","description":"Compression quality for webp/jpeg (0.1-1.0, default 0.85)","default":0.85,"minimum":0.1,"maximum":1}},"required":["tabId"]}},{"name":"dom","description":"Get outerHTML of the body or a specific element using CSS selector or  XPath. When a selector/xpath is provided, only the first matching  element will be used. Returns the unique selector of the element if  applicable.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"}},"required":["tabId"]}},{"name":"elements","description":"Query all elements matching a CSS selector or XPath and get detailed  information about each element. Use the visible parameter to filter  elements by visibility status.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"visible":{"type":"string","description":"Filter elements by visibility (true = only visible, false = only hidden, all = all elements)","default":"all","enum":["true","false","all"]}},"required":["tabId"]}},{"name":"scroll","description":"Scroll the page or an element. Selector/xpath alone brings the element into view (centered vertically, nested scroll containers handled). x and/or y alone scrolls the document to that absolute coordinate. BOTH together scrolls within the element itself to that offset (e.g. an inner pane or infinite list) and returns the clamped landing position as elementScroll. A missing axis keeps the current offset (e.g. y:0 jumps to the top). Returns the resulting scroll position.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"selector":{"type":"string","description":"The CSS selector to find a target Element for the action (uses first matching element)"},"xpath":{"type":"string","description":"An XPath expression to find a target Element for the action (alternative to selector, uses first matching element)"},"x":{"type":"number","description":"Absolute horizontal scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"},"y":{"type":"number","description":"Absolute vertical scroll position in pixels (document coordinates, or within the element when a selector/xpath is given)"}},"required":["tabId"]}},{"name":"elementsFromPoint","description":"Get information about all elements at a specific coordinate in the viewport","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"x":{"type":"number","description":"X coordinate relative to the viewport"},"y":{"type":"number","description":"Y coordinate relative to the viewport"}},"required":["tabId","x","y"]}},{"name":"console_logs","description":"Get the browser tab's console contents - what you would see in the DevTools console, including console messages, uncaught exceptions, and browser-generated entries (network errors, violations, etc.). Returns newest first.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"before":{"type":"string","description":"Get logs before this timestamp (for pagination)"},"limit":{"type":"integer","description":"Maximum number of logs to return","default":100,"minimum":1,"maximum":500},"level":{"type":"string","description":"Filter logs by level (log, info, warn, error, debug, trace, table, group, groupCollapsed, groupEnd)","enum":["log","info","warn","error","debug","trace","table","group","groupCollapsed","groupEnd"]}},"required":["tabId"]}},{"name":"watch_console","description":"Watch a browser tab's console in real time. Collects console messages, uncaught exceptions, and browser-generated entries as they happen for the timeout duration, then returns them in chronological order. Useful for observing the result of an action (e.g. click something, then watch what the page logs).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"timeout":{"type":"number","description":"How long to watch, in milliseconds","minimum":1000,"maximum":60000}},"required":["tabId","timeout"]}},{"name":"network_monitor","description":"Turn network monitoring on or off for a browser tab. While on, Kapture stays attached to the tab and records every network request (url, method, status, type, size, timing) into a buffer you read with `network_requests`; fetch an individual request/response body with `network_body`. The capture has NO history - it only sees requests that happen while monitoring is on, so enable it BEFORE the traffic you want to observe (e.g. before navigating or clicking). Enable is idempotent per caller: each watching client is tracked by identity, monitoring stays on until every watcher has disabled (or `force` is used), and a client's watchers are released automatically when it disconnects. The request buffer is cleared when monitoring fully stops. Extension 1.1.0+.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"enabled":{"type":"boolean","description":"true to start monitoring, false to stop"},"clientId":{"type":"string","description":"Watcher identity for HTTP callers - pass the same value to enable and disable. MCP clients are identified automatically and should omit this. HTTP calls without one share a single 'http' identity."},"force":{"type":"boolean","description":"With enabled:false, remove ALL watchers and stop monitoring unconditionally"}},"required":["tabId","enabled"]}},{"name":"network_requests","description":"List the network requests captured since monitoring was enabled. Returns lean metadata per request (plus `hasPostData` when the request carried a payload) and a `requestId` to pass to `network_body`. Each request has a monotonic `seq`; poll incrementally by passing the `cursor` from the previous call as `since` to get only newer requests. Returns monitoring:false (and an empty list) if monitoring is not currently on.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"since":{"type":"number","description":"Only return requests with a seq greater than this cursor (use the `cursor` from a prior call). Omit for all buffered requests.","minimum":0},"limit":{"type":"number","description":"Maximum number of requests to return","default":50,"minimum":1,"maximum":1000}},"required":["tabId"]}},{"name":"network_body","description":"Fetch the bodies for a single captured request by `requestId` (from network_requests). Monitoring must be on. Returns the request payload as `requestBody` (when the request had one - see `hasPostData` in the list) and the response body as `body`, plus the request/response headers. The response body is read live from the browser, so it may be unavailable - evicted, from a page that has since navigated away, or a streaming (text/event-stream) response that CDP cannot read - which returns a `bodyError` instead. Binary bodies come back base64-encoded (base64Encoded:true).","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"requestId":{"type":"string","description":"The requestId from a network_requests entry"},"maxBytes":{"type":"number","description":"Maximum body bytes to return inline; longer bodies are truncated (bodyTruncated:true) while `size` still reports the full length","default":65536,"minimum":1024,"maximum":1048576}},"required":["tabId","requestId"]}},{"name":"compose","description":"Run a sequence of commands against a single tab in one call. The script is one command per line in the form `<tool>?<query-string>` - a URL query string whose keys are exactly that tool's own parameters. URL-encode each value: spaces as %20 or +, and especially &, %, and newlines (%0A). For example, two lines: `fill?selector=%23q&value=tom%20%26%20jerry` then `wait?t=500`. Commands run in order and stop at the first failure (a command erroring or not finding its element). The whole script is validated first, so an invalid script runs nothing. Returns an array of the per-command responses in order; on failure the last entry holds the error. Eligible commands: navigate, back, forward, reload, click, hover, focus, blur, fill, type, insertText, clear, select, keypress, scroll - plus `wait?t=<ms>` to pause between steps. Data-returning (screenshot, dom, elements, etc.), lifecycle (new_tab, close, show), and evaluate commands are not eligible.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"},"script":{"type":"string","description":"One command per line, each as `<tool>?<query-string>`"}},"required":["tabId","script"]}},{"name":"new_tab","description":"Opens a new browser tab with the Kapture MCP usage documentation page.  The page will automatically connect to the Kapture server. Returns the  tab ID of the newly opened tab once it connects.","inputSchema":{"type":"object","properties":{"browser":{"type":"string","description":"Optional browser to use. Supported values: chrome, edge, brave, opera, vivaldi. If not specified, uses the system default browser.","enum":["chrome","edge","brave","opera","vivaldi"]}}}},{"name":"close","description":"Closes a browser tab. The tab will be immediately closed and removed  from the connected tabs list.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"reload","description":"Reloads the current page in the browser tab. Performs a standard page  reload similar to pressing F5 or clicking the browser's refresh button.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}},{"name":"show","description":"Brings the browser tab to the front and focuses it. This will switch to  the tab's window and make it the active tab. Useful for directing user  attention to a specific tab when managing multiple browser tabs.","inputSchema":{"type":"object","properties":{"tabId":{"type":"string","description":"Target tab ID"}},"required":["tabId"]}}]},"jsonrpc":"2.0","id":1}
