pagesnap-mcp
pagesnap-mcp
既存のPageSnapセッションパックをラップするMCPサーバーです。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: Browser MCP Server
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"
}
}
}
}このサーバーは、すでにディスク上にあるセッションパックのみを読み取ります。キャプチャツールではありません。
ツール
トークン効率を重視した設計です。list_sessionsとread_sessionはまずキーと要約だけを返します。YAMLファイルの中身をダンプすることはありません。
list_sessions: 引数なし。PAGESNAP_SESSIONS_DIR内のセッションを一覧表示します。
read_session: { session }。ファイルcontent (flow.md) 、yamlファイル名、解析済みコントロール(最大200件)を返します。
map_locator: { by, value, name?, framework? }。スニペット、スコア、安定性を返します。framework: playwright|selenium|cypress(既定値: playwright)。
get_prompt: { session, framework? }。PROMPT.mdがあればそれを返し、なければ合成されたプロンプトを返します。
ロケーター
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万分の秒は、Playwright の testIdAttribute で data-test を使うため、まだ getByTestId を出力してます。role を持たない汎用の data-testid ノードでも getByTestId にマップされ、getByRole('generic') にマップされることはありません。
テスト
npx vitest runライセンス
MIT
Available Tools
4 toolsget_promptA
Return PROMPT.md for a session if present; otherwise synthesize a test-generation prompt from flow.md and ranked locators.
Inputs: session (required), framework.
list_sessionsA
List PageSnap session packs under PAGESNAP_SESSIONS_DIR (default ./sessions). Returns a summary only: name, path, mtime, goal, stepCount. Does not capture or open a browser.
Inputs: no named parameters.
map_locatorA
Map a PageSnap YAML locator {by, value} to a Playwright, Selenium, or Cypress snippet with score and stability. Sauce Demo data-test ids still emit getByTestId (configure testIdAttribute in Playwright). Never maps testid to getByRole('generic').
Inputs: by (required), value (required), name, framework.
read_sessionA
Read one PageSnap session: flow.md, YAML file names, and parsed controls (cap 200). Token-efficient: keys/summary first; does not dump YAML file bodies.
Inputs: session (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a clearly distinct concern: listing sessions, reading session details, translating locators, and generating prompts. There is no overlap that would cause an agent to select the wrong tool.
All tool names follow a consistent verb_noun snake_case pattern: list_sessions, read_session, map_locator, get_prompt. This makes the tool set predictable and easy to navigate.
Four tools is a tight, focused scope. Each tool earns its place and supports a distinct step in the PageSnap session inspection workflow without redundancy.
The read-and-analyze workflow is well covered: list, read, map, and prompt. A minor gap is the lack of session creation or mutation tools, but the descriptions frame this as a read-only inspection tool, so the gaps are acceptable.
Maintenance
Related MCP Connectors
Give agents eyes on any web page: structured context, and changes explained in plain language.
Undetectable cloud browser sessions for AI agents and scrapers. Navigate, extract, click, captcha.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Captured web interfaces, screenshots, flows and structured evidence for AI coding agents.
Related MCP Servers
- 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.8 npmApache 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.46 npmMIT
- 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.1335 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with web pages through structured accessibility snapshots using Playwright, providing fast and lightweight browser automation without needing vision models.Apache 2.0