MCP Tools
Cartographer registers 17 cartographer_* MCP tools on its own FastAPI MCP server (/mcp). IDE agents can create projects, crawl sites, run flows, export Playwright tests, and list traces — without leaving your editor.
This is not the unified cross-product molar_* tool surface (scenario compiler, Guard runs, Clones fleet). Those live on the Platform MCP server in combined-bundle deployments.
Hosted endpoint: https://mcp.molar.cloud · Local: http://localhost:8000/mcp · Dashboard: Integrations → MCP at /dashboard/integrations
Transports and authentication
| Transport | How to connect | Auth |
|---|---|---|
| HTTP (streamable) | https://mcp.molar.cloud (cloud) or http://localhost:8000/mcp (local) | OAuth 2.0 via api.molar.it (cloud) |
| stdio | cartog mcp | Personal access token (PAT) from Settings → API tokens |
OAuth (cloud — recommended)
- Open Integrations → MCP in the dashboard.
- Choose your IDE and copy the HTTP config snippet.
- Click Authorize — consent screen scopes access to your org's Cartographer projects.
- Test with
cartographer_list_projects.
Note:
The MCP server authenticates you with its own tokens. It never forwards your OAuth token to upstream LLM providers (confused-deputy protection). LLM calls use Molar-hosted routing or org-configured keys on the server side.
Stdio (local / CI)
# Configure CLI
cartog config set api_url https://api.cartographer.molar.it # or http://localhost:8000
cartog config set token <your-pat>
cartog whoami
# IDE spawns:
cartog mcp
Example Cursor / Claude Desktop config:
{
"mcpServers": {
"cartographer": {
"command": "cartog",
"args": ["mcp"],
"env": {
"CARTOGRAPHER_API_URL": "https://api.cartographer.molar.it",
"CARTOGRAPHER_API_KEY": "<pat>"
}
}
}
}
MCP tasks and progress events
Long-running tools (cartographer_run_test, cartographer_crawl_site, cartographer_export_test, cartographer_replay_demo with demo_id) report progress via MCP notifications when tasks are enabled:
| Field | Meaning |
|---|---|
progress / total | Numeric progress (e.g. step 3 of 10) |
message | Human-readable status |
mcp_task_id | Task id for cartographer_get_task polling |
Task state is persisted to Redis when MCP_EVENTSTORE_REDIS_URL is set (in-process fallback otherwise).
Synchronous mode (tasks disabled): response includes "execution_mode": "synchronous" without mcp_task_id.
Cancel a running agent job: cartographer_cancel.
Tool reference (all 17)
Project management
cartographer_create_project
Create a project for subsequent crawl/run/export calls.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | — | Display name |
base_urls | string[] | no | [] | Seed / base URLs |
scope_allowlist | string[] | no | [] | Allowed URL prefixes |
default_grounding_tier | int | no | 0 | Default tier 0–2 |
Returns: Created project record (id, name, urls).
cartographer_list_projects
List all projects visible to the authenticated user.
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) |
Returns: { "items": [...], "total": N }
Discovery (crawl)
cartographer_crawl_site
Deep-crawl a site and build a route map. Long-running — streams progress.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
seed_url | string | yes | — | Starting URL |
project_id | string | no | — | Associate route map with project |
max_pages | int | no | 200 | Page cap |
depth | int | no | 4 | BFS depth |
anti_bot | bool | no | false | Use stealth browser |
Returns: route_map_id, status, page_count, pages[], mcp_task_id
cartographer_explore
Alias for cartographer_crawl_site — identical parameters and behavior.
cartographer_list_flows
List discovered flows and route-map pages for a project.
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | Project UUID |
Returns: { "flows": [...], "total": N, "project_id": "..." }
Execution (agent runs)
cartographer_run_test
Run an autonomous flow against a base URL. Long-running — polls until terminal status.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
flow | string | yes | — | Natural-language goal |
base_url | string | yes | — | Target origin |
env | string | no | "staging" | Environment label |
credentials_alias | string | no | — | Named credential for login |
max_steps | int | no | 30 | Step budget |
record_demo | bool | no | false | Save replayable demo |
grounding_tier | int | no | 0 | Starting tier 0–2 |
project_id | string | no | — | Associate run with project |
Returns: run_id, status, step_count, stream_url, artifacts[], mcp_task_id
Progress messages: "step N/max — running", terminal status.
cartographer_get_run
Get run status and summary.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | yes | From cartographer_run_test |
Returns: Full run record — status, step count, tier breakdown, artifact URIs, history.
cartographer_list_runs
List agent runs, optionally filtered by project.
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | no | Filter to one project |
Returns: { "runs": [...], "total": N }
cartographer_cancel
Cancel a queued or running agent run.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | yes | Run to cancel |
mcp_task_id | string | no | Associated MCP task to mark cancelled |
Returns: Cancellation result with cancelled flag.
Export
cartographer_export_test
Export a completed run to Playwright specs. Long-running — reports pipeline stages.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | yes | Completed run id |
Returns: export_id, status, files, warnings, testid_coverage_pct, archive_uri, pr_url, mcp_task_id
Progress stages: pruning → ranking → clustering → harvesting → generating → linting → verifying.
cartographer_export_spec
Export with explicit options (queues export, returns immediately with export id).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
run_id | string | yes | — | Completed run |
style | string | no | "playwright" | Export style |
target_repo | string | no | — | GitHub repo for PR |
uses_cloakbrowser_in_ci | bool | no | false | Stealth browser in CI |
Returns: Export job record from API.
Artifacts and demos
cartographer_get_artifact
Download run artifact metadata and presigned URLs.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | yes | Run id |
kind | string | yes | screenshots, a11y, console, network, all, etc. |
Returns: { "artifacts": { ... } } with signed URLs.
cartographer_replay_demo
Replay a recorded demo as a new agent run, or fetch replay artifacts for an existing run.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
demo_id | string | no* | — | Demo to replay (*long-running) |
project_id | string | no | — | Project scope for replay endpoint |
variables | object | no | {} | Template variables (secrets redacted in logs) |
max_steps | int | no | 30 | Step budget |
run_id | string | no* | — | Fetch artifacts for existing run (*alternative mode) |
Returns (replay): run_id, demo_id, status, stream_url, artifacts, mcp_task_id
Returns (run_id mode): Run status + artifact map without starting new replay.
Traces
cartographer_list_traces
List captured traces for your organization (most recent first).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
scenario_id | string | no | — | Filter by scenario |
status | string | no | — | e.g. failed, passed |
signature | string | no | — | Failure signature |
tier | string | no | — | Retention: hot, warm, cold |
cursor | string | no | — | Pagination cursor |
limit | int | no | 50 | Page size 1–200 |
Returns: { "items": [...], "next_cursor": "..." }
cartographer_get_trace
Get trace metadata and signed artifact URLs.
| Parameter | Type | Required | Description |
|---|---|---|---|
trace_id | string | yes | From cartographer_list_traces |
Returns: Status, retention tier, pinned flag, failure signature, artifact URLs.
Findings
cartographer_get_findings
Passive UX findings (axe, odiff, VLM) for a project.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
project_id | string | yes | — | Project UUID |
severity | string | no | — | critical, serious, moderate, minor, info |
source | string | no | — | axe, odiff, vlm |
limit | int | no | 50 | Max findings |
Returns: { "findings": [...], "total": N }
Task management
cartographer_get_task
Retrieve persisted MCP task state for reconnect/resume.
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | mcp_task_id from long-running tool |
Returns: Task status, progress, input_json, result_json, or not_found.
Tool summary table
| # | Tool | Long-running | Primary use |
|---|---|---|---|
| 1 | cartographer_create_project | Bootstrap project | |
| 2 | cartographer_list_projects | Discover project ids | |
| 3 | cartographer_crawl_site | yes | Route map discovery |
| 4 | cartographer_explore | yes | Alias for crawl |
| 5 | cartographer_list_flows | Flows after crawl | |
| 6 | cartographer_run_test | yes | Execute goal |
| 7 | cartographer_get_run | Poll run status | |
| 8 | cartographer_list_runs | Audit runs | |
| 9 | cartographer_cancel | Stop run | |
| 10 | cartographer_export_test | yes | Playwright zip |
| 11 | cartographer_export_spec | Export with options | |
| 12 | cartographer_get_artifact | Screenshots, HAR, etc. | |
| 13 | cartographer_replay_demo | yes* | Demo replay |
| 14 | cartographer_list_traces | Trace inventory | |
| 15 | cartographer_get_trace | Trace detail | |
| 16 | cartographer_get_findings | UX/accessibility issues | |
| 17 | cartographer_get_task | Reconnect progress |
* Long-running when demo_id is provided.
Note:
The same MCP server also registers eight Trace Debugger tools (read_artifact, query_trace, diff_runs, run_layer2_replay, …) for AI-assisted trace analysis. They are separate from the 17 cartographer_* tools above.
Example workflows
Workflow 1 — Greenfield project from IDE
1. cartographer_create_project
name: "Acme Staging"
base_urls: ["https://staging.acme.com"]
2. cartographer_crawl_site
seed_url: "https://staging.acme.com"
project_id: <id from step 1>
max_pages: 100
3. cartographer_list_flows
project_id: <id>
4. cartographer_run_test
flow: "Add item to cart and open checkout"
base_url: "https://staging.acme.com"
project_id: <id>
credentials_alias: "staging-user"
5. cartographer_export_test
run_id: <id from step 4>
Open stream_url in the dashboard to watch live: app.molar.it/dashboard/cartographer.
Workflow 2 — Quick run without project
cartographer_run_test
flow: "Load homepage and confirm primary nav is visible"
base_url: "https://example.com"
max_steps: 15
cartographer_get_run
run_id: <returned id>
cartographer_export_test
run_id: <same id>
Workflow 3 — Investigate failure
cartographer_list_runs
project_id: <id>
cartographer_get_run
run_id: <failed run>
cartographer_get_artifact
run_id: <id>
kind: "screenshots"
cartographer_list_traces
status: "failed"
limit: 10
cartographer_get_trace
trace_id: <id>
cartographer_get_findings
project_id: <id>
severity: "critical"
Paste trace share URL from dashboard for teammates.
Workflow 4 — Demo replay after extension recording
cartographer_replay_demo
demo_id: <from dashboard demos library>
project_id: <id>
variables: { "product_sku": "SKU-123" }
cartographer_get_run
run_id: <replay run_id>
Workflow 5 — Cancel runaway job
cartographer_list_runs
project_id: <id>
cartographer_cancel
run_id: <running id>
mcp_task_id: <optional from run_test response>
Quotas and rate limits
The dashboard Integrations → MCP page shows:
| Metric | Description |
|---|---|
| MCP calls remaining | Org quota for hosted MCP |
| Rate limit reset | Window reset time |
| Active sessions | OAuth sessions — revoke compromised tokens |
Hosted multi-tenant deployments enforce per-tenant rate limits. Self-hosted operators configure API_RATE_LIMIT_TENANT_* — see Configuration.
CLI (cartog)
The Go CLI talks to the same REST API. Shipped subcommands:
| Command | Purpose |
|---|---|
cartog mcp | Stdio MCP transport (spawns Python FastMCP) |
cartog ci | One-shot run + export via HTTP API |
cartog run / cartog crawl / cartog export | Individual API operations |
cartog projects / cartog runs / cartog cancel | Project and run management |
cartog whoami | Validate PAT |
cartog config | Set api_url and token |
cartog grounding install|serve|status | Local Tier 2 MLX server lifecycle |
There is no separate cartog subcommand for every MCP tool — use MCP or REST for project creation and trace listing.
Related
| Page | Topic |
|---|---|
| Quick start — Option C | First MCP setup |
| Dashboard — MCP integration | Install wizard UI |
| Core concepts | Crawls, runs, export |
| Platform MCP | Unified Molar MCP in combined bundle |
| Troubleshooting | OAuth and connection errors |