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
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.
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.
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.
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.
Track deployment, activate, and review results in chat
After wiring flicker-free SSR assignment (such as
@apex-inc/nextassignExperiments), 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.

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:
- End the running test first, then ship the change.
- Wait until the test finishes before editing.
- 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:
| Step | MCP tool | What happens |
|---|---|---|
| 1. Plan | plan_experiment | Pulls related workspace beliefs so you build on prior results |
| 2. Reason | start_reasoning | Records your hypothesis and confidence level before traffic runs |
| 3. Preview | create_experiment (preview: true) | Shows exact name, control, variant, and traffic split for approval |
| 4. Implement | @apex-inc/next + useApexVariant | Renders the assigned arm on first HTML so visitors see zero flicker |
| 5. Verify & Start | track_deployment, check_deployment, activate_experiment | Links the commit SHA, confirms rollout, and turns traffic on |

Multi-repo tip: One MCP install covers every organization and workspace you have access to. In a second repository, run/setup-apexto 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.jsonfor 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 / schedule | Scenario volume | Free allowance / basis | Rate | Apex cost |
|---|---|---|---|---|
Orchestrations Live experiment variant assignments across active tests (40,000 monthly assignments) | 40,000 / mo | 1M / month | $5 per 100K assignments | $0 |
Events Page views and conversion events evaluating experiment outcomes (40,000 monthly web events) | 40,000 / mo | 1M / 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.
