Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Customer.io MCP server

Vendor MCP
Open markdown

The Customer.io MCP connector routes your AI agent's tool calls to Customer.io's own MCP server through Scalekit. Each user signs in to Customer.io once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 9 tools.

Tools
9
What they doRead · write · destructive
6 · 1 · 26 read1 write2 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Customer.io MCP connection

    In AgentKit > Connections, create a Customer.io MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Customer.io MCP server, so you don't need to register an OAuth app. To show your own app on the consent screen, use your own credentials instead.

    Use your own OAuth app

    Customer.io MCP uses Dynamic Client Registration (DCR) — no client ID or secret is required. The only step is creating a connection in Scalekit and authorizing your Customer.io account.

    1. Create a connection in Scalekit

      • In the Scalekit dashboard, go to AgentKit → Connections → Create Connection.
      • Search for Customer.io MCP and click Create.
      • Note the Connection name — use this as connection_name in your code (e.g., customeriomcp).
    2. Authorize your Customer.io account

      Generate an authorization link and open it in a browser to complete the Customer.io OAuth flow.

      The user is redirected to Customer.io to sign in and grant access. Scalekit stores the token and injects it automatically into every tool call — no further configuration is needed.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'customeriomcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Customer.io MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'customeriomcp_cio_auth_status',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • customeriomcp_cio_auth_statusShow the active authentication state — authenticated user, account, and accessible workspaces.Read-only

    Cio Auth Status

    Show the active authentication state — authenticated user, account, and accessible workspaces. Call this to verify which Customer.io account is connected.

    Inputs

    This tool takes no inputs.

  • customeriomcp_cio_primePrint LLM-ready instructions for using the Customer.io API.Read-only

    Cio Prime

    Print LLM-ready instructions for using the Customer.io API. Call this first in a new task to load context about available endpoints and best practices.

    Inputs

    This tool takes no inputs.

  • customeriomcp_cio_read_apiRead from the Customer.io API (GET only).Read-only

    Cio Read Api

    Read from the Customer.io API (GET only). Use cio_schema first to find the correct path. Supports pagination, jq filtering, and dry_run preview.

    Inputs

    pathstringrequired
    API path including placeholders, e.g. '/v1/environments/{environment_id}/campaigns'. Placeholders are substituted from params.
    dry_runboolean
    Validate and return the request without executing it.
    jqstring
    gojq expression to filter the response before returning. Use to trim large responses.
    limitnumber
    Page size.
    pagenumber
    Page number (1-indexed).
    page_allboolean
    Auto-paginate and return NDJSON for the full dataset.
    paramsobject
    Parameters object. Keys matching path placeholders are substituted; remaining keys become the query string.
  • customeriomcp_cio_schemaIntrospect the Customer.io API schema to discover endpoints, parameters, and response shapes.Read-only

    Cio Schema

    Introspect the Customer.io API schema to discover endpoints, parameters, and response shapes. Use this before calling cio_read_api or cio_write_api to find the correct path and placeholders.

    Inputs

    querystring
    One of: '' (list resources), 'campaigns' (resource), 'campaigns.list' (resource.method), 'GET /v1/...' (method + path), or '/v1/...' (all methods for a path).
    refreshboolean
    Force re-download of API specs.
  • customeriomcp_cio_skills_listList available Customer.io agent skills — task-specific instruction manuals covering campaigns, segments, deliveries, analytics, and more.Read-only

    Cio Skills List

    List available Customer.io agent skills — task-specific instruction manuals covering campaigns, segments, deliveries, analytics, and more.

    Inputs

    refreshboolean
    Force re-download of skills.
  • customeriomcp_cio_skills_readRead the full content of a specific Customer.io agent skill by path.Read-only

    Cio Skills Read

    Read the full content of a specific Customer.io agent skill by path. Use cio_skills_list to find available paths (e.g. 'campaigns', 'fly-api/campaigns.md').

    Inputs

    pathstringrequired
    Skill path, e.g. 'campaigns' or 'campaigns/examples'. See cio_skills_list for available paths.
  • customeriomcp_cio_feedbackSend feedback about this Customer.io MCP server to the Customer.io team: a tool that did the wrong thing, missing or confusing docs, an unclear error.Write

    Cio Feedback

    Send feedback about this Customer.io MCP server to the Customer.io team: a tool that did the wrong thing, missing or confusing docs, an unclear error. Two steps. 1) Call without confirmation_token: nothing is sent; you get back the exact text we would send, with personal data and secrets removed, and a token. 2) Show the user that text word for word and ask if they want to send it. Only if they clearly say yes, call again with the message text from the preview, the same category and about_tool, the token and user_confirmed=true. Describe the problem, not the data: no people's emails, names, phone numbers, profile attributes, message content, API keys or tokens.

    Inputs

    categorystringrequired
    The kind of feedback.one of bugmissing_featureconfusing_docsother
    messagestringrequired
    What went wrong or what is missing, in plain words.
    about_toolstring
    The tool the feedback is about, if any, such as cio_write_api.
    confirmation_tokenstring
    Leave empty on the first call. On the second call, the token the first call returned.
    user_confirmedboolean
    Set to true only on the second call, after the user said yes to the exact text.
  • customeriomcp_cio_delete_apiDelete a resource via the Customer.io API (DELETE only).Destructive

    Cio Delete Api

    Delete a resource via the Customer.io API (DELETE only). Always run with dry_run=true first to preview before executing.

    Inputs

    accountstringrequired
    Name of the account this call changes. Use the name from the session instructions or cio_auth_status, after the user has confirmed it.
    pathstringrequired
    API path including placeholders, e.g. '/v1/environments/{environment_id}/campaigns/{campaign_id}'. Placeholders are substituted from params.
    workspacestringrequired
    Name of the workspace this call changes. For a route whose path names no workspace ({environment_id}, or {workspace_id} in a /cdp/api/workspaces route), name the workspace you are working in; only the account is checked. Use the name from the session instructions or cio_auth_status, after the user has confirmed it.
    bodyobject
    JSON request body as a nested object, for the DELETE routes that take one (cio_schema shows which). Omit it otherwise.
    jqstring
    gojq expression to filter the response before returning.
    paramsobject
    Parameters as a nested JSON object (pass the object directly; do not JSON-encode it as a string). Keys matching path placeholders are substituted; remaining keys become the query string.
    regionstring
    Optional. Region of the account: US or EU. When given, it is checked too. Use the name from the session instructions or cio_auth_status, after the user has confirmed it.

Workflows

Check authentication status

Use customeriomcp_cio_auth_status to verify the connection and see the authenticated user, account, and accessible workspaces.

const status = await actions.executeTool({
connector: 'customeriomcp',
identifier: 'user_123',
toolName: 'customeriomcp_cio_auth_status',
toolInput: {},
});
console.log(status);

Read campaign data

Use customeriomcp_cio_read_api to fetch campaigns from a Customer.io environment. Call customeriomcp_cio_schema first to discover the correct API path and available parameters.

const campaigns = await actions.executeTool({
connector: 'customeriomcp',
identifier: 'user_123',
toolName: 'customeriomcp_cio_read_api',
toolInput: {
path: '/v1/environments/{environment_id}/campaigns',
params: { environment_id: 'env_abc123' },
limit: 10,
},
});
console.log(campaigns);

Create a campaign

Use customeriomcp_cio_write_api to create a new campaign. Always set dry_run: true first to validate the request before executing.

// Step 1 — dry run to validate
const preview = await actions.executeTool({
connector: 'customeriomcp',
identifier: 'user_123',
toolName: 'customeriomcp_cio_write_api',
toolInput: {
path: '/v1/environments/{environment_id}/campaigns',
params: { environment_id: 'env_abc123' },
body: { name: 'Welcome Series', type: 'triggered' },
dry_run: true,
},
});
console.log(preview);
// Step 2 — execute after confirming dry run looks correct
const result = await actions.executeTool({
connector: 'customeriomcp',
identifier: 'user_123',
toolName: 'customeriomcp_cio_write_api',
toolInput: {
path: '/v1/environments/{environment_id}/campaigns',
params: { environment_id: 'env_abc123' },
body: { name: 'Welcome Series', type: 'triggered' },
},
});
console.log(result);