Marketing math your AI can call
Nine marketing tools (A/B tests, budget splits, attribution, customer segments) that Claude calls to run the numbers instead of guessing them.
How it works
One createServer() call builds the MCP server and its nine tools. Three
runtimes wrap that same server in a different transport, so a tool gives the same
answer wherever it runs.
-
In your browser
The playground on this page imports
createServer()and connects to it over an in-memory transport. The call never leaves the tab.{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "ab_test_plan", "arguments": { "baseline_rate": 0.03, "mde_relative": 0.2, "daily_visitors": 2000}}} -
On a Cloudflare Worker
The Worker builds a fresh server for every request and answers Streamable HTTP at
/mcp. That URL is what you paste into Claude as a custom connector.{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "budget_optimize", "arguments": {}}} -
On your machine
npm run start:stdioruns the same server over stdin and stdout, one JSON-RPC message per line, so Claude Desktop can start it as a local command.{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "store_sales", "arguments": { "group_by": "category"}}}
Transcripts
Loading four recorded conversations with Claude.
The nine tools
Each tile runs a tool's first example in your browser, with the same code the server uses. Pick a tool name to open it in the playground.
-
A/B tests
Did the variant really win? And how many visitors does the next test need?
Running the example in your browser.
ab_test_evaluate, example "Hillstrom-sized email test" -
E-mail
Which customers a real e-mail campaign moved, in the Hillstrom experiment with 64,000 customers.
Running the example in your browser.
email_test_analyze, example "Men's e-mail, overall conversion" -
Attribution
Five attribution models side by side, scored on a simulated sample whose true shares are known.
Running the example in your browser.
attribution_compare, example "Simulated sample with known truth" -
E-commerce
Sales by category, state or month, RFM customer segments and a B2B lead funnel, from Olist's public data.
Running the example in your browser.
store_sales, example "Top 10 categories by revenue", top 5 shown -
Budget
What a weekly media budget buys, and the split a marketing mix model expects to sell more.
Running the example in your browser.
budget_simulate, example "Current plan", against budget_optimize, example "Reallocate the current budget"
Playground
Loading the nine tools. They run in your browser, with no sign-up.