MCP server
Connect Claude Code, Cursor, ChatGPT, or any MCP-speaking client to your PAD workspace and operate it from your editor. Read counts, run agents, approve insights, ship campaigns — all without leaving the keyboard.
Why this exists.Marketing tools assume there's a marketer behind the dashboard. For developer-led teams that's often false. The MCP server lets PAD live in the same loop as your code — a single Claude Code conversation can read your funnel, draft a campaign, ship it, and write the post-mortem.
One-line install
Claude Code (CLI)
claude mcp add pad-ai \
--transport http \
--url https://pad.thevisualpay.com/api/mcp \
--header "Authorization: Bearer pad_sk_YOUR_KEY"That's it. Your next claude session has every PAD tool available. Generate a server-scoped API key at /dashboard/settings/api-keys if you don't have one.
Cursor / Windsurf / VSCode (config file)
Add this to .cursor/mcp.json(or your tool's equivalent):
{
"mcpServers": {
"pad-ai": {
"transport": "http",
"url": "https://pad.thevisualpay.com/api/mcp",
"headers": {
"Authorization": "Bearer pad_sk_YOUR_KEY"
}
}
}
}ChatGPT (Custom GPT action)
OpenAI's ChatGPT MCP support is still limited as of mid-2026 — for now wrap the MCP endpoint as a Custom GPT action against https://pad.thevisualpay.com/api/mcp using Bearer auth. Tool discovery happens via the OpenAPI we serve at /v1/openapi.json.
Auth
Same Bearer token as the REST API. Use a server-scopedkey — browser keys can't mutate. The key already binds to one workspace; the optional X-Pad-Workspace header only matters if you need to pin a specific slug when one key spans multiple workspaces.
Need to discover your slug from the API? Hit GET /v1/workspacewith the same Bearer token — it returns the workspace + organization + key scope. Useful in scripts that don't want to hardcode the slug.
Every mutation gets an audit-log entry tagged { type: 'system', source: 'mcp' }. You can audit the agent at /dashboard/settings/audit.
Tools
50 tools total covering every non-credential operation in the dashboard. Schema is exposed via the MCP tools/list JSON-RPC method; your client auto-discovers. Groups below are for human navigation only.
Workspace state (read)
workspace_summaryOne-shot context dump — org, plan, last-7-day events/sends, pending insights, deliverability. Call this first.
workspace_healthSend / bounce / complaint / open rates, 30-day window.
domain_healthPer-recipient-domain deliverability snapshot.
get_subscriptionStripe plan + status + period end (read-only).
ai_budget_statusToday + month AI spend vs the workspace cap.
recent_audit_eventsState-changing actions across members, agents, system.
recent_agent_runsLast N agent runs from the inspector — cost, tokens, errors.
Profiles
list_profilesPaginated search by email/externalId.
list_recent_profilesLast N most-recently-active.
get_profile_detailSingle profile + recent events + sends + consents.
set_profile_traitWrite a jsonb trait. Rejects agent-managed keys (leadScore).
delete_profile_traitRemove a single trait key.
delete_profileGDPR-erase the profile and cascade. Audited before delete.
send_test_emailRender a template with the profile and send a one-off to an inbox you choose.
Events
count_eventsFiltered count over a time window.
list_eventsPaginated list with optional search/type filter.
event_breakdownTop event types by volume in a window.
track_eventSend an event. Same path as POST /v1/events. Marks source=mcp.
Campaigns
list_campaignsEvery campaign + status.
get_campaignSingle campaign + DSL + total run count.
create_campaignNew campaign with trigger event + initial DSL. Validates branch + wait_for_event jump targets.
save_campaign_definitionUpdate an existing campaign's DSL, name, or status. Same validation as the dashboard builder.
pause_campaignStop firing future triggers. In-flight runs continue.
resume_campaignFlip status back to active.
duplicate_campaignClone to a -copy draft. Useful for A/B variants.
archive_campaignSoft-delete; preserves history.
delete_campaignHard-delete. Refuses on active campaigns.
list_campaign_runsRecent enrollments — state, current step cursor, timestamps. Debug "why did this user not get the email".
campaign_analyticsSend totals + per-step breakdown (sent / delivered / opened / clicked / bounced). Spot which step leaks conversions.
Segments
list_segmentsSaved segments + last-known match counts.
get_segmentSingle segment with its DSL.
translate_segmentNatural-language → DSL via the Studio model, grounded in this workspace's event types. Returns DSL + live count. Doesn't save — pair with save_segment.
save_segmentCreate or update with an explicit DSL. Recomputes cached count.
segment_sizeForce a recount on the saved DSL.
list_segment_profilesSample N profiles matching the segment. Sanity check before launching a campaign against it.
export_segment_profilesAll matching externalIds + emails (capped at 5000). For programmatic sync to another system.
delete_segmentDrop the segment row. Doesn't touch profiles.
Templates
list_templatesAll templates available for sends — DB-authored first, code-defined fallback. Each row has a `source` field.
get_templateDB row first, code fallback. Returns body + variables.
preview_templateRender with variables. Returns subject + HTML + text.
ai_draft_templateGenerate subject + HTML from a free-form prompt. Reads brand voice. Counts against AI budget.
save_templateCreate or update DB template. Pass status:"published" to make it sendable.
delete_templateDrop a DB template. Code templates are read-only.
Sends
list_sendsRecent sends, filterable by status.
get_send_detailSingle send + Resend webhook timeline.
Insights + agents
recent_insightsWhat the agents surfaced in the last batch.
approve_insightMove from proposed → approved.
dismiss_insightMove from proposed → dismissed. Optional reason.
run_agentTrigger growth / onboarding / winback agent. Returns insight id.
run_lead_scoringScore every profile 0-100. Writes traits.leadScore.
run_pii_auditScan events + traits + templates for PII patterns.
Settings
get_brand_voicePersona, tone, do-not-use list, examples.
update_brand_voicePartial updates supported.
update_ai_budgetSet daily and/or monthly USD caps.
Example prompts
Drop these straight into Claude Code, Cursor agent, or ChatGPT once the server is connected. The agent figures out the right tool sequence.
- Daily standup, one prompt
"Use workspace_summary, then list the top 3 pending insights I should look at. For each, suggest approve or dismiss with a one-line rationale."
- Triage a deliverability spike
"Run workspace_health. If bounce rate is over 2%, pause every active campaign and tell me which addresses are bouncing the most. Don't auto-resume."
- Smoke-test a new event type
"Send a track_event of type 'checkout.completed' for externalId 'qa-1' with properties {amount: 99}. Then count_events for that type in the last hour."
- Ship today's growth experiments
"Run run_agent(growth). When it returns the insight id, read it back with recent_insights and either approve_insight or dismiss_insight with a reason."
- Reactivation campaign sanity check
"List my segments. Pick the one that looks like dormant paid users. segment_size it. If under 500 profiles, pause the winback campaign — we don't have enough cohort."
- Author a new template from scratch
"Use ai_draft_template to write a welcome email for a B2B SaaS that just signed up — friendly, one CTA pointing at /dashboard. Then preview_template with firstName='Cris' to verify it renders, and save_template as a draft with slug welcome-v2."
- Build a segment + campaign from a sentence
"translate_segment('paid users who haven\'t logged in for 14 days'). If count is over 50, save_segment as dormant-paid. Then list_segment_profiles(dormant-paid, 5) so I can sanity-check the cohort."
- Ship a 3-step winback campaign
"create_campaign('winback-3step', 'Winback 3-step', 'subscription.cancelled', { trigger: { eventType: 'subscription.cancelled' }, steps: [{kind:'send', templateSlug:'winback-1', variables:{}}, {kind:'delay', ms: 259200000}, {kind:'send', templateSlug:'winback-2', variables:{}}] }, 'draft'). Then list_campaign_runs once it's active to verify enrollments are happening."
- Debug a leaking funnel
"campaign_analytics(welcome-drip). Tell me which step has the worst open rate. If a step's click rate is below 5% AND it has at least 100 sends, suggest a copy revision via ai_draft_template."
Rate limits + safety
- Per-key rate limits match the REST API. MCP tools that mutate go through the same paths (event ingestion, audit logging) as the SDK — same gates apply.
- MCP cannot create API keys, rotate Stripe credentials, change billing, or delete workspaces. Those are dashboard-only.
- The audit log captures every mutation with
source: mcp. You can grep/dashboard/settings/auditto see what your agent did.
Endpoint metadata
GET https://pad.thevisualpay.com/api/mcp returns the server version + tool count in plain JSON — useful for health-checks and as a sanity test before wiring auth.