Skip to main content
Glama
mcp-server-visual-stack-browser

mcp-server-visual-stack-browser

by cadivus

mcp-server-visual-stack-browser

A Model Context Protocol (MCP) server that gives LLMs and AI Agents the ability to navigate, interact with, and debug web applications visually and programmatically.

Built on top of Playwright and Tesseract OCR, this server bypasses the limitations of standard DOM-scraping by allowing agents to "see" the screen, click by exact (x,y) coordinates, and pull deep JavaScript execution context via stack traces.

It provides spatial text coordinates via OCR, allowing agents to interact with visual elements without relying on expensive and slow vision-model screenshot analysis.


šŸš€ Why this exists

Standard web-scraping and AI browser tools rely heavily on the DOM tree. But what happens when the DOM is empty, obfuscated, or when vision models are too expensive? mcp-server-visual-stack-browser is specifically designed for:

  • Cost-Efficient AI Browsing: Get exact coordinates for text elements via lightweight OCR, entirely bypassing the high token costs and latency of sending full screenshots to vision models.

  • Canvas & WebGL Apps: Games, maps, or complex visualizers where UI elements don't exist in the HTML.

  • Flutter for Web: Applications rendered entirely on a canvas.

  • Complex SPAs & Legacy UIs: Where standard CSS selectors fail or change dynamically.

  • Deep Debugging: Correlating visual UI errors with underlying JavaScript console logs and stack traces.


Related MCP server: Playwright MCP Server for Security

✨ Core Capabilities

  • šŸ‘ļø Visual Navigation (Zero-Vision Mode): Perform OCR to find text bounding boxes and click via exact coordinates. No CSS selectors or expensive vision models required.

  • šŸ› Deep Execution Tracing: Capture console logs, intercept errors, and pull full JavaScript stack traces directly from the browser runtime.

  • šŸ¤– Human-like Interaction: Scroll natively, simulate real keystrokes with human-like delays, and execute arbitrary JS in the page context.


šŸ› ļø Available MCP Tools

This server exposes the following tools via the MCP ListTools / CallTool API:

Browser & Session Management

  • start_browser: Launches a Chrome or Firefox session (headed or headless) and returns a session ID. Begins real-time capture of console logs and page errors.

  • Maps: Navigates the browser to a URL. Supports waiting for specific load conditions (load, DOMContentLoaded, networkidle, commit).

  • get_current_url: Returns the current page URL and title for the active session.

Visual & OCR Interactivity

  • ocr_screenshot: Runs Tesseract OCR on the current viewport. Returns the text alongside exact (x, y) coordinates and bounding boxes for text blocks. This allows the model to locate and interact with UI elements purely through text data, avoiding the need for expensive screenshot analysis.

  • ocr_screenshot_search: Runs OCR to search for a specific "needle" string, returning exact matches with positional data ready for coordinate clicking.

  • take_screenshot: Captures a PNG screenshot of the current viewport, returned as a base64 image blob (for when full visual analysis is actually needed).

  • click_at_coordinates: Clicks a point in the viewport by (x, y). Automatically handles scaling if the LLM is working from a resized/downscaled screenshot.

Page Interaction

  • scroll: Scrolls the viewport up, down, left, or right by a percentage. Returns current scroll state and whether further scrolling is possible.

  • type_text: Simulates character-by-character typing into the currently focused element. Includes optional per-keystroke delays to emulate human behavior.

  • press_key: Sends specific key presses or combinations (e.g., Enter, Tab, Ctrl+V).

JavaScript & Debugging

  • execute_javascript: Runs arbitrary JavaScript in the current page context. Fully supports async code (await).

  • get_console_logs: Retrieves console log entries collected since the session started. Supports filtering by severity level (ALL, DEBUG, INFO, WARNING, SEVERE).

  • get_console_log_stacktrace: Retrieves the deep execution stack trace for a specific log entry ID (powered by Chrome CDP).


āš™ļø Installation & Quick Start

Claude Desktop Configuration

To use this with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "visual-stack-browser": {
      "command": "npx",
      "args": ["-y", "@cadivus/mcp-server-visual-stack-browser"]
    }
  }
}


šŸ·ļø Keywords

mcp, model-context-protocol, playwright, browser-automation, ocr, canvas-testing, webgl-automation, javascript-debugging, stack-trace, llm-tools, ai-agent

Available Tools

13 tools
click_at_coordinatesA

Click at (x, y) coordinates in the viewport. Use take_screenshot first to visually locate the target element and determine its coordinates. If coordinates were obtained from a resized screenshot, set relative_by_width/height to the screenshot dimensions to map them back.

Inputs: x (required), y (required), session_id (required), relative_by_width, +1 more.

execute_javascriptB

Execute JavaScript in the current browser page. The return value of the script is returned as text. Set async to true to write code that uses await.

Inputs: script (required), session_id (required), args, async.

get_console_logsA

Fetch browser console log entries accumulated since the session started. Each entry has a unique time-based ID (unix timestamp in ms). Use get_console_log_stacktrace to retrieve the stack trace for a specific entry.

Inputs: session_id (required), level.

get_console_log_stacktraceA

Get the stack trace for a specific browser console log entry by its ID. Only available for entries that include CDP stack trace data (Chrome).

Inputs: log_id (required), session_id (required).

get_current_urlB

Get the current URL of the browser page. Returns the full URL including any query parameters and fragments.

Inputs: session_id (required).

ocr_screenshotA

PREFERRED over take_screenshot when you only need text or want to locate/click a text element (cheaper, no vision model needed). Runs OCR on the current page. blocks=false (default) returns a plain string. blocks=true returns JSON: [{ text, center_x, center_y, is_likely_button? }] — spatially grouped phrases that isolate buttons, labels, links, etc. is_likely_button field is only present when true (text has a visible border/frame and looks clickable). center_x/center_y are ready to pass to click_at_coordinates. Use ocr_screenshot_search to find a specific word or phrase.

Inputs: session_id (required), lang, blocks.

press_keyA

Press a key or key combination. Supports special keys like Enter, Backspace, Tab, Escape, ArrowUp, etc. For key combinations, use '+' as separator: 'Control+c', 'Control+Shift+a', 'Meta+v' (Cmd on Mac). Common keys: Enter, Backspace, Delete, Tab, Escape, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, F1-F12, Control, Shift, Alt, Meta. For single printable characters, prefer type_text instead.

Inputs: key (required), session_id (required), count.

scrollA

Scroll the page up, down, left, or right by a percentage of the viewport size. Returns whether further scrolling is possible in each direction.

Inputs: direction (required), session_id (required), scroll_amount.

start_browserA

Launch a Chrome or Firefox browser session. Returns a session ID used by subsequent browser tools.

Inputs: browser (required), url, width, height, +1 more.

take_screenshotA

Returns the current page as a PNG image blob for visual inspection. Use only when you need to analyse layout, images, or visual structure. For reading text or locating text buttons use ocr_screenshot instead — it is faster and costs no vision tokens.

Inputs: session_id (required).

type_textA

Type a string of text into the currently focused element. This simulates real keypresses one character at a time. Make sure the target element is focused first (e.g. by clicking on it).

Inputs: text (required), session_id (required), delay.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a distinct action: navigation, clicking, typing, key presses, scrolling, JS execution, console logs, URL, and three clearly differentiated capture modes. The descriptions explicitly resolve the only potential overlaps (take_screenshot vs ocr_screenshot vs ocr_screenshot_search, and get_console_logs vs get_console_log_stacktrace), telling the agent which to prefer and why.

    Naming Consistency4/5

    All names are lowercase snake_case, which keeps the set readable. However, the verb position varies: most are verb_noun (get_console_logs, take_screenshot, click_at_coordinates, type_text, press_key) while ocr_screenshot and ocr_screenshot_search lead with a noun, and scroll/navigate are bare verbs.

    Tool Count5/5

    13 tools sits squarely in the well-scoped range for a browser automation server, with each tool covering a distinct primitive (session, navigation, input, capture, inspection). No tool feels redundant or padded.

    Completeness4/5

    Core browser lifecycle is covered: launch, navigate, click, type, key, scroll, capture, inspect DOM via JS, and read console/URL. Gaps remain: there is no close/stop session tool to pair with start_browser, no selector-based click/typing, and no tab/window or wait-for-element handling, though execute_javascript provides a workaround for most of these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides browser automation capabilities for LLMs using Playwright, leveraging structured accessibility snapshots to interact with web pages without needing vision models. It enables tasks like web navigation, data extraction, and automated testing through a lightweight and deterministic toolset.
      7 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables browser automation using Playwright, allowing LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.
      MIT