Add A/B test results tool with interactive UI#23
Merged
Conversation
Ports the deco.cx admin Experiments results screen into the MCP App as a new tool with an interactive dashboard. - `list_experiments`: entry-point tool that launches the UI, listing the site's experiments and resolving its production domains - `experiment_results`: fetches per-goal conversions, a daily timeseries, and the A/B statistics (participants, target sample size, probability each variant is best), computed server-side - `create_experiment`: creates a new experiment from the UI - `api/lib/ab-test.ts`: server-side port of the admin A/B math, with a jstat-free standard-normal CDF (Abramowitz & Stegun erf approximation) - React UI (recharts + shadcn): experiment list with a New dialog, results view with domain/period/filter controls, variant probability, timeseries and goal charts, and funnel/by-goal tables Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
admin-mcp | 98193e8 | Commit Preview URL Branch Preview URL |
Jul 07 2026, 08:07 PM |
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ports the deco.cx admin Experiments results screen into this MCP App as a new tool with an interactive dashboard.
Tools
list_experiments— entry-point tool that launches the UI. Lists the site's experiments and resolves its production domains.experiment_results— fetches per-goal conversions for each variant, a daily timeseries for the selected goal, and the A/B statistics (participants, target sample size, probability each variant is best). All computed server-side so the UI just renders.create_experiment— creates a new experiment from the UI (the New button).Statistics
api/lib/ab-test.tsis a server-side port of the admin'sutils/statistics/abTest.ts(sampleSize,pBetter). The admin version pulls injstat(~45KB) only fornormal.cdf; since the client bundle is inlined into a single HTML resource, we reimplement the standard-normal CDF with an Abramowitz & Stegun erf approximation instead — no new dependency.UI (
web/tools/experiments/)React 19 + recharts + shadcn:
Notes
create_experimentinserts the experiment row (minus the traffic-split matcher block, which is configured in the editor). It surfaces admin errors (e.g. RLS) via anerrorfield instead of failing silently.logs.ts,assets/index.tsx,monitor/index.tsx) are left untouched. New code passes lint, typecheck, and full build.Test plan
bun run build(client + server)bun run check(only pre-existing node_modules errors)🤖 Generated with Claude Code
Summary by cubic
Adds an A/B test results tool with an interactive dashboard. Lets you list and create experiments, and view per-goal metrics, timeseries, and significance computed server-side.
New Features
list_experiments(opens UI and resolves domains),experiment_results(per-goal conversions, daily timeseries, sample size and “best” probabilities),create_experiment(New dialog).api/lib/ab-test.ts(sample size,pBetter) so the UI only renders precomputed data.ui://mcp-app/experimentsviacreateExperimentsAppResource, added toapi/app.ts, and routed inweb/router.tsx.Dependencies
jstatby implementing the standard-normal CDF inapi/lib/ab-test.ts.Written for commit 98193e8. Summary will update on new commits.