mcp-server

jatingodnani/mcp-server

3.2

If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server that provides browser automation capabilities for AI agents using Playwright.

Tools
5
Resources
0
Prompts
0

Web Automation MCP Server

A Model Context Protocol (MCP) server that provides browser automation capabilities for AI agents using Playwright.

Features

  • 15 automation tools for complete browser control
  • Headless browser operation for efficiency
  • Screenshot capture with element targeting
  • Form automation with input filling and selection
  • DOM extraction for text, HTML, and links
  • Custom JavaScript execution for advanced scenarios

Installation

# Install dependencies
npm install

# Install Playwright browser
npx playwright install chromium

# Build the project
npm run build

Usage

Start the server

npm start

Configure with Claude Code

Add to your MCP settings (~/.claude/settings.json or project .claude/settings.json):

{
  "mcpServers": {
    "web-automation": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-server/dist/index.js"]
    }
  }
}

Available Tools

Navigation

ToolDescriptionParameters
navigateGo to a URLurl (required)
go_backNavigate back in historynone
go_forwardNavigate forward in historynone

Data Extraction

ToolDescriptionParameters
extract_textGet text from page/elementselector (optional)
get_htmlGet HTML contentselector (optional), outer (boolean)
get_linksExtract all linksselector (optional)
get_page_infoGet URL, title, descriptionnone

Interaction

ToolDescriptionParameters
clickClick an elementselector (required)
typeType text into inputselector (required), text (required)
select_optionSelect dropdown optionselector (required), value (required)
hoverHover over elementselector (required)

Visual

ToolDescriptionParameters
screenshotCapture page/elementselector (optional), fullPage (boolean)

Utilities

ToolDescriptionParameters
wait_forWait for elementselector (required), timeout (ms)
scrollScroll the pagedirection or selector
evaluateRun custom JavaScriptscript (required)

Example Usage

Basic navigation and screenshot

User: "Go to https://news.ycombinator.com and take a screenshot"

AI will call:
1. navigate({ url: "https://news.ycombinator.com" })
2. screenshot({ fullPage: true })

Extract data

User: "Get all the links from the page"

AI will call:
1. get_links()

Form automation

User: "Search for 'AI news' on the page"

AI will call:
1. type({ selector: "input[type='search']", text: "AI news" })
2. click({ selector: "button[type='submit']" })

Custom JavaScript

User: "Get the number of images on the page"

AI will call:
1. evaluate({ script: "return document.images.length" })

Development

# Build
npm run build

# Run in development
npm run dev

Architecture

┌─────────────────────────────────────┐
│         MCP Client (Claude)         │
└──────────────┬──────────────────────┘
               │ JSON-RPC / stdio
┌──────────────▼──────────────────────┐
│     Web Automation MCP Server       │
│  ┌─────────────────────────────┐    │
│  │   15 Tool Definitions       │    │
│  └─────────────┬───────────────┘    │
│  ┌─────────────▼───────────────┐    │
│  │   Playwright Browser        │    │
│  │   (Chromium, headless)      │    │
│  └─────────────────────────────┘    │
└─────────────────────────────────────┘

Limitations

  • Some websites with bot protection (Cloudflare, CAPTCHA) may block automation
  • Always respect website Terms of Service
  • Check robots.txt before scraping
  • Use official APIs when available

License

MIT