Retio-ai/pagemap

๐Ÿ“‚ Browser Automation
0 Views
0 Installs

๐Ÿ ๐Ÿ  - Compresses 100K-token HTML into 2-5K-token structured maps while preserving every actionable element. AI agents can read and interact with any web page at 97% fewer tokens.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "retio-ai-pagemap": {
      "command": "npx",
      "args": [
        "-y",
        "retio-ai-pagemap"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

PageMap

PageMap converts raw HTML (100K+ tokens) into structured, AI-readable page maps (2-5K tokens) โ€” a 97% token reduction. It works as an MCP server, Python SDK, and CLI, supporting 16 page types and 30+ e-commerce sites. Agents can read, click, type, and navigate any web page.

"Give your agent eyes and hands on the web."

CI PyPI Python License: AGPL-3.0 Docker Awesome MCP Servers


Why PageMap?

Playwright MCP dumps 50-540KB accessibility snapshots per page, overflowing context windows after 2-3 navigations. Firecrawl and Jina convert HTML to markdown โ€” read-only, no interaction.

PageMap gives your agent a compressed, actionable view of any web page:

PageMapPlaywright MCPFirecrawlJina Reader
Tokens / page2-5K6-50K10-50K10-50K
Interactionclick / type / select / hoverRaw tree parsingRead-onlyRead-only
Multi-page sessionsUnlimitedBreaks at 2-3 pagesN/AN/A
Task success (94 tasks)84.7%61.5%64.5%57.8%
Avg tokens / task2,71013,73713,88811,424
Cost / 94 tasks$1.06$4.09$3.98$2.26

Benchmarked across 11 e-commerce sites, 94 static tasks, 7 conditions. 8,100+ tests passing.


Quick Start

Chromium is auto-installed on first use โ€” no manual playwright install needed.

Install

pip install retio-pagemap

MCP Client Config

Add to Claude Code, Cursor, Windsurf, or Claude Desktop:

{
  "mcpServers": {
    "pagemap": {
      "command": "uvx",
      "args": ["retio-pagemap"]
    }
  }
}

Claude Desktop (macOS): Use the absolute path to uvx โ€” run which uvx (e.g. /opt/homebrew/bin/uvx).

VS Code (Copilot): Use "servers" instead of "mcpServers" in .vscode/mcp.json.

Docker

docker run -p 8000:8000 retio1001/pagemap --transport http

Features

13 MCP Tools โ€” Read + Interact

Not just reading โ€” your agent can click buttons, fill forms, select options, manage tabs, and navigate across pages. 13 tools cover the full browsing workflow:

get_page_map ยท execute_action ยท fill_form ยท scroll_page ยท wait_for ยท take_screenshot ยท get_page_state ยท navigate_back ยท batch_get_page_map ยท open_tab ยท switch_tab ยท list_tabs ยท close_tab

16 Page Types, Auto-Detected

PageMap automatically classifies pages and applies optimized extraction for each type:

product_detail ยท listing ยท search_results ยท article ยท news ยท video ยท login ยท form ยท checkout ยท dashboard ยท help_faq ยท settings ยท error ยท documentation ยท landing ยท blocked

E-Commerce Deep Coverage

Built-in support for 30+ major e-commerce sites across 4 tiers:

  • Global mega-platforms โ€” Amazon, eBay, AliExpress, SHEIN, Walmart, Rakuten
  • Global fashion โ€” Zara, H&M, Nike, Uniqlo, ASOS, Zalando, SSENSE, Farfetch, COS
  • Korea โ€” Coupang, Naver Shopping, Musinsa, 29CM, W Concept, SSG, 11st
  • Japan/China โ€” ZOZO, Tmall, JD.com, Taobao

Structured extraction of prices, options (size/color), ratings, availability โ€” with automatic cookie consent handling and login barrier detection.

Smart Recovery

PageMap detects problems and tells your agent what to do:

  • Barrier detection โ€” Login required? Bot blocked? Out of stock? Age verification? Popup overlay? PageMap adds a barrier field with the diagnosis and suggested next steps
  • Cookie consent auto-dismiss โ€” 7 CMP providers auto-detected (Cookiebot, OneTrust, TrustArc, Didomi, Quantcast, Usercentrics, generic fallback). 5-tier dismiss cascade: CMP JS API โ†’ Reject โ†’ Accept โ†’ Dismiss โ†’ Close symbol. GDPR reject-first default policy
  • Popup overlay detection โ€” AX tree role="dialog" + HTML regex 2-phase detection. Promotional popups (newsletter, exit-intent) auto-dismissed
  • Bot detection awareness โ€” Detects Cloudflare, Turnstile, reCAPTCHA, hCaptcha, and Akamai. Reports the provider and suggests wait/retry strategies
  • Stale ref recovery โ€” When DOM changes invalidate refs, PageMap returns clear guidance to re-fetch

Content Intelligence

  • 8 JSON-LD schemas โ€” Product, NewsArticle, VideoObject, FAQPage, Event, LocalBusiness, BreadcrumbList, and ItemList
  • Metadata extraction โ€” Prices, ratings, reviews, descriptions, images from structured data and DOM fallbacks
  • 2-layer caching โ€” Cache hit (~10ms), content refresh (~500ms), full rebuild (~1.5s). Diff-based updates for unchanged sections
  • Delta evidence packet output - Optional to_delta_packet() serializer emits digest-bound evidence units, claim candidates, provenance, and authority flags for downstream memory/review systems without changing the default MCP output

10 Languages

Locale auto-detected from URL. Token budgets adjusted for CJK scripts.

LanguageLocaleLanguageLocale
EnglishenChinesezh
KoreankoSpanishes
JapanesejaItalianit
FrenchfrPortuguesept
GermandeDutchnl

Deployment

Local (STDIO)

Default mode. Runs as a local MCP server โ€” no server setup needed.

retio-pagemap

Docker

docker run -p 8000:8000 retio1001/pagemap --transport http

Multi-architecture images (amd64/arm64) available on Docker Hub and GitHub Container Registry.


Python API

import asyncio
from pagemap.browser_session import BrowserSession
from pagemap.delta_serializer import to_delta_packet
from pagemap.page_map_builder import build_page_map_live
from pagemap.serializer import to_agent_prompt, to_json

async def main():
    async with BrowserSession() as session:
        page_map = await build_page_map_live(session, "https://example.com/product/123")
        print(to_agent_prompt(page_map))   # Agent-optimized text format
        print(to_json(page_map))           # Structured JSON
        print(to_delta_packet(page_map))   # Digest-bound evidence packet
        print(page_map.page_type)          # "product_detail"
        print(page_map.interactables)      # [Interactable(ref=1, role="button", ...)]
        print(page_map.metadata)           # {"name": "...", "price": "..."}

asyncio.run(main())

For offline processing (no browser):

from pagemap.page_map_builder import build_page_map_offline

page_map = build_page_map_offline(open("page.html").read(), url="https://example.com/product/123")

Security

PageMap treats all web content as untrusted input:

  • SSRF defense โ€” Multi-layer protection against server-side request forgery
  • Prompt injection defense โ€” Content boundaries, role-prefix stripping, suspicious content flagging
  • robots.txt compliance โ€” RFC 9309 compliant. --ignore-robots opt-out flag
  • Resource guards โ€” DOM node limit, HTML size limit, response size limit
  • Session isolation โ€” Each session has independent cookies and storage, automatically cleaned up

Local development: Private IPs are blocked by default. Use --allow-local or PAGEMAP_ALLOW_LOCAL=1.

Disclaimer

Users are responsible for complying with the terms of service of target websites and all applicable laws when using PageMap.


Troubleshooting

"spawn uvx ENOENT" (Claude Desktop on macOS) โ€” Claude Desktop does not inherit your shell PATH. Run which uvx and use the absolute path in your config.

First page takes a long time โ€” Chromium cold start takes ~10-30s on first navigation. Subsequent pages load in 1-3 seconds.

Localhost blocked โ€” Use --allow-local flag or set PAGEMAP_ALLOW_LOCAL=1.

Chromium not found โ€” Run pip install retio-pagemap && playwright install chromium to install manually.


Requirements

  • Python 3.11+
  • Chromium (auto-installed on first use)

Community

Have a question or idea? Join the conversation in GitHub Discussions.

Development

Open in GitHub Codespaces

git clone https://github.com/Retio-ai/Retio-pagemap.git
cd Retio-pagemap
uv sync --group dev
playwright install chromium
uv run pytest --tb=short -q

Pricing

Local (STDIO) โ€” Free forever. Self-hosted, open source under AGPL-3.0.

Cloud API โ€” Hosted multi-tenant server with auth, rate limiting, and credit-based billing. Contact retio1001@retio.ai for access.

License

AGPL-3.0-only โ€” see LICENSE for the full text.

For commercial licensing options, contact retio1001@retio.ai.


For Agents

This section is written for AI agents using PageMap as an MCP tool.

Tools

ToolWhen to use
get_page_mapStart here. Navigate to a URL and get a full structured map with numbered refs.
execute_actionClick, type, select, or hover using a ref number from the last get_page_map.
fill_formFill multiple form fields in one call. More efficient than sequential execute_action calls.
get_page_stateCheck current URL and title without a full rebuild. Use after actions that may navigate.
scroll_pageScroll to reveal lazy-loaded content before calling get_page_map again.
wait_forWait for dynamic content to appear (e.g. after a search or form submit).
take_screenshotCapture the visual state when the PageMap alone is ambiguous.
navigate_backGo back one step in browser history.
open_tabOpen a new browser tab and navigate to a URL.
switch_tabSwitch to a different open tab by index.
list_tabsList all open tabs with their URLs and titles.
close_tabClose a tab by index.
batch_get_page_mapFetch multiple URLs in parallel. Use for comparison tasks.

Output Format

URL: https://example.com/product/123
Title: Product Name
Type: product_detail          # auto-detected page type

## Actions
[1] button: Add to cart (click)
[2] select: Size (select) โ€” options: S, M, L, XL
[3] link: See all reviews (click)
...

## Info
Price: $49.99
Rating: 4.5 / 5 (128 reviews)
Description: ...

## Images
  [1] https://cdn.example.com/product.jpg

## Meta
Tokens: ~1,800 | Interactables: 24 | Generation: 380ms
  • ## Actions โ€” Every interactive element on the page with a stable ref number.
  • ## Info โ€” Key page content extracted from HTML: prices, titles, ratings, descriptions.
  • ## Images โ€” Product/content image URLs.
  • ## Meta โ€” Token count, interactable count, generation time.

Barrier Detection

When PageMap encounters a page-level obstacle, it includes a barrier field in the response:

State:
  barrier: login_required
  barrier_hint: "Login form detected with email + password fields. Use fill_form to authenticate."

Possible barriers: cookie_consent, login_required, bot_blocked, out_of_stock, empty_results, error_page, age_verification, region_restricted, popup_overlay.

When you see a barrier: follow the barrier_hint guidance. For bot_blocked, wait and retry. For login_required, use fill_form with credentials.

Ref Lifecycle

Refs are assigned by get_page_map and remain valid until the page state changes.

Refs are invalidated when:

  • The page navigates to a new URL
  • A DOM mutation occurs (modal opens, SPA navigation, accordion toggles)
  • execute_action causes a page-level change

When you get a stale ref error: call get_page_map again to get fresh refs before retrying.

Token Budget Behavior

When a page exceeds the token budget, content is pruned in this order:

  1. Navigation menus, footers, sidebars removed first
  2. Secondary body content trimmed
  3. ## Actions and ## Info are always preserved

If key content seems missing, try scroll_page to load lazy content, then get_page_map again.

Recommended Workflow

1. get_page_map(url)          โ†’ read Actions + Info, pick refs
2. execute_action(ref, ...)   โ†’ interact
3. get_page_state()           โ†’ confirm navigation occurred
4. get_page_map(new_url)      โ†’ get fresh refs for next step

For pages with dynamic content (search results, filters):

1. get_page_map(url)
2. execute_action(ref, "click")    โ†’ trigger search/filter
3. wait_for(text="results")        โ†’ wait for content
4. get_page_map(url)               โ†’ get updated map

Known Limitations

  • Login-gated pages โ€” PageMap does not manage sessions or cookies. Authentication must be handled externally.
  • Heavy bot detection (Cloudflare, Akamai) โ€” May block automated access. PageMap detects the provider and suggests strategies, but cannot bypass active bot mitigation.
  • Private network access โ€” Blocked by default. Requires --allow-local flag.
  • iframes โ€” Cross-origin iframes are not accessible due to browser security policies.

PageMap โ€” Structured Web Intelligence for the Agent Era.

Related MCP Servers

34892002/bilibili-mcp-js

๐Ÿ“‡ ๐Ÿ  - A MCP server that supports searching for Bilibili content. Provides LangChain integration examples and test scripts.

๐Ÿ“‚ Browser Automation0 views
achiya-automation/safari-mcp

๐Ÿ“‡ ๐Ÿ  ๐ŸŽ - Native Safari browser automation for AI agents with 80+ tools. No Chrome dependency, optimized for Apple Silicon with 60% less CPU overhead.

๐Ÿ“‚ Browser Automation0 views
aethynio/aethyn-browser-mcp

๐Ÿ“‡ ๐Ÿ  - Drive a local Playwright browser through residential proxies with the agent choosing the exit country/city and holding one sticky identity per task. 10 tools: launch, navigate, accessibility snapshot, click, type, content extraction, exit-IP verification, and per-task identity rotation. Free trial, no card.

๐Ÿ“‚ Browser Automation0 views
agent-infra/mcp-server-browser

๐Ÿ“‡ ๐Ÿ  - Browser automation capabilities using Puppeteer, both support local and remote browser connection.

๐Ÿ“‚ Browser Automation0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.