Skip to content

@sightmap/mcp

@sightmap/mcp is an MCP server that wraps @playwright/mcp and adds sightmap-aware tools for browser-driving agents. It is the recommended way to let a host agent (Claude Code, Cursor, Subtext) curate a .sightmap/ directory: the agent gets a typed tool surface for both browser introspection and YAML mutation, with type safety and cascade tracking the bare filesystem can’t provide.

Terminal window
sightmap-mcp \
--sightmap-dir ./.sightmap \
--curate-root ./.sightmap \
-- npx -y @playwright/mcp@latest

Wire it into your host agent’s MCP config the same way you’d wire any other server. For Claude Code, that’s ~/.claude/mcp.json or the project-local equivalent.

FlagPurpose
--sightmap-dir <path>Directory of sightmap YAML files. Repeatable. Default: .sightmap.
--curate-root <path>Writable .sightmap/ for curation tools. Default: the first --sightmap-dir.
--upstream-command <cmd>Command to spawn the upstream MCP server. Default: npx.
-- <args...>Args for the upstream command. Default: -y @playwright/mcp@latest.

These require an upstream Playwright MCP. The server proxies the upstream’s primitives and adds sightmap awareness:

ToolPurpose
sightmap_matchPure query: matches a URL against the loaded sightmap and returns view, components, requests, and aggregated memory.
sightmap_snapshotARIA snapshot enriched with sightmap awareness — matched view, applicable components with live matchCount.
sightmap_actClick / type / hover by sightmap component name; raw selector is an escape hatch.
sightmap_network_requestsRecent network requests, annotated with sightmap names where the request URL+method matches a sightmap requests: entry.

The upshot: an agent can drive a browser in terms of component names, not selectors. sightmap_act { component: "LoginButton", action: "click" } resolves the selector at call time, so renames in the YAML take effect immediately without prompt edits.

A five-tool family for .sightmap/ authoring:

ToolPurpose
sightmap_list_viewsList all views (compact summary by default; pass detail: "full" for the entire view).
sightmap_get_viewFetch a single view + its source file path.
sightmap_checkValidate the sightmap (level: "schema" or "quality"; default "quality").
sightmap_update_viewPatch a view’s agent-authored fields (description, intent, memory_append, memory_replace).
sightmap_init_projectScaffold an empty .sightmap/ in a target project.

Curation writes operate on the directory passed via --curate-root (defaults to the first --sightmap-dir).

The server exposes prompt templates for multi-step authoring workflows.

Walks an author through writing a Sightmap Enhancement Proposal — the SEP markdown, the matching spec/ change, and the matching conformance/ fixture — in four phases:

PhaseProducesConfirmation gate?
draftseps/NNNN-{slug}.md from the templateYes
specA diff against spec/ referencing the SEPYes
fixtureconformance/<NNN>-{slug}/ with sightmap/ input + expected.jsonYes
verifyHand-off summaryNo (terminal)

Confirmation gates are encoded as text directives at the end of each non-final phase (“Stop here. Show the draft to the user, ask for explicit ‘go’ before calling this prompt again with phase: \"spec\".”). The agent honors them; MCP itself has no native pause-and-await primitive for prompts.

This exists because SEPs require coordinated edits across three trees (seps/, spec/, conformance/). The track encodes the order, the dependencies, and the user check-in points so neither author nor agent can short-circuit them.

The MCP server is the underlying tool surface. The Claude Code plugin layers advisory hooks on top — nudging the agent toward sightmap_update_view instead of raw Write/Edit, and validating any direct edit that slips through. Run both together for the smoothest experience; either one alone works, with predictable trade-offs.