mcp
v0.8.0SplitHub as MCP tools for Claude Code, Cursor and Codex: run A/B experiments on websites and apps, read verdicts, and read analytics, funnels, paths and…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
splithub_status
Every experiment of this project with status, visitors, days, the verdict headline, sample (verdict.sample.quality: small | ok | good), stars (verdict.sample.stars, data quality 0..5) and daysToVerdict (days until a verdict at the current traffic: schedule the next check then, do not poll). verdict guardrail_breached = do not ship that variant. The __holdout row is the project holdout (long-term impact). properties[] (SplitHub Cloud) is each analytics property's last 7 days against the 7 before (visitors, change, goal conversions): mention a big move; splithub_analytics has the details. Start…
splithub_results
Results of one experiment. SplitHub Cloud gives the full verdict: sample per variant, lift, P(beat), SRM, winner; mvt adds factors[]. verdict.status guardrail_breached means do not ship: a variant made a guardrail metric worse (verdict.guardrailBreached[]); say what broke. verdict.metrics[] has secondary metrics and guardrails. The experiment __holdout is the project holdout (long-term impact of all experiments). Verdicts are sequential (always-valid, safe to check any time) and depend on sample size, not days. verdict.sample.quality is small (below the minimums), ok, or good (every variant ha…
| Parameter | Type | Description |
|---|---|---|
experiment * | string | experiment id (key) |
by | string | view: lift per segment of this dimension |
engagement | boolean | view: bounce rate, pages per visit, visit length per variant |
events | boolean | view: every goal and event per variant, with lift against the control |
filters | object | visitor column → comma-separated values, e.g. { country: "DE,FR", channel: "Paid Search" }; "(none)" matches empty |
from | string | first-exposure day, from (inclusive) |
timeline | boolean | view: visitors and conversions per day and variant |
to | string | first-exposure day, to (inclusive) |
splithub_experiment_events
The latest raw events of one experiment (SplitHub Cloud, newest first): exposures (type exposure, the variant a visitor saw) and goals (type goal) with time, visitor, url, country. Same from / to / filters as splithub_results; type keeps one kind; nextBefore pages to older ones (pass it as before). Raw events stay 7 days (30 on Pro); the key needs events:read. Use to check that exposures and goals arrive after wiring code.
| Parameter | Type | Description |
|---|---|---|
experiment * | string | experiment id (key) |
before | integer | nextBefore of the previous page (unix ms) |
filters | object | visitor column → comma-separated values |
from | string | |
limit | integer | |
to | string | |
type | string |
splithub_plan
Before creating an experiment: visitors per variant (and in all) to detect a relative lift `mde` on a `baseline` conversion rate, sized by SplitHub Cloud for its sequential verdict (no account needed; fails with UNREACHABLE offline). With an experiment id, also the days left at its current traffic when its numbers are readable. If it takes months, suggest a bigger change or a busier page.
| Parameter | Type | Description |
|---|---|---|
baseline * | number | conversion rate today, e.g. 0.05 |
mde * | number | smallest relative lift worth finding, e.g. 0.1 for +10% |
experiment | string | experiment id: adds days at its traffic |
variants | integer | number of variants including the control (default 2) |
splithub_experiment_create
Add an experiment to splithub.config.ts (checked by reloading the file). It is written as running: it goes live when the code is deployed (and pushed in cloud mode). Tell the user that, and that splithub_experiment_status paused holds it. Pass status draft only when the user asks to hold it. kind: value (text/number/URL read with useValue), component (<Experiment>/<Variant> markup), redirect (match path + per-variant destination), mvt (factors instead of variants, every combination compared, read with useValue as { factor: value }). First variant / first level is the control. In an app (React…
| Parameter | Type | Description |
|---|---|---|
id * | string | experiment key, lowercase |
kind * | string | |
description | string | |
end | string | ISO date the experiment ends |
factors | object | mvt only: factor → level → value, e.g. { headline: { old: "Old", new: "New" }, button: { blue: "#2563eb", green: "#16a34a" } }; first level = control; at most 4 factors × 4 levels |
goal | string | the goal: any event name the app sends with track() (signup, Video Played) or a goal key from the config; an event not in goals becomes a goal, nothing to declare first |
goodSample | integer | total visitors at which verdict.sample.quality turns good (default 5000); informational, never changes the verdict |
guardrails | array | goals (event names or goal keys) that must not get worse; { goal, worse: "higher" } when a rise is bad (refunds, errors). A breach makes the verdict guardrail_breached: do not ship |
layer | object | mutual exclusion: experiments in one layer never share a visitor; bucket ranges [start, end) must not overlap |
match | string | redirect experiments: the path it runs on, e.g. / |
maxVisitors | integer | stop counting after this many visitors |
minDays | integer | opt-in fewest days before a verdict (default 0 = none); verdicts otherwise depend on sample size |
name | string | human name shown instead of the key; can be renamed later, the key stays |
secondary | array | goals (event names or goal keys) to watch next to the primary goal |
start | string | ISO date the experiment starts |
status | string | |
to | object | redirect experiments: variant → destination path |
traffic | number | percent of visitors in the experiment (default 100) |
values | object | value experiments: variant → value |
variants | array | variant keys, first = control (not for mvt) |
weights | array | relative weights, same order as variants (not for mvt) |
splithub_create_experiment
Old name of splithub_experiment_create, kept for one release: call splithub_experiment_create instead.
| Parameter | Type | Description |
|---|---|---|
id * | string | experiment key, lowercase |
kind * | string | |
description | string | |
end | string | ISO date the experiment ends |
factors | object | mvt only: factor → level → value, e.g. { headline: { old: "Old", new: "New" }, button: { blue: "#2563eb", green: "#16a34a" } }; first level = control; at most 4 factors × 4 levels |
goal | string | the goal: any event name the app sends with track() (signup, Video Played) or a goal key from the config; an event not in goals becomes a goal, nothing to declare first |
goodSample | integer | total visitors at which verdict.sample.quality turns good (default 5000); informational, never changes the verdict |
guardrails | array | goals (event names or goal keys) that must not get worse; { goal, worse: "higher" } when a rise is bad (refunds, errors). A breach makes the verdict guardrail_breached: do not ship |
layer | object | mutual exclusion: experiments in one layer never share a visitor; bucket ranges [start, end) must not overlap |
match | string | redirect experiments: the path it runs on, e.g. / |
maxVisitors | integer | stop counting after this many visitors |
minDays | integer | opt-in fewest days before a verdict (default 0 = none); verdicts otherwise depend on sample size |
name | string | human name shown instead of the key; can be renamed later, the key stays |
secondary | array | goals (event names or goal keys) to watch next to the primary goal |
start | string | ISO date the experiment starts |
status | string | |
to | object | redirect experiments: variant → destination path |
traffic | number | percent of visitors in the experiment (default 100) |
values | object | value experiments: variant → value |
variants | array | variant keys, first = control (not for mvt) |
weights | array | relative weights, same order as variants (not for mvt) |
splithub_experiment_status
Start, pause or finish an experiment. The config file is updated (and checked); in cloud mode it applies live within a minute. After finishing, the variants are still in the code: ask the user which variant to keep, then call splithub_ship.
| Parameter | Type | Description |
|---|---|---|
experiment * | string | |
status * | string |
splithub_set_status
Old name of splithub_experiment_status, kept for one release: call splithub_experiment_status instead.
| Parameter | Type | Description |
|---|---|---|
experiment * | string | |
status * | string |
splithub_analytics
Analytics properties (pageviews or app screens, and custom events, no variants). A property is kind site or app; in an app a screen is a page (url /ScreenName) and platform / app_version are dimensions for by and filters. Without property: every property with visitors, visits, pageviews and bounce for the last 30 days. With property: totals (visitors, newVisitors, sessions = visits, pageviews, events, bounces, duration in ms; bounce rate = bounces / sessions), goals (conversions = unique visitors who reached it in the range, completions = how many times, revenue), topPages and topSources (valu…
| Parameter | Type | Description |
|---|---|---|
by | string | |
compare | also read another period: 'previous' (right before), 'year' (a year earlier) or 'YYYY-MM-DD..YYYY-MM-DD' | |
days | integer | |
experiment | string | by variant: the experiment key |
filters | object | dimension → comma-separated values |
from | string | |
goal | string | with by: also count this goal per row |
key | string | by trait: the trait name, e.g. plan |
limit | integer | |
property | string | property id; omit to list every property |
segment | string | saved segment name or id |
to | string |
splithub_analytics_funnel
Funnel of an analytics property (SplitHub Cloud): visitors who reached each step in order. Steps: page:/path (patterns like page:/blog/* work), event:<name>, goal:<key>; 2 to 8. Or funnel: a saved funnel's name or id (splithub_analytics_funnels), which brings its steps and within. within: visit (same visit, default), 7d or 30d (from the first step). Answers steps[] with visitors, conversion (share of the first step) and dropoff (share lost since the step before); by splits it by a visit dimension. rolledUp: days older than 90 count nothing. Counts, not an experiment: never call a winner from i…
| Parameter | Type | Description |
|---|---|---|
property * | string | |
by | string | |
days | integer | |
filters | object | dimension → comma-separated values |
from | string | |
funnel | string | a saved funnel name or id |
segment | string | saved segment name or id |
steps | array | e.g. ["page:/", "event:Signup", "goal:paid"]; omit with funnel |
to | string | |
within | string |
splithub_analytics_funnels
Saved funnels of an analytics property (SplitHub Cloud), shown on its Funnels tab for the whole team. Without save or delete: the list (id, name, steps, within). save + steps: save one under that name (a name already saved updates it; steps and within as in splithub_analytics_funnel). delete: remove one by id or name. Run one with splithub_analytics_funnel { funnel }.
| Parameter | Type | Description |
|---|---|---|
property * | string | |
delete | string | id or name to delete |
save | string | name of the funnel to save or update |
steps | array | e.g. ["page:/", "event:Signup", "goal:paid"] |
within | string |
splithub_analytics_paths
Where visits went right after a page (or, with direction prev, where they came from), within the visit (SplitHub Cloud). rows[] { value, visits }; (exit) = left the site, (entrance) = landed on the page.
| Parameter | Type | Description |
|---|---|---|
page * | string | a path like /pricing or /blog/* |
property * | string | |
days | integer | |
direction | string | |
filters | object | dimension → comma-separated values |
from | string | |
segment | string | saved segment name or id |
to | string |
splithub_analytics_retention
Retention cohorts of an analytics property (SplitHub Cloud), the key report for apps: users grouped by the day or week they started (start: visit, event:<name> or goal:<key>), and how many came back (return: visit or event:<name>) in period 0, 1, 2… cohorts[] { start, users, retained[] }; retained[0] is the cohort period itself, retained[i] / users is the share. Ranges longer than 90 days / 26 weeks are cut (clamped: true). Default: start visit, return visit, period week. filters take platform (ios, android, web…) and app_version too. Counts, not an experiment.
| Parameter | Type | Description |
|---|---|---|
property * | string | |
days | integer | |
filters | object | dimension → comma-separated values |
from | string | |
period | string | |
return | string | visit | event:<name> |
segment | string | saved segment name or id |
start | string | visit | event:<name> | goal:<key> |
to | string |
splithub_analytics_realtime
Who is on an analytics property right now (SplitHub Cloud): activeVisitors5m, pageviews and events per minute over the last 30 minutes, top pages and sources. Use to confirm tracking works after a deploy.
| Parameter | Type | Description |
|---|---|---|
property * | string |
splithub_segments
Saved segments: named report filters every report can apply (segment on splithub_analytics, funnel, paths, retention). Without arguments: the list. save + filters: save one (filters like { country: "DE,FR", channel: "Paid Search" }; property limits it to one property). delete: remove one by id or name. SplitHub Cloud.
| Parameter | Type | Description |
|---|---|---|
delete | string | id or name to delete |
filters | object | dimension → comma-separated values |
property | string | |
save | string | name of the segment to save |
splithub_notes
Notes: what happened on a day (a launch, an outage, a campaign), shown on experiment timelines and analytics charts (SplitHub Cloud). action list (default): newest first; experiment or property narrows it (project-wide notes come too), kind filters, days / from / to set the range. add: text (day defaults to today in the project time zone; kind note | issue | win; experiment or property ties it to one, none = the whole project). edit: id + text / kind / day. delete: id. Add one when you ship something that may move the numbers.
| Parameter | Type | Description |
|---|---|---|
action | string | |
day | string | |
days | integer | |
experiment | string | experiment key |
from | string | |
id | string | note id (edit, delete) |
kind | string | |
property | string | analytics property id |
text | string | |
to | string |
splithub_links
Short links (SplitHub Cloud): one short URL that redirects to one or more destinations split by weight (split visitors between landing pages without code), clicks counted. action list (default): every link with totalClicks. stats: one link (id or slug): clicks per day (30 days), per destination, country, device, referrer, unique visitors. create: urls (one or more full http(s) URLs), slug (3-32 letters, digits, - _; random when omitted), name, weights (one per URL). edit: name / slug / description. pause, resume, delete: by id or slug. Targeting by country, device or a flow is done in the dash…
| Parameter | Type | Description |
|---|---|---|
action | string | |
description | string | |
link | string | link id or slug (stats, edit, pause, resume, delete) |
name | string | |
slug | string | |
urls | array | create: destinations |
weights | array | create: one weight per URL (default equal) |
splithub_alerts
Alert rules (SplitHub Cloud; they fire on Pro, a rule added on another plan is saved switched off). action list (default): rules with condition, params (params.progress { total, fired, month? } on usage and event_count is read-only), enabled; channels; history (recent alerts). add: condition + params. Experiment conditions (experiment = one key, omit for every running one): srm (broken split), winner (minVisitors?), loser (lift %, minVisitors?), exposures (visitors), conversions (conversions), duration (days), no_events (hours). Account: quota (percent of the monthly allowance), usage (every:…
| Parameter | Type | Description |
|---|---|---|
action | string | |
condition | string | |
conversions | integer | |
cooldownHours | number | |
count | integer | |
days | integer | |
dropLoser | boolean | |
enabled | boolean | add: false saves it switched off |
event | string | |
every | integer | |
experiment | string | |
finish | boolean | |
goal | string | |
hours | number | |
lift | number | |
minVisitors | integer | |
name | string | |
pause | boolean | |
percent | number | |
property | string | |
repeat | boolean | |
rule | string | rule id, id prefix or name (enable, disable, delete, test) |
visitors | integer |
splithub_analytics_connect
Set up analytics in this app: use a property (id), create one (name, or nothing when the project has none), then name it on the one <SplitHubProvider> / <SplitHubNextProvider> in the code (property="sh-…"). Answers property, created, wired { status: added | already | other | none | many, file, line }, snippets { provider, script (sh.js tag with data-property), track, identify } and next. status none or many: add the provider snippet yourself (or the sh.js tag on a site without React). other: the provider names another property; ask before calling again with force. Pageviews are sent for you;…
| Parameter | Type | Description |
|---|---|---|
force | boolean | replace another property already named on the provider |
name | string | create a new property with this name |
property | string | property id to use (added to the config when new) |
splithub_analytics_events
The latest raw pageviews and custom events of an analytics property (cloud: the raw tail, 7 days free / 30 Pro; self-hosted: the user's database). Use to check that tracking works after wiring track() or sh.js.
| Parameter | Type | Description |
|---|---|---|
property * | string | |
limit | integer |
splithub_property_create
Add an analytics property to splithub.config.ts, checked by reloading the file. Its id is generated (sh-x1h78w) unless given; it comes back as property. Events go only to a property named explicitly: wire <SplitHubProvider config={config} property="<id>"> (pageviews on load and every route change, and every track() call) or data-property="<id>" on the sh.js script tag. Every goal of the project counts as a conversion unless goals narrows them. In cloud mode it is created in the cloud at once (live: applied), so no push is needed: tell the user to deploy. If live names a missing API key, log in…
| Parameter | Type | Description |
|---|---|---|
description | string | |
goals | array | |
id | string | omit to get a generated id |
kind | string | app: a mobile or desktop app (screens, versions, retention); default: app in an app project, else site |
name | string | |
status | string |
splithub_create_property
Old name of splithub_property_create, kept for one release: call splithub_property_create instead.
| Parameter | Type | Description |
|---|---|---|
description | string | |
goals | array | |
id | string | omit to get a generated id |
kind | string | app: a mobile or desktop app (screens, versions, retention); default: app in an app project, else site |
name | string | |
status | string |
splithub_property_status
Pause or resume an analytics property (paused: its pageviews and events are dropped and not billed). Updates splithub.config.ts; in cloud mode it applies live within a minute. archived (SplitHub Cloud) stops collecting and hides it like the dashboard Archive, numbers kept; restored brings it back paused. removed takes it out of the config (a dashboard-made property is deleted in the cloud with its numbers).
| Parameter | Type | Description |
|---|---|---|
property * | string | |
status * | string |
splithub_set_property_status
Old name of splithub_property_status, kept for one release: call splithub_property_status instead.
| Parameter | Type | Description |
|---|---|---|
property * | string | |
status * | string |
splithub_domains
Allowed domains, per experiment and per analytics property (SplitHub Cloud). Without arguments: every allowed domain with where it applies, which experiments / properties accept any origin, and the origins seen sending events. With kind + id + hosts: replace that experiment's or property's list (subdomains included; an empty list accepts any origin again). Events from an origin outside the list are dropped (403 when nothing in the batch is allowed).
| Parameter | Type | Description |
|---|---|---|
hosts | array | e.g. ["example.com"]; [] clears the list |
id | string | |
kind | string | experiment or property (test is an old name for experiment) |
splithub_refs
Files and lines that use an experiment id or its goal. Use after wiring code (is it referenced?) and after splithub_ship (count should be 0 for the experiment).
| Parameter | Type | Description |
|---|---|---|
experiment * | string |
splithub_ship
Keep one variant and take the experiment out: archives it in the cloud (numbers stay readable), removes it from splithub.config.ts and rewrites the code (<Experiment> → the kept <Variant>, useValue → the kept literal, useVariant branches folded, unused imports dropped). Ask the user which variant to keep first (recommend verdict.winner; never a variant listed in verdict.guardrailBreached). Call with dryRun: true, show the diff, then without. Fix leftovers[] by hand, then follow next[] (push, doctor, tests).
| Parameter | Type | Description |
|---|---|---|
experiment * | string | |
keep * | string | variant key to keep |
dryRun | boolean | only return the diff |
splithub_remove
Remove an experiment from splithub.config.ts (and archive it in the cloud when connected) without touching the code. Prefer splithub_ship, which also cleans the code. Returns refs still in the code.
| Parameter | Type | Description |
|---|---|---|
experiment * | string |
splithub_review
AI reviews of an experiment stored in SplitHub Cloud (Pro): written at the start, when the verdict changes while it runs, when it finishes, or on demand in the dashboard. Newest first. Quote them as an opinion; the verdict stays the source of truth.
| Parameter | Type | Description |
|---|---|---|
experiment | string | experiment id; omit for every experiment of the project |
splithub_push
Upload splithub.config.ts to SplitHub Cloud (cloud mode). Also returns kept: experiments the cloud has from an earlier push that this file lacks, left as they are. prune removes those: only when the user asked for it. Returns experiments created in the dashboard that were written into the file. dryRun: only check the config and show what would change. A key that already belonged to another experiment fails with KEY_CONFLICT: ask the user, then push with replace (new experiment, old numbers cleared) or same (same experiment, numbers stay).
| Parameter | Type | Description |
|---|---|---|
dryRun | boolean | |
prune | boolean | also remove experiments the cloud has that the file lacks (ask the user first) |
replace | array | keys that are new experiments: the old numbers under them are cleared |
same | array | keys that are the same experiment as before: the numbers stay |
splithub_pull
Fetch the cloud config and write dashboard-created experiments into splithub.config.ts.
splithub_doctor
Check the installation: config, provider, middleware, routes, code references, endpoint; in a React Native / Expo app also the package, its storage module and redirect experiments; in a native iOS / Android project the SDK in the build files. Run after wiring code; ok: false lists what to fix.
splithub_whoami
Which cloud project this folder is connected to, and its public key.
splithub_projects
Every folder on this machine connected to a SplitHub Cloud project, the current one marked (current).
splithub_login
Connect this folder to SplitHub Cloud. Returns a sign-in link and a code: show them to the user, who approves in the browser (and can create a project there). The CLI then stores a project API key for this folder. Call splithub_whoami afterwards.
splithub_init
Set up SplitHub in this project: config file, framework files, agent skills; React Native / Expo apps also get @splithub/react-native and their entry (App.tsx, app/_layout.tsx) wrapped in <SplitHubProvider> with screen tracking (app.entry.status added | already | manual: wire nextStep by hand); native iOS / Android get install lines and a quick start (app.install, app.quickStart) and no config file; in cloud mode see splithub_login to connect. Use once per project. githubAction: also write a GitHub workflow (checks on PRs, results comment on a schedule).
| Parameter | Type | Description |
|---|---|---|
githubAction | boolean | |
key | string | public key pk_… when known |
mode | string |