Metadata-Version: 2.5
Name: priorrun-mcp
Version: 0.15.0
Summary: Prior.Run from your agent: rank your ads, Run pages and flows and get them back marked up, and work Guard's inbox — from Claude Desktop, Claude Code, Cursor, or any MCP-compatible agent.
Project-URL: Homepage, https://prior.run
Project-URL: Documentation, https://prior.run/docs/mcp
Project-URL: API Reference, https://prior.run/docs/api
Author-email: "Prior.Run" <hello@prior.run>
License: MIT
Keywords: ad-testing,checkout-testing,mcp,prior-run,store-monitoring,usability,ux-testing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp<2,>=1.2.0
Description-Content-Type: text/markdown

# priorrun-mcp

MCP server for [Prior.Run](https://prior.run) — rank your ads (Screen), Run your
pages and flows and get them back marked up (Launch), and work your store's inbox
(Guard): every problem pinned to the spot, with the fix. Works from Claude Desktop, Claude Code, Codex, Gemini CLI, Cursor,
Windsurf, Cline, Zed, or any MCP-compatible agent.

## Install

Requires Python 3.11+. [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/) if you don't have it.

```bash
uvx priorrun-mcp
```

That's it — `uvx` fetches and runs the server on demand.

## Configure

Grab an API key from [prior.run/settings](https://prior.run/settings), then register the server with your agent host.

### Claude Desktop

`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "prior-run": {
      "command": "uvx",
      "args": ["priorrun-mcp"],
      "env": {
        "PRIORRUN_API_KEY": "pr_live_xxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}
```

### Claude Code

`~/.claude/mcp.json` (global) or `.mcp.json` in a project root:

```json
{
  "mcpServers": {
    "prior-run": {
      "command": "uvx",
      "args": ["priorrun-mcp"],
      "env": { "PRIORRUN_API_KEY": "pr_live_..." }
    }
  }
}
```

### Codex (OpenAI)

`~/.codex/config.toml` — TOML, not JSON:

```toml
[mcp_servers.prior-run]
command = "uvx"
args = ["priorrun-mcp"]

[mcp_servers.prior-run.env]
PRIORRUN_API_KEY = "pr_live_..."
```

### Gemini CLI

`~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "prior-run": {
      "command": "uvx",
      "args": ["priorrun-mcp"],
      "env": { "PRIORRUN_API_KEY": "pr_live_..." }
    }
  }
}
```

### Cursor

`~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):

```json
{
  "mcpServers": {
    "prior-run": {
      "command": "uvx",
      "args": ["priorrun-mcp"],
      "env": { "PRIORRUN_API_KEY": "pr_live_..." }
    }
  }
}
```

### Windsurf / Cline / Zed / other MCP hosts

All modern MCP hosts share the same `mcpServers` JSON shape used by Claude Code.
Drop the same block into the host's MCP config file — check the host's docs for
the exact path.

## Tools

| Tool | What it does |
|---|---|
| `create_cold_read` / `get_cold_read` / `list_cold_reads` / `retry_cold_read` | **Screen** — your customers meet up to 10 ads (stills or video) or lines cold, and you get back which to run, fix or cut, with the change for each. About a minute. |
| `create_url_audit` / `get_url_audit` | **Launch** — Run a page or flow (or a design prototype) on desktop or mobile and get the Run Sheet back — queued, about 20–30 min |
| `list_guard_stores` / `get_guard_inbox` / `list_guard_paths` | **Guard** — your stores, the inbox as the board shows it (broken now first, the fix for each), every shopper path and its last check |
| `act_on_guard_findings` / `pause_guard_path` / `resume_guard_path` | work Findings (fixed / not a problem / snooze / mute / reopen), pause or resume a path |
| `create_mood` / `get_mood_job` / `list_mood_reports` / `get_mood` / `list_mood_cohorts` / `regenerate_mood` / `spawn_mood_audiences` | Mood of the Internet — what people say about a brand; its cohorts become saved audiences |
| `list_custom_audiences` / `rename_custom_audience` / `delete_custom_audience` / `list_audience_templates` | your saved audiences |
| `persona_audience_panel` | open an audience — gives the ids a Run needs |
| `persona_audience_ask` / `upload_room_image` / `persona_audience_synthesis` | ask an audience one question directly (+ actions, images/videos, @-targeting) |
| `dismiss_room_member` / `reset_room` / `create_room_thread` / `rename_room_thread` / `get_room_turns` / `interview_room_member` / `get_member_interview_history` | manage who you're asking, threads and 1:1s |
| `get_memo` / `persona_interview` / `persona_interview_history` / `upload_interview_image` | the memo archive — read-only, nothing writes new ones |

Creatives and images accept local file paths, `https://` URLs, or base64 — and
short mp4 / mov / webm videos (≤ 100 MB).

`create_cold_read` waits for the readout by default (about a minute). Cold Reads
and Guard are on Pro and above.

A Run starts from an audience, as in the web app: `list_custom_audiences` →
`persona_audience_panel` (gives the audience id + member indices a Run needs) →
`create_url_audit` → `get_url_audit`. `create_url_audit` queues the Run and, by
default (`wait=True`), polls until it lands. A Run takes about 20–30 minutes — pass
`wait=False` and poll `get_url_audit(walk_id)` yourself if your host has a short
tool timeout. If the account has no Runs left, the call fails with HTTP 402 and a
plain message.

On Pro and above, a page on one of the account's own sites is checked against its guidelines
(kept in the web app under Dashboard → Guidelines); a competitor's page is not.
Every set on the page's site applies. Pass `guidelines="off"` to skip them, or set ids
(comma-separated) to choose. With several sets, guidelines are numbered by set ("2.3"). The result's
`guidelines` says which guidelines held and which broke.

## Example prompts

**Rank your ads:**

```
Cold Read these four ads with my holiday shoppers — Reels, gift buyers, we're deciding which two get budget.
```

→ agent calls `create_cold_read` and returns which to run, fix or cut, why, and the line to try instead.

**Run a page** — on the screen you name:

```
Run brand.com/landing on a phone with my Gen Z skincare audience.
```

→ agent calls `create_url_audit` with `device="mobile"`, waits out the Run and
returns the Run Sheet: a summary, every finding pinned to the screen it was found
on, and one fix per finding in the order to do them.

**Work Guard's inbox:**

```
What's broken on brand.com right now? Mark the cart badge one as fixed.
```

→ agent calls `get_guard_inbox(store="brand.com")`, then `act_on_guard_findings`.

## Environment variables

| Variable | Required | Default | Notes |
|---|---|---|---|
| `PRIORRUN_API_KEY` | yes | — | `pr_live_...` format. Generate at [prior.run/settings](https://prior.run/settings). |
| `PRIORRUN_API_BASE` | no | `https://api.prior.run` | Override for staging or local dev. |

## Links

- Product: [prior.run](https://prior.run)
- API docs: [prior.run/docs/api](https://prior.run/docs/api)
- MCP docs: [prior.run/docs/mcp](https://prior.run/docs/mcp)
