mcp-browser-automation
An MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.
README
mcp-browser-automation
An MCP (Model Context Protocol) server for generic browser automation using Playwright. Exposes a headless Chromium instance as a set of callable tools so that MCP clients — such as AI coding assistants — can navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic.
Requirements
- Node.js 18+
- npm
Installation
npm install
npx playwright install chromium
Usage
npm run build
npm start
Or for development with hot reload:
npm run dev
The server listens on stdin/stdout using the MCP stdio transport. Configure your MCP client to launch it as a subprocess.
Claude Desktop:
{
"mcpServers": {
"browser-automation": {
"command": "npx",
"args": ["github:ritesh-jain/MCP-Browser-Automation"]
}
}
}
Opencode:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-browser-automation": {
"type": "local",
"enabled": true,
"command": [
"npx",
"github:ritesh-jain/MCP-Browser-Automation"
]
}
}
}
Tools
| Tool | Description |
|---|---|
navigate |
Navigate to a URL. Supports custom viewport and mobile emulation. |
capture_screenshot |
Take a full-page screenshot (saved to screenshots/). |
get_console_logs |
Retrieve browser console logs. Optionally clear after read. |
get_network_traffic |
Retrieve network requests and responses. Optionally clear after read. |
execute_js |
Execute arbitrary JavaScript in the page context. |
interact |
Click, type, fill, or select on a CSS selector. |
inspect_element |
Return tag name, id, class, inner text, outer HTML, and computed styles for an element. |
Project Structure
src/
types.ts Shared type definitions
McpServer.ts MCP protocol layer — tool registration and dispatch
BrowserManager.ts Playwright orchestration — browser lifecycle and page interactions
index.ts Entry point
How It Works
index.tscreates anMcpBrowserServerand connects viaStdioServerTransport.- An MCP client discovers tools via the
ListToolsrequest and calls them viaCallToolRequest. McpBrowserServerlazily initializes the browser on the first tool call and delegates toBrowserManager.- The browser stays open across calls, enabling multi-step interactions on the same page.
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.