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_summary

    One-shot context dump — org, plan, last-7-day events/sends, pending insights, deliverability. Call this first.

  • workspace_health

    Send / bounce / complaint / open rates, 30-day window.

  • domain_health

    Per-recipient-domain deliverability snapshot.

  • get_subscription

    Stripe plan + status + period end (read-only).

  • ai_budget_status

    Today + month AI spend vs the workspace cap.

  • recent_audit_events

    State-changing actions across members, agents, system.

  • recent_agent_runs

    Last N agent runs from the inspector — cost, tokens, errors.

Profiles

  • list_profiles

    Paginated search by email/externalId.

  • list_recent_profiles

    Last N most-recently-active.

  • get_profile_detail

    Single profile + recent events + sends + consents.

  • set_profile_trait

    Write a jsonb trait. Rejects agent-managed keys (leadScore).

  • delete_profile_trait

    Remove a single trait key.

  • delete_profile

    GDPR-erase the profile and cascade. Audited before delete.

  • send_test_email

    Render a template with the profile and send a one-off to an inbox you choose.

Events

  • count_events

    Filtered count over a time window.

  • list_events

    Paginated list with optional search/type filter.

  • event_breakdown

    Top event types by volume in a window.

  • track_event

    Send an event. Same path as POST /v1/events. Marks source=mcp.

Campaigns

  • list_campaigns

    Every campaign + status.

  • get_campaign

    Single campaign + DSL + total run count.

  • create_campaign

    New campaign with trigger event + initial DSL. Validates branch + wait_for_event jump targets.

  • save_campaign_definition

    Update an existing campaign's DSL, name, or status. Same validation as the dashboard builder.

  • pause_campaign

    Stop firing future triggers. In-flight runs continue.

  • resume_campaign

    Flip status back to active.

  • duplicate_campaign

    Clone to a -copy draft. Useful for A/B variants.

  • archive_campaign

    Soft-delete; preserves history.

  • delete_campaign

    Hard-delete. Refuses on active campaigns.

  • list_campaign_runs

    Recent enrollments — state, current step cursor, timestamps. Debug "why did this user not get the email".

  • campaign_analytics

    Send totals + per-step breakdown (sent / delivered / opened / clicked / bounced). Spot which step leaks conversions.

Segments

  • list_segments

    Saved segments + last-known match counts.

  • get_segment

    Single segment with its DSL.

  • translate_segment

    Natural-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_segment

    Create or update with an explicit DSL. Recomputes cached count.

  • segment_size

    Force a recount on the saved DSL.

  • list_segment_profiles

    Sample N profiles matching the segment. Sanity check before launching a campaign against it.

  • export_segment_profiles

    All matching externalIds + emails (capped at 5000). For programmatic sync to another system.

  • delete_segment

    Drop the segment row. Doesn't touch profiles.

Templates

  • list_templates

    All templates available for sends — DB-authored first, code-defined fallback. Each row has a `source` field.

  • get_template

    DB row first, code fallback. Returns body + variables.

  • preview_template

    Render with variables. Returns subject + HTML + text.

  • ai_draft_template

    Generate subject + HTML from a free-form prompt. Reads brand voice. Counts against AI budget.

  • save_template

    Create or update DB template. Pass status:"published" to make it sendable.

  • delete_template

    Drop a DB template. Code templates are read-only.

Sends

  • list_sends

    Recent sends, filterable by status.

  • get_send_detail

    Single send + Resend webhook timeline.

Insights + agents

  • recent_insights

    What the agents surfaced in the last batch.

  • approve_insight

    Move from proposed → approved.

  • dismiss_insight

    Move from proposed → dismissed. Optional reason.

  • run_agent

    Trigger growth / onboarding / winback agent. Returns insight id.

  • run_lead_scoring

    Score every profile 0-100. Writes traits.leadScore.

  • run_pii_audit

    Scan events + traits + templates for PII patterns.

Settings

  • get_brand_voice

    Persona, tone, do-not-use list, examples.

  • update_brand_voice

    Partial updates supported.

  • update_ai_budget

    Set 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/audit to 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.