MCP server
@splithub/mcp for Claude Code, Cursor and Codex: tools, setup, working rules.
@splithub/mcp is a stdio Model Context Protocol server that exposes the splithub CLI as tools. Claude Code, Cursor, Codex, Windsurf or any MCP client can create experiments, read verdicts, start, pause, finish and push, using the same config file and credentials as the CLI.
Register it
npx splithub init and npx splithub skills --mcp write the entries. By hand:
// .mcp.json (Claude Code, committed) · .cursor/mcp.json (Cursor)
{ "mcpServers": { "splithub": { "command": "npx", "args": ["-y", "@splithub/mcp"] } } }
claude mcp add splithub -- npx -y @splithub/mcp
Other clients: command npx, args -y @splithub/mcp.
Environment: SPLITHUB_PROJECT_DIR (defaults to the client's working directory), SPLITHUB_API (staging or a self-hosted cloud), SPLITHUB_API_KEY (CI), SPLITHUB_CLI (path to a specific CLI build).
Tools
| Tool | Does | Notes |
|---|---|---|
splithub_status |
every experiment with status, visitors, days, verdict headline | start here |
splithub_results |
full verdict for one experiment | the agent should report verdict.message verbatim |
splithub_review |
AI reviews stored in the cloud (Pro): at start, on verdict changes or a weekly check, on finish, on demand | an analyst's opinion; the verdict stays the source of truth |
splithub_create_experiment |
adds an experiment to splithub.config.ts |
kind, id, variants, weights, goal, values, match/to, status, description |
splithub_set_status |
running / paused / finished |
live in cloud mode |
splithub_push / splithub_pull |
sync the config with the cloud | pull adopts dashboard-created experiments |
splithub_doctor |
checks the installation | run after wiring code |
splithub_login |
returns a sign-in link and a code | the agent shows it to the user and waits |
splithub_whoami |
connected project and public key | |
splithub_init |
sets up SplitHub in the project | once per project |
Every tool returns the CLI's --json output as text. Errors come back with isError and, when the folder is not connected, a hint to call splithub_login.
A typical session
- User: "A/B test the pricing page headline."
- Agent calls
splithub_status(is anything running on that page?), thensplithub_create_experimentwithkind: value, two variants, thesignupgoal. - Agent edits the component to read
useValue('pricing-title'), callssplithub_doctor. - Agent asks the user to confirm, then
splithub_set_status runningandsplithub_push. - Days later:
splithub_results→ "keep running; the estimate is 3,200 visitors per variant in total" or "winner found". The agent ships the winner and callssplithub_set_status finished.
The agent skills tell the agent these rules; the MCP tools are what it executes them with.