Skip to content

Repository files navigation

Patchright Browser MCP Server

MCPLicense: MIT

Browser automation MCP server. Gives AI agents a real Chromium browser — navigate, click, type, screenshot, extract data.

Patchright Browser

Use Cases

  • Social media automation — Post, reply, DM on X/Twitter, Threads, Instagram
  • Web scraping — Extract data from any website
  • Form automation — Fill and submit forms automatically
  • Screenshot monitoring — Capture website state for tracking
  • Multi-account management — Isolated browser profiles for each account
  • Browser-based research — Browse and collect information

Dashboard

Password-protected web UI for managing browser profiles.

Dashboard

  • View all browser profiles with status
  • See online/offline status
  • Check active tabs per profile
  • Monitor uptime and last used time

Quick Start

Claude Code

claude mcp add patchright http://127.0.0.1:9877/mcp/ --transport http

Claude Desktop

Add to ~/.claude/claude_desktop_config.json:

{
"mcpServers": {
"patchright": {
"url": "http://127.0.0.1:9877/mcp/"
}
}
}

Cursor

Add to .cursor/mcp.json:

{
"mcpServers": {
"patchright": {
"type": "http",
"url": "http://127.0.0.1:9877/mcp/"
}
}
}

Hermes Agent

Add to ~/.hermes/config.yaml:

mcp_servers:
patchright:
url: http://127.0.0.1:9877/mcp/connect_timeout: 30enabled: true

Codex

Settings > MCP Servers > Add server > Streamable HTTP > http://127.0.0.1:9877/mcp/

Install Server

For AI Agents (auto-install)

Run this command:

git clone https://github.com/rickicode/patchright-browser.git ~/.patchright-browser/repo &&cd~/.patchright-browser/repo && bash install.sh &&~/.patchright-browser/start.sh

For Humans

git clone https://github.com/rickicode/patchright-browser.git
cd patchright-browser
bash install.sh
~/.patchright-browser/start.sh

Verify

curl http://127.0.0.1:9877/mcp/

Tools (27)

Browser Automation

ToolDescriptionExample
browser_navigateOpen URLurl="https://example.com"
browser_clickClick elementref="e5"
browser_typeType textref="e10", text="hello"
browser_snapshotGet page structure
browser_take_screenshotCapture image
browser_run_codeExecute Playwright JScode="async (page) => ..."
browser_tabsManage tabsaction="list|new|close|select"
browser_press_keyKeyboard inputkey="Enter"
browser_wait_forWait conditiontext="Loaded" or time=5
browser_file_uploadAttach filepaths=["/path/file.png"]
browser_consoleRead console
browser_evaluateRun JavaScriptexpression="document.title"
browser_hoverHover elementref="e5"
browser_dragDrag and dropstartRef, endRef

Profile Management

ToolDescription
profile_listList all browser profiles
profile_createCreate new profile
profile_openStart browser for profile
profile_closeStop browser
profile_updateChange settings
profile_deleteRemove profile
profile_set_defaultSet default profile
profile_inspectDeep state inspection

Proxy

ToolDescription
proxy_addAdd proxy config
proxy_listList proxies
proxy_deleteRemove proxy

Usage Examples

Extract data from a page

result=mcp_patchright_browser_run_code(code="""async (page) => { return await page.evaluate(() => { const items = document.querySelectorAll('.item'); return [...items].map(el => ({ title: el.querySelector('h3')?.textContent, url: el.querySelector('a')?.href, })); });}""")

Fill and submit a form

mcp_patchright_browser_type(ref="e5", text="John Doe")
mcp_patchright_browser_type(ref="e8", text="john@example.com")
mcp_patchright_browser_click(ref="e12") # submit button

Take screenshot

mcp_patchright_browser_take_screenshot()

Multi-tab workflow

mcp_patchright_browser_tabs(action="new")
mcp_patchright_browser_navigate(url="https://site2.com")
mcp_patchright_browser_tabs(action="select", index=0)

Profiles

Each profile = isolated browser with separate cookies, sessions, logins.

# Createmcp_patchright_profile_create(name="work", caps=["vision"])
# Usemcp_patchright_profile_open(name="work", mode="headed")
mcp_patchright_browser_navigate(url="https://example.com", profile="work")
# Cleanupmcp_patchright_profile_close(name="work")

Skills

Hermes Agent skills for social media automation:

cp -r skills/*~/.hermes/skills/
SkillWhat it does
x-searchSearch X/Twitter, extract posts + replies
threads-searchSearch Threads, extract posts + comments
instagram-automationInstagram DM, post, comment, story
threads-automationThreads post, reply, DM
x-automationX.com post, reply, DM

Uninstall

bash ~/.patchright-browser/uninstall.sh

License

MIT

About

MCP server for browser automation via Patchright. Multi-profile Chromium, headed/headless, StreamableHTTP protocol. Includes dashboard, skills, and AI agent setup.

Topics

Resources

Stars

20 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages