local-browser-mcp-server
Enables AI image generation using Google Gemini 2.0 Flash, generating custom images from text descriptions.
Provides browser automation capabilities using Puppeteer, allowing navigation, screenshot capture, element interaction (clicking, typing, scrolling), and page information retrieval.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-browser-mcp-server Navigate to google.com and take a screenshot"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local Browser MCP Server
A Model Context Protocol (MCP) server that provides browser automation capabilities using Puppeteer, plus AI image generation using Google Gemini 2.0 Flash. This server allows you to control a local Chrome browser instance, take screenshots, perform interactions like clicking and typing, and generate custom images - perfect for testing websites and creating content with Cursor.
Features
š Browser Navigation: Navigate to URLs, go back/forward, refresh pages
šø Screenshots: Capture full page, viewport, or specific element screenshots
š±ļø Click Actions: Click on elements using CSS selectors
āØļø Text Input: Type text into input fields and forms
š Scrolling: Scroll pages in any direction
ā³ Wait Operations: Wait for elements to appear
š Page Info: Get current page title, URL, and viewport information
šØ AI Image Generation: Generate custom images using Google Gemini 2.0 Flash Preview
Related MCP server: Puppeteer MCP Server
Installation
Clone/Download this repository to your local machine
Install dependencies:
npm installBuild the project:
npm run buildSet up environment variables (for image generation): Create a
.envfile in the project root:GOOGLE_AI_KEY=your_google_ai_api_key_hereGet your API key from Google AI Studio.
Usage with Cursor
Step 1: Start the HTTP Server
The recommended way to use this MCP server is through HTTP mode to avoid ES module compatibility issues:
npm run start:httpThis starts the server on http://localhost:3045 and keeps it running.
Step 2: Configure MCP in Cursor
Create or update your cursor-mcp-config.json file with the following configuration:
{
"mcpServers": {
"local-browser": {
"command": "node",
"args": ["/absolute/path/to/your/project/mcp-http-bridge.js"],
"env": {
"NODE_ENV": "production"
}
}
}
}Important:
Replace
/absolute/path/to/your/project/with the actual absolute path to your project directoryThe HTTP bridge (
mcp-http-bridge.js) routes MCP requests to the HTTP serverMake sure the HTTP server is running before using the tools in Cursor
Step 3: Restart Cursor
After updating the configuration, restart Cursor to load the new MCP server.
Step 4: Start Using the Tools
Once configured, you can use the following tools in Cursor:
Browser Navigation
navigate_to_url- Navigate to any URLgo_back- Go back in browser historygo_forward- Go forward in browser historyrefresh_page- Refresh the current page
Screenshots & Visual Capture
take_screenshot- Capture screenshots (full page, viewport, or specific elements)
Page Interactions
click_element- Click on elements using CSS selectorstype_text- Type text into input fieldsscroll_page- Scroll the page in any directionwait_for_element- Wait for elements to appear
Page Information
get_page_info- Get current page title, URL, and viewport info
AI Image Generation
generate_image- Generate custom images using Google Gemini 2.0 Flash Preview
Quick Start Example
Here's how to get started quickly:
Start the HTTP server:
npm run start:httpIn Cursor, try these commands:
"Navigate to google.com and take a screenshot"
"Generate an image of a sunset over mountains"
"Click on the search button and type 'hello world'"
Example Workflow
Here's a typical workflow when testing a website you've created:
Navigate to your local development server:
Use navigate_to_url with "http://localhost:3000"Take a screenshot to see the current state:
Use take_screenshot to capture the full pageInteract with your website:
Use click_element to click buttons Use type_text to fill out forms Use scroll_page to test scrolling behaviorCapture results:
Use take_screenshot again to see changes
Tool Reference
navigate_to_url
Navigate the browser to a specific URL.
url(required): The URL to navigate to
take_screenshot
Take a screenshot of the current page.
fullPage(optional): Capture full page vs viewport onlyselector(optional): CSS selector to screenshot specific element
click_element
Click on an element specified by CSS selector.
selector(required): CSS selector of element to clickwaitFor(optional): Milliseconds to wait after clicking (default: 1000)
type_text
Type text into an input field.
selector(required): CSS selector of input elementtext(required): Text to typeclear(optional): Clear field before typing (default: true)
wait_for_element
Wait for an element to appear on the page.
selector(required): CSS selector to wait fortimeout(optional): Timeout in milliseconds (default: 5000)
scroll_page
Scroll the page.
direction(required): 'up', 'down', 'top', or 'bottom'amount(optional): Pixels to scroll for up/down (default: 500)
get_page_info
Get information about the current page (title, URL, viewport size).
refresh_page
Refresh the current page.
go_back
Navigate back in browser history.
go_forward
Navigate forward in browser history.
generate_image
Generate custom AI images using Google Gemini 2.0 Flash Preview.
description(required): Text description of the image to generate
Generated images are automatically saved to the generated-images/ directory and can be downloaded via HTTP at http://localhost:3045/download/{filename}.
Development
Build:
npm run buildDevelopment mode:
npm run dev(watches for changes)Start:
npm start(visible browser) ornpm run start:headless(background)HTTP Test Server:
npm run start:http(visible) ornpm run start:http:headless(background)
Browser Behavior
Visible Mode: Browser window opens so you can see what's happening
Headless Mode: Browser runs in background (set
MCP_HEADLESS=true)Separate Profile: Uses
/tmp/chrome-mcp-datato avoid conflicts with your main ChromeDefault viewport: 1280x720 pixels
Screenshots: Returned as base64-encoded PNG images
Troubleshooting
Browser doesn't launch
Ensure Chrome is installed on your system
Check that no other processes are blocking Chrome
Try restarting the HTTP server:
npm run start:httpClear Chrome data directory:
rm -rf /private/tmp/chrome-mcp-data
Elements not found
Verify CSS selectors are correct
Use browser dev tools to test selectors
Try waiting for elements to load with
wait_for_element
MCP Tools not available in Cursor
Ensure the HTTP server is running:
npm run start:httpCheck that
cursor-mcp-config.jsonhas the correct absolute pathRestart Cursor after configuration changes
Verify the HTTP bridge file exists:
mcp-http-bridge.js
Image generation not working
Ensure
GOOGLE_AI_KEYis set in your.envfileGet your API key from Google AI Studio
Check that the HTTP server is running (image generation requires HTTP mode)
Permission issues
Ensure the MCP server has permission to launch Chrome
Check file permissions on the built JavaScript files
On macOS, you may need to allow Chrome in System Preferences > Security & Privacy
Security Notes
This server launches a real browser with full system access
Only use with trusted websites and content
The browser runs with some security features disabled for automation
Always run in a controlled environment
License
MIT License - see LICENSE file for details.
Available Tools
11 toolsclick_elementC
Click on an element specified by CSS selector
Inputs: selector (required), waitFor.
generate_imageA
Generate images using Google Gemini 2.0 Flash Preview Image Generation (requires GOOGLE_AI_KEY environment variable)
Inputs: description (required).
get_page_infoA
Get information about the current page (title, URL, etc.)
Inputs: no named parameters.
go_backA
Navigate back in browser history
Inputs: no named parameters.
go_forwardA
Navigate forward in browser history
Inputs: no named parameters.
refresh_pageA
Refresh the current page
Inputs: no named parameters.
scroll_pageC
Scroll the page up or down
Inputs: direction (required), amount.
take_screenshotB
Take a screenshot of the current page
Inputs: fullPage, selector.
type_textA
Type text into an input field specified by CSS selector
Inputs: text (required), selector (required), clear.
wait_for_elementB
Wait for an element to appear on the page
Inputs: selector (required), timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 11 tools
Each tool has a distinct purpose: clicking, navigating, scrolling, typing, waiting, etc. No two tools overlap in functionality, even the optional image generation is separate. Agents can easily distinguish them.
All tools use snake_case with a consistent verb_noun pattern (e.g., click_element, navigate_to_url, take_screenshot). The naming is uniform and predictable, making it easy for agents to infer functionality.
11 tools is well-scoped for a browser automation server, covering essential actions without being excessive. Each tool serves a clear role in the workflow.
The tool set covers core browser automation tasks (navigation, clicking, typing, scrolling, screenshots, page info, waiting). Minor gaps include lack of text extraction from elements or page source retrieval, but these are not critical for common workflows.
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
A real browser for your agent: screenshots, page checks, Markdown and PDFs.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to iā¦
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables LLMs to perform web browsing tasks, take screenshots, and execute JavaScript using Puppeteer for browser automation.428,579 npm1MIT
- AlicenseAqualityDmaintenanceEnables browser automation with Puppeteer, supporting navigation, form interactions, and connection to active Chrome instances for comprehensive web page interaction.82,684 npm489MIT
- AlicenseBqualityDmaintenanceEnables AI agents to automate browser interactions including navigation, content extraction, form filling, screenshots, and JavaScript execution across multiple tabs using Puppeteer.2765 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to perform browser automation including web navigation, element interaction, and screenshot capture using Puppeteer. It provides capabilities for executing JavaScript in the browser and monitoring console logs for debugging and data extraction.28,579 npmMIT