pagesnap-mcp
pagesnap-mcp
一个 MCP 服务器,用来包装现有的 PageSnap 会话包,让 LLM 能够列出会话、读取定位器,并把它们映射到 Playwright、Selenium 或 Cypress。
这不是一个采集工具。它不会打开浏览器、自动扫描 URL 或抓取浏览器。Playwright 不是依赖项。
采集发生在 pagesnap-playwright 或 pagesnap-selenium 中。请把这个服务器指向一个会话包的父文件夹(flow\.md 加上 yaml,以及可选的 PROMPT.md)。
如何运行
npm install
npm run build
node dist/index.js进程通过 stdio 与 MCP 通信,并等待 stdin。它在终端里看起来像卡住了;这是正常现象。用 Ctrl+C 停止。
可选环境变量:PAGESNAP\_SESSIONS\_DIR(默认 ./sessions)是 PageSnap 会话文件夹的父目录。
Related MCP server: Playwright MCP
Cursor MCP 配置
示例 .cursor/mcp.json。把 PAGESNAP\_SESSIONS\_DIR 指向一个 PageSnap 会话父目录,例如 playwright-ts-framework/snapshots:
{
"mcpServers": {
"pagesnap": {
"command": "node",
"args": [
"/absolute/path/to/pagesnap-mcp/dist/index.js"
],
"env": {
"PAGESNAP_SESSIONS_DIR": "/absolute/path/to/playwright-ts-framework/snapshots"
}
}
}
}这个服务器只读取磁盘上已有的包。它不是一个采集工具。
工具
省 token:list\_sessions 和 read\_session 先返回键和摘要。不会一次性输出 YAML 文件正文。
list\_sessions:无参数。从PAGESNAP\_SESSIONS\_DIR获取会话。read\_session:{ session }。flow\.md、yaml文件名、解析后的控件(上限 200)。map\_locator:{ by, value, name?, framework? }。片段、得分、稳定性。framework:playwright|selenium|cypress(默认playwright)。get\_prompt:{ session, framework? }。如果存在PROMPT.md就返回它;否则返回一个合成的 prompt。
定位
YAML by 值:testid、role、label、id、name、placeholder、linkText、css、xpath。
得分与 PageSnap 一致:testid 98、role 95、label/id 90、name 88、placeholder 85、linkText 75、css 60、xpath 40。
Playwright testid 总是映射到 page.getByTestId(...)。Sauce Demo 使用data-testid,同时使用 Playwright 的 testIdAttribute;仍然输出 getByTestId。通用且没有 role 的 data-testid 节点仍然映射到 getByTestId,绝不会映射到 getByRole('generic')。
测试
npx vitest run许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables browser automation and web interaction through structured accessibility snapshots using Playwright. Provides fast, deterministic web page interaction without requiring screenshots or vision models.5,618,931
- AlicenseNot gradedqualityDmaintenanceProvides browser automation capabilities for LLMs using Playwright, leveraging structured accessibility snapshots to interact with web pages without needing vision models. It enables tasks like web navigation, data extraction, and automated testing through a lightweight and deterministic toolset.16Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI agents to understand web page structure and content through structured data extraction and element discovery using Playwright, eliminating the need for screenshots.47MIT
- AlicenseAqualityBmaintenanceDrives a real Chromium browser to extract a page's DOM into compact Semantic JSON with Playwright-native locators, enabling AI agents to generate consistent, accurate Playwright tests.4273MIT
Related MCP Connectors
Screenshots, PDFs and Markdown from any URL or HTML for AI agents, via the SnapForge API
E2LLM gives your AI eyes and hands in a real browser: structured perception (SiFR) plus action.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fredoz0999/pagesnap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server