mcp-web-agent
This server provides token-efficient web browsing, scraping, and crawling tools for AI agents. It fetches content as clean markdown or JSON via CSS selectors, and only launches a real browser when JavaScript rendering is required.
Tools:
web_scrape: Fetch a URL and return clean markdown or structured JSON using CSS selectors; optionally force browser rendering withforceBrowser.web_check: Verify text or CSS selector presence/absence, or exact text match; returns pass/fail plus a short evidence snippet.web_diff: Monitor a page or subtree for changes; returnschanged: true/falseplus a snippet, useful for cheap polling.web_interact: Execute browser actions (click, fill, select, press, waitFor) and return an accessibility snapshot or optional screenshot; supports persistent sessions viasessionId.web_session_close: Delete persisted session data (cookies, storage) for a session.web_crawl: BFS-crawl from a seed URL with configurable depth/page limits, path include/exclude patterns, and same-host option; returns titles, links, and excerpts while caching full markdown.web_crawl_get_page: Retrieve full cached markdown for a page visited during a crawl.
Other features:
Economical operation via tiered fetching, markdown output, schema extraction, and boolean verification.
SSRF protection blocks requests to private/reserved IP ranges.
Respects robots.txt and per-host rate limiting by default, overridable per call.
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., "@mcp-web-agent Scrape https://example.com and return the main article as markdown."
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.
webmesh-mcp
A token-economical web browsing, scraping, and crawling suite delivered as a standard MCP server. Any MCP-capable agent (Claude, Cursor, Cline, etc.) can use it as ordinary tools with no bespoke integration.
Why this is cheaper than a full browser loop
Strategy | Saving |
Tiered fetching — static HTTP first, browser only when HTML is thin | Skips Chromium entirely for the majority of pages |
Markdown output, not raw HTML — noise/nav/ads stripped server-side | 300 KB page → ~8 KB of clean markdown |
Schema extraction — field → CSS selector returns only the values you asked for | No markdown conversion, no LLM reasoning |
Boolean verification — |
|
ARIA snapshot over screenshot — | Image tokens only when you explicitly ask |
Persistent browser pool — one Chromium process per server lifetime | ~1-2 s launch cost paid once, not per call |
robots.txt + rate limiting — per-host queues and rule caching | Polite crawling without throttling your agent |
Related MCP server: krwl3r
Tools
Tool | What it does | Browser needed? |
| Fetch a URL → clean markdown or schema-based JSON | Only if JS-rendered |
| Assert text/element present or absent → | Only if JS-rendered |
| Has this page changed since last check? → | Only if JS-rendered |
| Click / fill / select / press / waitFor sequence → ARIA snapshot | Always |
| Delete persisted cookies for a | No |
| BFS crawl from a seed URL → titles, links, excerpts, cached markdown | Only if JS-rendered |
| Retrieve full markdown cached by a prior | No |
Installation
npm install -g webmesh-mcp
# or use directly with npx (no global install needed):
npx webmesh-mcpChromium (optional — only needed for JS-rendered pages)
webmesh-mcp uses playwright-core
and does not bundle a browser. You have three options:
A) Install Playwright's managed Chromium (simplest):
npx playwright install chromiumB) Use your system Chrome / Edge — set executablePath in your MCP config (see below).
C) Connect to a running browser — Playwright supports CDP attach; pass --cdp-endpoint
flags in args if you want to hook into an already-running instance.
Static pages (most blogs, docs, GitHub, npm, etc.) never trigger the browser path at all.
Connecting to your agent
Add to your MCP config (e.g. ~/.claude/claude_desktop_config.json, .cursor/mcp.json, etc.):
{
"mcpServers": {
"web-agent": {
"command": "npx",
"args": ["webmesh-mcp"]
}
}
}Or, if you prefer to run from source:
{
"mcpServers": {
"web-agent": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/webmesh-mcp/src/index.ts"]
}
}
}Agent Skill Integration
This repository ships with a pre-configured Agent Skill in skills/web-agent/SKILL.md.
It provides AI coding assistants (Claude Code, Antigravity, Cursor, Windsurf, Gemini CLI, etc.) with a complete decision tree, trigger keywords, and parameter guidance for using webmesh-mcp tools token-efficiently.
How to use the skill in your project
Copy or symlink the skills/ folder into your AI assistant's skills directory:
Claude / Antigravity / Gemini CLI: Place in
.agents/skills/web-agent/SKILL.mdor~/.gemini/config/skills/web-agent/SKILL.mdCursor: Copy contents to
.cursor/rules/web-agent.mdcWindsurf: Copy contents to
.windsurfrules
Tool reference
web_scrape
Parameter | Type | Default | Description |
|
| — | Page to fetch |
|
|
| Output format |
|
| — |
|
|
| — | Scope extraction to a CSS subtree |
|
|
| Skip static tier, always use Chromium |
|
|
| Bypass |
web_check
Parameter | Type | Default | Description |
|
| — | Page to check |
| enum | — |
|
|
| — | Text or CSS selector |
|
| — | Scope text search to subtree |
|
|
| |
|
|
|
web_diff
Parameter | Type | Default | Description |
|
| — | Page to monitor |
|
| — | Scope watch to subtree (e.g. |
|
|
| |
|
|
|
Returns changed: null on the first call (nothing to compare against),
true/false on subsequent calls.
web_interact
Parameter | Type | Default | Description |
|
| — | Starting URL |
|
| — | Sequence of browser actions |
|
| — | Scope returned ARIA snapshot |
|
|
| Return base64 PNG (costs image tokens) |
|
| — | Persist cookies/storage across calls |
|
|
|
Action shape:
{ type: "click" | "fill" | "select" | "press" | "waitFor", selector?: string, value?: string, timeoutMs?: number }web_session_close
Parameter | Type | Description |
|
| Session to delete |
web_crawl
Parameter | Type | Default | Description |
|
| — | Seed URL |
|
|
| Max link depth (0 = seed only) |
|
|
| Hard cap on pages visited |
|
|
| Restrict to same hostname |
|
| — | Pathname globs URLs must match, e.g. |
|
| — | Pathname globs URLs must NOT match |
|
|
| Output verbosity |
|
|
|
Full markdown for every visited page is cached in SQLite for web_crawl_get_page.
web_crawl_get_page
Parameter | Type | Description |
|
| Previously crawled URL |
Environment variables
Variable | Default | Description |
|
| Root directory for cache DB and session files |
Both the SQLite watch/crawl cache (cache/watch.sqlite) and session state files
(sessions/) live under MCP_WEB_AGENT_DATA_DIR. Override it to control where
runtime data is stored.
Security
SSRF Protection
All outbound fetches — static HTTP, browser navigation, intermediate HTTP redirects, and crawl link-following — are strictly validated against an SSRF blocklist before network connections are established.
Protocol Restriction: Rejects all non-HTTP/HTTPS schemes.
Loopback Addresses:
127.x.x.x, IPv6::1,localhost, IPv6 unspecified::/0:0:0:0:0:0:0:0.Private RFC-1918 & Unique Local IPv6:
10.x,172.16–31.x,192.168.x,fc00::/7,fd00::/7.Link-Local & Cloud Metadata:
169.254.x.x(AWS/GCP/Azure IMDS),fe80::/10.Special & Reserved Ranges: Multicast (
224.x), Site-Local (fec0::/10), Documentation (2001:db8::/32), and IPv4-mapped IPv6 formats (::ffff:x.x.x.x).HTTP Redirect Hardening: Static fetch enforces manual redirect validation loops up to 5 hops, checking
ssrfGuard.assertPublicUrl()on every intermediateLocationheader before following.Browser Route Interception: Chromium contexts attach route interceptors (
page.route("**/*")) to block subresource requests or redirects targeting private IP space.
Architecture
For a detailed technical architecture and end-to-end data flow specification, see Architecture.md.
index.ts (MCP server, stdio transport)
├── tools/scrape.ts — web_scrape
├── tools/check.ts — web_check
├── tools/diff.ts — web_diff
├── tools/interact.ts — web_interact
├── tools/crawl.ts — web_crawl
├── tools/crawlGetPage.ts — web_crawl_get_page
├── tieredFetch.ts — static HTTP → browser escalation (manual redirect validation)
├── browserPool.ts — singleton Chromium process + route interceptor (playwright-core)
├── ssrfGuard.ts — SSRF protection (blocks private/reserved IPv4 & IPv6 addresses)
├── extract.ts — HTML → clean markdown / plain text / schema JSON
├── hostGate.ts — robots.txt parser (regex escaped) + per-host rate-limiting queue
├── sessions.ts — disk-backed storageState persistence
├── cache.ts — SQLite: watch hashes + crawled page markdown
└── constants.ts — shared USER_AGENT, DATA_DIRDevelopment
git clone https://github.com/creatorpiyush/webmesh-mcp
cd webmesh-mcp
npm install
npx playwright install chromium # optional, for browser-tier testing
npm run dev # run MCP server in dev mode (tsx, no compile step)
npm run demo -- https://example.com
npm test # run the full integration test suite
npm run typecheck # tsc --noEmit, no output files
npm run format # format code with prettier
npm run build # compile to dist/License
MIT — see LICENSE.
Available Tools
7 toolsweb_checkCheck a claim about a webpageA
Verify something about a page (text present/absent, element present/absent, exact text match) without returning the whole page — just a pass/fail and a short evidence snippet.
Inputs: url (required), value (required), assertion (required), selector, +2 more.
web_crawlCrawl a website starting from a seed URLA
Perform a BFS crawl starting at startUrl up to maxDepth/maxPages. Returns page titles, link structures, and excerpts, while caching full markdown for web_crawl_get_page.
Inputs: startUrl (required), maxDepth, maxPages, contentDepth, +4 more.
web_crawl_get_pageRetrieve full markdown for a previously crawled pageB
Fetch cached page content discovered during a web_crawl call.
Inputs: url (required).
web_diffMonitor a webpage for changesB
Check whether a page (or a subtree of it) has changed since the last check. Returns changed=true/false and a short snippet — not the full content — so repeated monitoring stays cheap.
Inputs: url (required), selector, forceBrowser, ignoreRobots.
web_interactInteract with a webpageA
Run a sequence of actions (click, fill, select, press, waitFor) on a live page — for testing flows or reaching content behind interaction. Returns a text accessibility snapshot by default; pass screenshot=true only when you actually need to see pixels.
Inputs: url (required), actions (required), sessionId, screenshot, +2 more.
web_scrapeScrape a webpageA
Fetch a URL and return clean content — markdown by default, or specific fields via a CSS-selector schema. Tries a plain HTTP fetch first and only launches a browser if the page needs JS to render.
Inputs: url (required), format, schema, selector, +2 more.
web_session_closeClose and delete a web interaction sessionA
Delete persisted cookies and storageState for a given sessionId.
Inputs: sessionId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have distinct purposes: scraping, crawling, interaction, checking, diffing, and session management are clearly separate. However, web_scrape and web_crawl_get_page both return page content (one on-demand, one cached), and web_check vs web_diff both verify page state, creating slight overlap.
All tools share a 'web_' prefix, but the structure varies: mostly verb (web_scrape, web_check, web_interact, web_crawl), but web_session_close is noun-verb and web_crawl_get_page is verb-noun-noun. The pattern is readable but not entirely consistent.
Seven tools is well within the ideal range for a web agent server. Each tool serves a distinct function without redundancy, and the count feels appropriate for the domain of scraping, crawling, interaction, and monitoring.
The set covers core web operations: fetch, crawl, interact, check, diff, and session cleanup. Minor gaps include no explicit session creation tool (though implied by web_interact) and no dedicated screenshot tool (though web_interact supports screenshots). These are workable gaps, not critical failures.
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
A real browser for your agent: screenshots, page checks, Markdown and PDFs.
Turn any public website into an MCP server for agents to search, read and navigate.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that fetches web pages and extracts clean, AI-friendly Markdown content using Mozilla Readability. It provides secure web access for LLMs with built-in SSRF protection and automated content cleaning for improved context retrieval and summarization.198 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for web scraping and browser automation, enabling AI agents to extract clean, token-efficient content from web pages.1MIT
- AlicenseNot gradedqualityDmaintenanceA secure web scraping MCP server for AI agents that fetches pages with token budgeting, robots.txt compliance, and injection warnings, providing parsed content like markdown, metadata, and structured data.1MIT
- AlicenseAqualityCmaintenanceMCP server for mdbrowse that enables agents to fetch, search, and browse web pages as clean, token-efficient markdown with provenance, caching, and structured navigation.16MIT