Skip to content

AI Coding Agents

B2B SaaSE-commerceAgencies

Check live tests and run experiments from Cursor MCP

Bind your repo with .apex/workspace.json so Cursor or Claude Code checks live tests before editing any page, previews experiments before creation, and tracks deploys straight from chat.

One-click browser approval; zero pasted secrets.

6 min read5 min setupUpdated
Two software engineers at a sunlit wooden table, one placing a brass marker weight beside a neat stack of blank cream cards while a seated teammate watches.
Your coding agent checks live experiments before touching a page, keeping AI-assisted shipping from silently breaking active tests.

MCP pre-edit guard simulator

Walk through check_live_tests and the 5-step MCP experiment loop

Pick a file your agent is about to edit and see how check_live_tests detects active tests, presents the three outs, and prevents silent contamination.

Illustrative repo · .apex/workspace.json + check_live_tests
40,000
ApexApex · Live Playbook Simulator

Exposed conversion rate

5.6%

2,016 / 36,000

Holdout baseline rate

4.2%

168 / 4,000 (10% holdout)

Incremental revenue

$47,880

+504 net conversions

Exposed vs. holdout cohort breakdown

CohortPeopleConversionsRateRevenue
Exposed group36,0002,0165.6%$191,520
Holdout (10%)4,0001684.2%$15,960

Exposed cohort

5.6%

2,016 / 36,000

Holdout cohort

4.2%

168 / 4,000

Causal lift & 95% confidence interval+1.4 pp (95% CI +0.7 to +2.1 pp)
+504 incremental conversions ($47,880)p < 0.001

Assumptions: Sample: 40,000 people (90/10 split). Duration: 30 days. Primary metric: Paid conversions. Stopping rule: Fixed window evaluation at 95% confidence. Method: Two-proportion difference with a 95% confidence interval on randomly hashed exposed and holdout groups.

The 95% confidence interval sits cleanly above zero, confirming $47,880 in real incremental revenue.
What this proves

Verified incremental lift

+1.40 pp

$47,880 true incremental revenue

  • Deterministic hashing holds out 4,000 contacts across every channel.
  • 95% confidence interval proves whether lift clears zero before scaling spend.

Holdout measurement cadence

  1. Day 0Deterministic assignment10% holdout

    4,000 contacts assigned to holdout before first delivery.

  2. 30 daysTwo-proportion readoutSignificant

    +504 incremental conversions verified.

The complete playbook

Step-by-step setup, worked math, and real limits.

Steps, technical details, and live pricing.

How it works without Apex

Connect Cursor or Claude Code to Apex MCP and commit .apex/workspace.json so every session targets the right workspace. Before editing any page, letter, journey, or milestone, the agent calls check_live_tests with the full file contents and stops to ask if a running experiment covers that surface (giving you three outs: end the test, wait, or confirm the edit is unrelated). Plan, deploy-track, activate, and review experiments from the same chat.

How Apex does it for you

Apex MCP authenticates with one browser approval link (no pasted keys), binds repos via .apex/workspace.json, guards running tests via check_live_tests without auto-pausing anything, and walks experiments from plan_experiment through track_deployment and get_results.

How to set this up in 5 steps

  1. Connect Apex MCP and approve once in your browser

    Run /setup-apex or tell Cursor to set up Apex in this repo. Click the browser approval link so the agent authenticates with zero pasted API keys.

  2. Commit .apex/workspace.json so every repo targets the right workspace

    Let the agent bind the repo to an existing workspace, a new workspace in your org, or a separate organization, and commit .apex/workspace.json so future chats switch automatically.

  3. Call check_live_tests with full file contents before editing

    Before modifying any page, letter, journey, or milestone, the agent runs check_live_tests. If a live test matches, it stops and offers three outs: end the test then ship, wait until it ends, or confirm the change is unrelated.

  4. Plan, record belief reasoning, and preview before creating

    Tell the agent what metric you want to move. It calls plan_experiment, records your assumption with start_reasoning, and runs create_experiment with preview: true so you confirm control, variant, and split first.

  5. Track deployment, activate, and review results in chat

    After wiring flicker-free SSR assignment (such as @apex-inc/next assignExperiments), call track_deployment with your commit SHA, check_deployment, activate_experiment, and later ask for get_results.

Why AI edits break live tests

When engineers ship UI fixes with Cursor or Claude Code, the agent sees the code in front of it, not the live A/B test running on that page in production. One innocent headline tweak on /pricing or an unannounced button rewrite in an onboarding email silently contaminates your control arm and throws away two weeks of sample size.

Connecting your editor to Apex MCP Workflows puts live experiment awareness directly into the coding loop. Authentication uses one browser approval link (no pasted keys), and committing .apex/workspace.json inside each repository guarantees every chat targets the right workspace automatically.

Senior engineer placing a wooden stop-block ahead of three dominoes on a sunlit birch table while talking with a teammate.
Running check_live_tests with full file contents stops an edit before it contaminates an active pricing or onboarding experiment.

How check_live_tests protects pages

Before your coding agent edits a page, letter, Adaptive Journey, or Adoption Milestone, it calls check_live_tests with the full file contents (not a diff hunk) or the relevant communication, journey, or milestone IDs.

  • If nothing live matches: The agent proceeds with your edit immediately.
  • If a running test matches: The agent stops and asks you to pick one of three explicit outs:
  1. End the running test first, then ship the change.
  2. Wait until the test finishes before editing.
  3. Confirm this change is unrelated to the element under test.

check_live_tests is strictly read-only: it never pauses an experiment and never sends mail on its own. Pausing or ending a test always stays a human decision.

Shipping a code experiment from chat

From the exact same editor session, you can take a new growth hypothesis all the way from belief reasoning to a live flicker-free test:

StepMCP toolWhat happens
1. Planplan_experimentPulls related workspace beliefs so you build on prior results
2. Reasonstart_reasoningRecords your hypothesis and confidence level before traffic runs
3. Previewcreate_experiment (preview: true)Shows exact name, control, variant, and traffic split for approval
4. Implement@apex-inc/next + useApexVariantRenders the assigned arm on first HTML so visitors see zero flicker
5. Verify & Starttrack_deployment, check_deployment, activate_experimentLinks the commit SHA, confirms rollout, and turns traffic on
Two product developers pinning a fresh winner card onto a wooden belief wall inside a sunlit studio.
Every experiment flows from belief reasoning to preview, deploy verification, and results right inside the editor.
Multi-repo tip: One MCP install covers every organization and workspace you have access to. In a second repository, run /setup-apex to create either a second workspace inside the same org (shared billing and teammates) or a separate organization (isolated billing and permissions), and let the agent write .apex/workspace.json for that repo.

What this costs on Apex

Live Apex pricing · Pay-as-you-go

Estimated Apex cost for Product engineering team running 4 monthly code experiments via Cursor MCP across 40,000 visitors

$0 / month

Covered by monthly free allowances.

Apex meter / scheduleScenario volumeFree allowance / basisRateApex cost
Orchestrations
Live experiment variant assignments across active tests (40,000 monthly assignments)
40,000 / mo1M / month$5 per 100K assignments$0
Events
Page views and conversion events evaluating experiment outcomes (40,000 monthly web events)
40,000 / mo1M / month$5 per 100K events$0

Hosted Apex MCP tool calls, check_live_tests guards, and workspace setup checks carry zero extra per-call charge. History: 13 months no card, 3 years with card, 7 years once you've paid an invoice. Live pricing.

Apex MCP connections, check_live_tests pre-edit checks, and workspace setup tools carry zero extra fee; you pay only standard metered rates for live traffic and variant assignments.

Run this right inside Cursor

Walk the exact Set up Apex and experiment check workflow

Type this prompt in any repo connected to Apex MCP to verify workspace binding and guard your next edit against live tests.

1Add Apex to your editor

Install in Grok Build

Opens Grok Build and adds Apex. Nothing to configure.

2Tell your agent

Prompt for your AI editor

Read .apex/workspace.json, call get_setup_state to see what is unfinished, and run check_live_tests on our pricing page before making any edits.

The first time your agent calls Apex, it gives you a link to approve in the browser. There is no key to paste. In Grok Build you can also run /setup-apex.

See how editor setup works step by step

marketing-web · Grok BuildWaiting for approval
Agent
You

Set up Apex in this repo.

Set up Apex · 0 of 4
  • Signed in
  • Workspace named
  • Events arriving
  • Conversion picked
  • Stripe

Your move

Let AI coding agents ship faster without trampling active experiments.

Bind every repo to its Apex workspace, check live tests before edits, and review experiment readouts right in your editor.