IDE & MCP
Tripwire ships an MCP server, so it shows up as a tool inside Cursor and Claude Code (and any MCP-capable editor like VS Code). Your editor's agent can drive a real headless browser to test any page in plain English, run saved suites, and check expectations — without leaving the chat. "Test this URL" becomes a one-liner.
This is the install button for testing right where you work: you build in your IDE, and Tripwire tests right there.
The three tools
| Tool | What it does |
|---|---|
tripwire_test(url, instructions) | Ad-hoc test. Opens url headless, splits instructions into plain-English steps (one per line, or sentence-split), and lets Claude drive each step in a real browser. Returns whether it worked, which step broke, the final URL/page text, and any backend root cause. |
tripwire_run_suite(suite_path) | Run a saved suite. Runs a *.tripwire.yaml suite end-to-end in one shared browser session. Returns the summary plus per-case pass/fail with the reason and any filed root cause. |
tripwire_check(url, expect) | Check one expectation. Opens url headless and decides whether a plain-English expect holds. Obvious URL/text shapes are checked deterministically (no model call); anything subjective is adjudicated against the page text + a screenshot. Returns PASS / FAIL / INCONCLUSIVE. |
All three use Claude as the brain and a headless Playwright Chromium as the hands, so the server needs ANTHROPIC_API_KEY in its environment (it falls back to the key saved in the dashboard's Settings).
Install
cd mcp-server
uv venv && uv pip install -e .
uv run playwright install chromium # if not already installedVerify it's wired up — offline, no browser or key needed:
uv run python smoke_test.py
# -> OK — all 3 expected tools registered.The server speaks MCP over stdio. To run it directly:
ANTHROPIC_API_KEY=sk-ant-... uv run tripwire-mcptripwire-mcp is a console script equivalent to uv run python -m tripwire_mcp.server.
Platform note
The engine's structure module imports a legacy macOS desktop layer (mac_control → pyobjc) at load time, so the MCP server currently imports cleanly on macOS. The browser automation itself is cross-platform; only that import-time dependency is macOS-gated.
Register in Claude Code
One command (set the directory to your absolute mcp-server path):
claude mcp add tripwire \
--env ANTHROPIC_API_KEY=sk-ant-... \
-- uv run --directory /ABS/PATH/TO/Tripwire/mcp-server tripwire-mcp…or commit a project .mcp.json (one ships in the repo root — approve the tripwire server when prompted):
{
"mcpServers": {
"tripwire": {
"command": "uv",
"args": ["run", "--directory", "/ABS/PATH/TO/Tripwire/mcp-server", "tripwire-mcp"],
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
}
}
}Register in Cursor
Create .cursor/mcp.json in your project (one ships in the repo), then open Cursor Settings → MCP and confirm tripwire is connected with its 3 tools:
{
"mcpServers": {
"tripwire": {
"command": "uv",
"args": ["run", "--directory", "/ABS/PATH/TO/Tripwire/mcp-server", "tripwire-mcp"],
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
}
}
}Register in VS Code
VS Code (with MCP support, e.g. Copilot agent mode) reads .vscode/mcp.json:
{
"servers": {
"tripwire": {
"command": "uv",
"args": ["run", "--directory", "/ABS/PATH/TO/Tripwire/mcp-server", "tripwire-mcp"],
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
}
}
}Example prompts (once registered)
- "Use
tripwire_testonhttps://example.com/loginto log in withuser@example.com / hunter2and confirm it lands on the dashboard." - "Run the suite at
backend/data/suites/checkout.tripwire.yamlwithtripwire_run_suite." - "With
tripwire_check, verifyhttps://example.com/pricingshows the word 'Enterprise'."
Test it with MCP Inspector
To poke the server outside an editor, use the official MCP Inspector:
npx @modelcontextprotocol/inspector \
uv run --directory /ABS/PATH/TO/Tripwire/mcp-server tripwire-mcpThe Inspector launches the server over stdio and gives you a UI to list the three tools, inspect their schemas, and invoke them with arguments — handy for confirming the connection and trying tripwire_check against a URL before wiring it into your editor.
Layout
mcp-server/
├── pyproject.toml # package + deps (mcp SDK, anthropic, playwright, …)
├── smoke_test.py # offline check: server imports + 3 tools registered
└── tripwire_mcp/
├── engine.py # puts backend/app/engine on sys.path; lazy import
└── server.py # FastMCP app + the 3 toolsNext: gate your PRs in CI, or learn the suite format.