Integration & API•
5 min read
•
Nov 25, 2026

RubiConnect MCP Integration Guide

Comprehensive developer guide for connecting Claude, Google Cloud Connected Apps, ChatGPT, Cursor, and custom AI agents to the RubiConnect MCP Server with OAuth 2.1 (S256 PKCE) and granular Read-Only (mcp:read) vs Full Access (mcp) scopes.

The Model Context Protocol (MCP) server allows external AI assistants and enterprise agent platforms (such as Claude Desktop, Claude.ai, Google Cloud Connected Apps / Gemini Enterprise, ChatGPT, and Cursor) to securely read context from and trigger messaging actions within your RubiConnect workspace.

All tool executions and resource reads are strictly isolated to your authenticated accountId and support OAuth 2.1 with Least-Privilege Scopes (`mcp:read` vs `mcp`) as well as standard Developer API Keys.

1. Connection, OAuth 2.1 & Least-Privilege Scopes

RubiConnect supports three authentication and connection modes:

  1. OAuth 2.1 with Dynamic Client Registration (RFC 7591) & Interactive Consent — Zero-manual-key onboarding for enterprise ecosystems (Google Cloud Connected Apps / Gemini Enterprise, Claude Connectors, Smithery, and MCP registries) with mandatory S256 PKCE and interactive Read-Only vs Full Access user consent.
  2. OAuth 2.1 API-Key Connector Bridge — Point-and-click browser OAuth flow where your RubiConnect API Key (rc_live_...) serves directly as the OAuth client_id.
  3. Direct Header Authentication — Pass Authorization: Bearer <API_KEY_OR_OAUTH_TOKEN> or X-Rubi-Key: <API_KEY> directly on HTTP SSE and JSON-RPC POST requests (ideal for Cursor IDE and Python/Node.js SDKs).

Endpoint & Discovery Directory

Setting
URL / Value
Description
MCP SSE & JSON-RPC Endpointhttps://console.rubiconnect.com/api/mcpPrimary Model Context Protocol SSE stream (GET) & JSON-RPC message endpoint (POST)
OAuth 2.1 Discovery (RFC 8414)https://console.rubiconnect.com/.well-known/oauth-authorization-serverMachine-readable OAuth 2.1 metadata (also mirrored at /.well-known/openid-configuration)
Dynamic Client Registrationhttps://console.rubiconnect.com/api/oauth/registerRFC 7591 endpoint issuing client_... IDs for none (PKCE) and client_secret_post/basic clients
OAuth 2.1 Authorization URLhttps://console.rubiconnect.com/en/authorizeAuthorization Code endpoint enforcing mandatory S256 PKCE (RFC 9700)
Interactive Consent Screenhttps://console.rubiconnect.com/en/authorize/consentWorkspace login & scope selector (Read-Only mcp:read vs Full Access mcp)
OAuth 2.1 Token URLhttps://console.rubiconnect.com/api/oauth/tokenSingle-use transactional code exchange issuing scoped rc_oauth_... Bearer tokens
Token Revocation (RFC 7009)https://console.rubiconnect.com/api/oauth/revokeImmediately invalidates issued OAuth access tokens (rc_oauth_...)
Direct Header AuthAuthorization: Bearer <TOKEN> or X-Rubi-Key: <API_KEY>Accepted on all /api/mcp SSE and JSON-RPC POST requests

OAuth 2.1 Scopes & Access Levels

RubiConnect implements granular OAuth 2.1 scopes so users and administrators can grant AI agents least-privilege access:

Scope
Access Level
Exposed MCP Tools
Subscribable Resources
Write Protection
mcp:readRead-Only Access16 Read-Only Tools (discovery, capability checks, inbox/transcripts, template/campaign/flow inspection, analytics, stock media & docs search)messages://inbox, messages://{recipient}Hides & blocks all 10 Write Tools on /api/mcp and rejects REST write calls with HTTP 403 (insufficient_scope)
mcp (or mcp:write)Full Read & Write AccessAll 26 Tools (16 Read-Only + send_message, create_template, manage_templates, submit_template_to_meta, create_campaign, create_flow, update_flow, clone_flow, delete_flow, trigger_flow)messages://inbox, messages://{recipient}Full workspace messaging, template authoring & folder organization, Meta submission, flow authoring/dispatch & campaign dispatch (audit-logged)
Interactive User Choice & Anti-Escalation: During browser authorization at /en/authorize/consent, users can choose between Read-Only Access (`mcp:read`) and Full Access (`mcp`) before approving a connection. If an external app explicitly requests scope=mcp:read, the consent screen locks to Read-Only so permissions can never be escalated beyond what the client requested.

2. Client Configurations

2.1 Google Cloud Connected Apps / Gemini Enterprise (OAuth 2.1 + DCR)

RubiConnect natively satisfies Google Cloud Connected Apps and Gemini Enterprise OAuth 2.1 security requirements:

  • MCP Server Endpoint: https://console.rubiconnect.com/api/mcp
  • Discovery Metadata: https://console.rubiconnect.com/.well-known/oauth-authorization-server
  • Dynamic Client Registration: https://console.rubiconnect.com/api/oauth/register
  • PKCE Method: S256 (mandatory; plain and missing code_challenge requests are rejected)
  • Supported Scopes: Request mcp:read for read-only workspace intelligence, or mcp to let the authorizing user choose between Read-Only (mcp:read) and Full Access (mcp) on the RubiConnect consent screen.

Whether you are using Claude Desktop on macOS/Windows or Claude.ai in your browser, Anthropic provides a point-and-click Connector interface powered by OAuth 2.1 with PKCE:

  1. In Claude Desktop or Claude.ai, navigate to Settings > Connectors > Add Custom Connector.
  2. Enter the Server URL:
text
   https://console.rubiconnect.com/api/mcp
  1. Authentication:
    • If Claude performs automatic OAuth 2.1 Dynamic Client Registration via /.well-known/oauth-authorization-server, click Connect — your browser will open /en/authorize/consent where you sign in and select Read-Only (`mcp:read`) or Full Access (`mcp`).
    • If prompted manually for OAuth credentials, paste your RubiConnect API Key (rc_live_...) as Client ID and leave Client Secret blank (PKCE does not require a static secret).
  2. Once authorized, RubiConnect exposes the 16 read-only tools (for mcp:read) or all 26 messaging, template, flow, campaign, analytics, and documentation tools (for mcp) in your Claude sessions.

2.3 OpenAI Custom GPTs & Enterprise Agent Platforms

To connect RubiConnect to ChatGPT Custom GPTs or enterprise orchestrators (Flowise, LangChain, Relevance AI, Zapier Central):

  1. In the action/connector editor, select OAuth:
    • Client ID: Obtain via POST /api/oauth/register (client_...) or enter your RubiConnect API Key (rc_live_...).
    • Client Secret: Client secret returned by /api/oauth/register (or leave empty when using S256 PKCE public client mode).
    • Authorization URL: https://console.rubiconnect.com/en/authorize
    • Token URL: https://console.rubiconnect.com/api/oauth/token
    • Scope: mcp:read (for read-only analytics/inbox agents) or mcp (for full read & write agents).
    • PKCE: S256 (required).
  2. Import the MCP server (https://console.rubiconnect.com/api/mcp) or OpenAPI 3.0 schema (https://console.rubiconnect.com/openapi.json).

2.4 Claude Desktop JSON File (claude_desktop_config.json) — Alternative Stdio Bridge

If you prefer configuring Claude Desktop manually via claude_desktop_config.json on disk rather than the in-app OAuth UI, use mcp-remote to bridge local stdio to RubiConnect's remote SSE endpoint:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{
  "mcpServers": {
    "rubiconnect": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://console.rubiconnect.com/api/mcp",
        "--header",
        "Authorization:Bearer ${RUBI_API_KEY}"
      ],
      "env": {
        "RUBI_API_KEY": "rc_live_your_actual_api_key_token"
      }
    }
  }
}
Syntax Note: The --header parameter must be formatted as "Authorization:Bearer ${RUBI_API_KEY}" with no space after the colon. You can supply either a full-access API key (rc_live_...) or a scoped OAuth token (rc_oauth_...).
macOS GUI PATH Resolution: GUI apps on macOS do not load .zshrc PATH automatically. If Claude reports command not found: npx, use the absolute binary path (/opt/homebrew/bin/npx on Apple Silicon or /usr/local/bin/npx on Intel Mac).

Alternative: Bundled Node.js Bridge Script

RubiConnect also includes a standalone bridge script at scripts/claude-mcp-bridge.mjs:

json
{
  "mcpServers": {
    "rubiconnect": {
      "command": "node",
      "args": ["/absolute/path/to/RubiConnect platform/scripts/claude-mcp-bridge.mjs"],
      "env": {
        "RUBI_API_KEY": "rc_live_your_actual_api_key_token"
      }
    }
  }
}

2.5 Cursor IDE

Cursor natively supports remote Server-Sent Events (SSE) MCP servers without any local bridge:

  1. Open Cursor Settings (Cmd + , or Ctrl + ,) > Features > MCP.
  2. Click + Add New MCP Server and enter:
    • Name: rubiconnect
    • Type: SSE
    • URL: https://console.rubiconnect.com/api/mcp
    • Headers: {"Authorization": "Bearer rc_live_your_actual_api_key_token"} (or {"X-Rubi-Key": "rc_live_your_actual_api_key_token"})
  3. Cursor connects immediately and displays a green status indicator alongside the negotiated tools.

2.6 Python SDK Connection

Using the official Python mcp library (pip install mcp):

python
import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main():
    headers = {"Authorization": "Bearer rc_live_your_actual_api_key_token"}
    async with sse_client("https://console.rubiconnect.com/api/mcp", headers=headers) as (read_stream, write_stream):
        async with ClientSession(read_stream, write_stream) as session:
            await session.initialize()

            # List available tools (16 tools for mcp:read, 26 tools for mcp)
            tools = await session.list_tools()
            print("Available Tools:", len(tools.tools))

            # Retrieve active messaging agents
            result = await session.call_tool("list_agents", {})
            print("Agents:", result.content[0].text)

asyncio.run(main())

2.7 Node.js SDK Connection

Using the official JavaScript @modelcontextprotocol/sdk package:

javascript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

async function main() {
  const transport = new SSEClientTransport(
    new URL("https://console.rubiconnect.com/api/mcp"),
    {
      headers: {
        "Authorization": "Bearer rc_live_your_actual_api_key_token"
      }
    }
  );

  const client = new Client(
    { name: "rubiconnect-mcp-client", version: "1.0.0" },
    { capabilities: {} }
  );

  await client.connect(transport);

  const { tools } = await client.listTools();
  console.log(`Discovered ${tools.length} tools`);

  const agentsResponse = await client.callTool({
    name: "list_agents",
    arguments: {}
  });
  console.log("Agents:", agentsResponse.content[0].text);
}

main();

2.8 Google Gemini API Integration (Function Calling)

Expose RubiConnect tools to Gemini models using the official @google/genai SDK:

javascript
import { GoogleGenAI } from "@google/genai";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

async function main() {
  const transport = new SSEClientTransport(
    new URL("https://console.rubiconnect.com/api/mcp"),
    {
      headers: {
        "Authorization": "Bearer rc_live_your_actual_api_key_token"
      }
    }
  );
  const client = new Client({ name: "gemini-mcp-agent", version: "1.0.0" }, { capabilities: {} });
  await client.connect(transport);

  const { tools } = await client.listTools();
  const geminiTools = tools.map((tool) => ({
    functionDeclarations: [{
      name: tool.name,
      description: tool.description,
      parameters: tool.inputSchema
    }]
  }));

  const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
  const response = await ai.models.generateContent({
    model: 'gemini-2.5-flash',
    contents: 'List my active messaging agents, please.',
    config: { tools: geminiTools }
  });

  const call = response.functionCalls?.[0];
  if (call) {
    const result = await client.callTool({ name: call.name, arguments: call.args });
    console.log("MCP Execution Result:", result.content[0].text);
  } else {
    console.log("Gemini Response:", response.text);
  }
}

main();

3. Complete Tools Reference Directory (26 Tools)

The MCP server exposes 26 production tools partitioned into 16 Read-Only tools (available with mcp:read or mcp) and 10 Write tools (require mcp or mcp:write scope, or a full-access API key):

System & Health

get_server_status — Read-Only (`mcp:read`)

Retrieve real-time health status, supported messaging channels, and MCP protocol version for the RubiConnect server.

  • Input Schema: object (no parameters required)
  • Output Format: Health status object containing status, serverName, version, protocolVersion, supportedChannels, and timestamp.

Brand Identities & Agents

list_agents — Read-Only (`mcp:read`)

Retrieve active messaging agent profiles (RCS & WhatsApp) registered to the account.

  • Input Schema: object (no required parameters)
  • Output Format: Array of agent profiles containing id, displayName, type ("RCS" | "WHATSAPP"), status, highLevelStatus, launchStatus, and phoneNumber.

get_agent_profile — Read-Only (`mcp:read`)

Retrieve detailed configuration, verification status, webhook endpoints, and supported channel capabilities for a specific agent profile.

  • Parameters:
    • agentId (string, optional): Unique agent profile identifier (uses active agent from context if omitted).
  • Output Format: Detailed agent object including Sinch/Meta verification metadata, webhooks, and channel attributes.

Messaging & Transcripts

check_capability — Read-Only (`mcp:read`)

Checks whether a recipient's phone number is capable of receiving rich messages (RCS or WhatsApp) on a specified agent profile.

  • Parameters:
    • recipient (string, required): Recipient phone number in E.164 format (e.g. "+447822857257").
    • agentId (string, optional): Agent identifier to verify against (uses active agent from context if omitted).
  • Output Format: { recipient, channel: "RCS"|"WHATSAPP", isRcs, status, features }

send_message — Write (`mcp` / `mcp:write`)

Sends a rich or text message to a single recipient OR streams a zero-persistence bulk broadcast directly from a remote HTTPS CSV/JSONL URL across RCS and WhatsApp.

  • Parameters:
    • recipient (string, conditional): Phone number of the recipient in E.164 format (required for single send).
    • contactsUrl (string, conditional): Pre-signed HTTPS CSV or JSONL URL to stream contacts from with zero database persistence.
    • urlFormat (string, optional): Format of contactsUrl ("csv" or "jsonl", default "csv").
    • agentId (string, optional): Unique ID of the sending agent profile (uses active agent if omitted).
    • text (string, optional): Text message content.
    • mediaUrl (string, optional): Public URL of image, video, or PDF media to send.
    • templateId (string, optional): Pre-configured template ID reference.
    • allowSmsFallback (boolean, optional): Fall back to SMS if recipient lacks RCS capability (default false).
    • suggestions (array of objects, optional): List of interactive buttons (max 4). Each object contains:
      • type (string, required): "reply", "url", or "phone".
      • text (string, required): Label shown on the button (max 25 chars).
      • value (string, optional): Action value (URL for "url", phone number for "phone", or custom postback payload for "reply").
    • idempotencyKey (string, optional): Client-generated unique key (up to 255 chars, e.g. UUID) to make tool retries safe. Reusing the same key with the same parameters within 24 hours returns the cached response (idempotencyReplayed: true) without sending a duplicate message.
  • Output Format: Status object returning messageId (for single send) or broadcastId and status: "streaming" (for remote URL broadcasts).

get_inbox_messages — Read-Only (`mcp:read`)

Retrieve recent incoming and outgoing inbox messages and chat logs for an agent profile.

  • Parameters:
    • agentId (string, optional): Agent profile identifier (uses active agent if omitted).
    • limit (number, optional): Number of messages to return (max 100, default 20).
    • senderType (string, optional): Filter by "user" (outbound), "contact" (inbound customer replies), or "all" (default "all").
  • Output Format: Object containing agentId, agentName, totalMessages, and messages array (id, recipient, sender, content, status, contactName, date).

get_conversation_history — Read-Only (`mcp:read`)

Retrieves chronologically sorted back-and-forth chat messages and transcripts for a specific customer phone number.

  • Parameters:
    • recipient (string, required): Customer phone number in E.164 format.
    • agentId (string, optional): Agent profile identifier (uses active agent if omitted).
    • limit (number, optional): Number of message turns to return (max 100, default 20).
  • Output Format: Object containing recipient, agentId, totalMessages, and chronological messages array.

Message Templates

list_templates — Read-Only (`mcp:read`)

Retrieves pre-configured rich media, card, carousel, and text message templates AND template folders for an agent profile.

  • Parameters:
    • agentId (string, optional): Agent ID or display name (uses active agent if omitted).
    • folderId / folderName (string, optional): Filter templates inside a specific template folder (folderId: "root" returns only root templates).
  • Output Format: { totalTemplates, folders, templates } where each template includes id, name, type, text, folderId, folderName, createdAt, and metaStatus.

get_template_detail — Read-Only (`mcp:read`)

Retrieves the full structural layout, folder placement (folderId, folderName), variable placeholders, orientation, and button action payloads for a specific message template.

  • Parameters:
    • templateIdentifier (string, required): Unique ID or name of the template to retrieve.
    • agentId (string, optional): Agent identifier (uses active agent if omitted).
  • Output Format: Complete template entity with card structures, media URLs, folder placement, and button configurations.

create_template — Write (`mcp` / `mcp:write`)

Create a message template in the account library (optionally organized inside a template folder via folderName or folderId). Supports rich standalone cards (image/video, title, text, buttons), carousels, media, and plain text. For WhatsApp agents, validates Meta formatting rules before saving as a workspace draft (or optionally submitting immediately to Meta).

  • Parameters:
    • name (string, required): Unique name of the template (lowercase, numbers, and underscores for WhatsApp).
    • text (string, required): Main message content or card description. Supports placeholders like {{name}} or {{1}}.
    • agentId (string, optional): Associated agent ID or name.
    • folderName / folderId (string, optional): Template folder placement (auto-creates folderName if needed).
    • type (string, optional): "card", "text", "media", or "carousel".
    • title (string, optional): Headline for rich card templates.
    • mediaUrl (string, optional): Optional image, video, or document URL for the header.
    • cardOrientation (string, optional): "VERTICAL" (default) or "HORIZONTAL".
    • mediaHeight (string, optional): "SHORT", "MEDIUM" (default), or "TALL".
    • category (string, optional): Meta template category for WhatsApp agents ("MARKETING", "UTILITY", "AUTHENTICATION", default "MARKETING").
    • language (string, optional): Language code for WhatsApp templates, e.g. "en_US", "es_ES" (default "en_US").
    • footer (string, optional): Optional footer text (up to 60 characters on WhatsApp).
    • submitToMeta (boolean, optional): For WhatsApp agents: whether to submit immediately to Meta Graph API (default false — draft-first mode).
    • suggestions (array of objects, optional): Interactive buttons ("reply", "url", "phone", "copy_code", "flow").
  • Output Format: Status object confirming success, templateId, folderId, folderName, metaTemplateName, and metaStatus.

manage_templates — Write (`mcp` / `mcp:write`)

Organizes existing message templates and manages template folders (template_folders): batch-moves one or multiple templates into a folder (auto-creating the folder if needed) or back to root, creates/renames/deletes template folders, or renames/deletes templates. Destructive actions (delete_folder, delete_template) require confirm: true.

  • Parameters:
    • action (string, optional): "move_templates" (default), "create_folder", "rename_folder", "delete_folder", "rename_template", or "delete_template".
    • templateIdentifiers / templateIdentifier (array of strings / string, conditional): Template names or IDs to move, rename, or delete.
    • folderName / folderIdentifier (string, conditional): Target or existing template folder name/ID.
    • moveToRoot (boolean, optional): Move template(s) out of folders back to root.
    • newName (string, conditional): New name for rename_template or rename_folder.
    • deleteTemplatesInFolder (boolean, optional): When false (default on delete_folder), safely moves templates back to root; when true, deletes templates inside the folder.
    • confirm (boolean, conditional): Required true for "delete_folder" and "delete_template".
  • Output Format: Action status object with folderId, folderName, movedCount, or folder/template mutation summary.

submit_template_to_meta — Write (`mcp` / `mcp:write`)

Submits an existing WhatsApp template from the account library to Meta Graph API for official review and approval.

  • Parameters:
    • templateIdentifier (string, required): The name or document ID of the template to submit.
    • agentId (string, optional): Associated WhatsApp agent ID (uses active agent if omitted).
    • category (string, optional): Meta template category ("MARKETING", "UTILITY", or "AUTHENTICATION", default "MARKETING").
    • language (string, optional): Language code for WhatsApp templates, e.g. "en_US" (default "en_US").
  • Output Format: Status object returning success, templateId, channel: "WHATSAPP", metaTemplateName, metaCategory, metaLanguage, and metaStatus ("PENDING", "APPROVED", or "REJECTED_VALIDATION").

Campaigns & Broadcasts

list_campaigns — Read-Only (`mcp:read`)

List recent messaging campaigns with live delivery status and summary metrics.

  • Parameters:
    • agentId (string, optional): Filter campaigns by sending agent profile.
    • limit (number, optional): Maximum number of campaigns to return (default 20, max 50).
  • Output Format: Array of campaign summaries (id, name, status, recipientSource, stats, createdAt).

get_campaign_status — Read-Only (`mcp:read`)

Retrieve real-time delivery status, sent, delivered, read, and failed counts for a campaign or streaming broadcast.

  • Parameters:
    • campaignId (string, required): Unique campaign identifier.
    • agentId (string, optional): Agent identifier to scope query.
  • Output Format: Object containing id, name, status, recipientSource, and stats: { sent, delivered, read, failed }.

get_campaign_performance — Read-Only (`mcp:read`)

Retrieves in-depth analytical performance for a campaign, including delivery rate, read rate, replies, and unique engaged recipients.

  • Parameters:
    • campaignId (string, required): Unique campaign identifier.
    • agentId (string, optional): Agent identifier (uses active agent if omitted).
  • Output Format: Performance breakdown (totalSent, delivered, read, replied, failed, uniqueRecipients, uniqueEngagedUsers, deliveryRate, readRate).

create_campaign — Write (`mcp` / `mcp:write`)

Create and dispatch an outbound messaging campaign targeting stored contacts or streaming from a remote HTTPS CSV/JSONL URL with zero database persistence.

  • Parameters:
    • name (string, required): Descriptive name of the campaign.
    • agentId (string, optional): Agent ID to send the campaign from (uses active agent if omitted).
    • recipients (array of strings, optional): Explicit array of recipient phone numbers in E.164 format.
    • contactsUrl (string, conditional): Pre-signed HTTPS CSV/JSONL URL to stream contacts from.
    • urlFormat (string, optional): Format of contactsUrl ("csv" or "jsonl", default "csv").
    • recipientSource (string, optional): Audience source ("contacts" or "remote_url").
    • contactListName (string, optional): Stored contact list name in workspace.
    • text (string, optional): Main campaign message content.
    • templateId (string, optional): Pre-configured template ID reference.
    • flowId (string, optional): Interactive flow ID reference.
    • sendNow (boolean, optional): Immediately queue and stream broadcast in the background (default true; pass false to save as "Draft" for manual console review before sending).
    • allowSmsFallback (boolean, optional): Enable SMS fallback for non-RCS recipients (default false).
  • Output Format: Status object with campaignId, status ("Sending" or "Draft"), recipientSource, and channel.

Conversation Flows

list_flows — Read-Only (`mcp:read`)

Lists all conversation flows and flow folders configured for an agent profile, including validation status (Valid/Draft), step counts, folder assignments, and trigger types.

  • Parameters:
    • agentId (string, optional): Agent ID or display name (uses active agent if omitted).
    • folderId / folderName (string, optional): Filter flows inside a specific folder.
    • status (string, optional): "Valid", "Draft", or "ALL".
  • Output Format: { agentId, agentName, totalFlows, folders, flows }

get_flow_detail — Read-Only (`mcp:read`)

Retrieves the complete ReactFlow graph (nodes, edges), referenced templates, step-by-step summary, and live validation check for a specific flow.

  • Parameters:
    • flowIdentifier (string, required): Name or unique ID of the flow.
    • agentId (string, optional): Agent ID or display name.
  • Output Format: Complete flow object with nodes, edges, steps, referencedTemplates, isValid, validationErrors, and flowSummary.

create_flow — Write (`mcp` / `mcp:write`)

Creates a new multi-step conversation flow on the ReactFlow canvas. Automatically creates any inline rich card/carousel/text templates (data.inlineTemplate), normalizes sourceHandle branches, arranges visual node coordinates, and validates all branches.

  • Parameters:
    • name (string, required): Human-readable name for the flow.
    • description (string, optional): Short summary of what the flow does.
    • agentId (string, optional): Target agent ID or display name.
    • folderName / folderId (string, optional): Folder placement (auto-creates folderName if needed).
    • nodes (array, required): Flow step nodes (start, sendText, sendCard, sendCarousel, sendMedia, userInput, decision, delay, waitUntil, setVariable, webhook, connector, ai, aiChatbot, gotoFlow, end).
    • edges (array, required): Directed edges connecting source + sourceHandle to target.
    • autoLayout (boolean, optional): Automatically arrange node coordinates top-to-bottom.
  • Output Format: { success, flowId, name, status, isValid, validationErrors, createdTemplates, flowSummary }

update_flow — Write (`mcp` / `mcp:write`)

Modifies an existing conversation flow using targeted patches (upsertNodes, removeNodeIds, upsertEdges, removeEdgesFrom, textReplacements, mediaReplacements, name, folderName) or full nodes/edges replacement.

  • Parameters:
    • flowIdentifier (string, required): Name or ID of the flow to modify.
    • upsertNodes / removeNodeIds / upsertEdges / removeEdgesFrom (optional): Incremental graph patch operations.
    • nodes / edges (optional): Full graph replacement arrays.
    • textReplacements (array of { find, replace }, optional): Find/replace copy across flow steps.
    • mediaReplacements (array of { nodeId?, findUrl?, cardIndex?, newMediaUrl }, optional): Swap media fileUrls on flow steps and newly cloned rich card/carousel templates without mutating shared templates.
  • Output Format: { success, flowId, name, status, isValid, validationErrors, createdTemplates, flowSummary }

clone_flow — Write (`mcp` / `mcp:write`)

Uses an existing conversation flow as a starting point to create a new adapted flow within the same agent or across agents in the account, optionally cloning referenced templates (cloneReferencedTemplates: true) so the source flow's templates remain untouched.

  • Parameters:
    • sourceFlowIdentifier (string, required): Name or ID of the existing source flow.
    • newName (string, required): Name for the new flow.
    • sourceAgentId / agentId (string, optional): Source and target agent identifiers.
    • folderName / folderId (string, optional): Target folder placement (auto-creates folderName if needed).
    • cloneReferencedTemplates (boolean, optional): Deep-copy referenced templates for independent editing.
    • textReplacements (array of { find, replace }, optional): Adapt copy across nodes and cloned templates.
    • mediaReplacements (array of { nodeId?, findUrl?, cardIndex?, newMediaUrl }, optional): Replace card/carousel/media image URLs across cloned templates while keeping source templates untouched.
    • upsertNodes / removeNodeIds / upsertEdges (optional): Structural customizations applied on top of the cloned graph.
  • Output Format: { success, flowId, sourceFlowId, sourceFlowName, name, status, isValid, clonedTemplates, flowSummary }

delete_flow — Write (`mcp` / `mcp:write`)

Deletes a conversation flow or manages flow folders (create_folder, rename_folder, delete_folder). Destructive operations require confirm: true after explicit user confirmation.

  • Parameters:
    • action (string, optional): "delete_flow" (default), "create_folder", "rename_folder", or "delete_folder".
    • flowIdentifier / folderIdentifier / folderName (string, conditional): Target flow or folder identifier.
    • confirm (boolean, conditional): Required true for "delete_flow" and "delete_folder".

trigger_flow — Write (`mcp` / `mcp:write`)

Starts/dispatches an existing conversation flow for a recipient phone number in E.164 format.

  • Parameters:
    • flowIdentifier (string, required): Name or ID of the flow to start.
    • recipient (string, required): E.164 phone number (e.g. "+447700900123").
    • agentId (string, optional): Sending agent ID or display name.
    • initialVariables (object, optional): Key-value variables injected into {{variable}} context.
  • Output Format: { success, flowId, flowName, recipient, message, flowSummary }

Analytics & Media

get_message_stats — Read-Only (`mcp:read`)

Retrieves message volume, delivery rates, read receipts, SMS fallbacks, and inbound engagement breakdowns over an ISO date range.

  • Parameters:
    • startDate (string, required): ISO date string (YYYY-MM-DD) for the start of the period.
    • endDate (string, required): ISO date string (YYYY-MM-DD) for the end of the period.
    • agentId (string, optional): Agent identifier (uses active agent if omitted).
  • Output Format: Aggregate metrics (total, sent, received, delivered, read, failed, smsFallback, uniqueRecipients, uniqueEngagedUsers, inboundBreakdown).

search_images — Read-Only (`mcp:read`)

Queries royalty-free stock photography (Pixabay) matching a search query for message cards, carousels, and rich templates.

  • Parameters:
    • query (string, required): Search terms (e.g. "coffee", "summer sale").
    • index (number, optional): 0-based index to pick a specific image from the results (default 0).
  • Output Format: Object containing url (proxied image URL ready for cards/templates) and success boolean.

Knowledge & Documentation

search_documentation — Read-Only (`mcp:read`)

Searches official RubiConnect documentation, user guides, API references, character limits, console navigation, and feature how-to guides to ground AI agent responses in verified platform rules.

  • Parameters:
    • query (string, required): Search query or keywords (e.g. "character limits for cards", "OAuth read-only scope", "SMS fallback configuration").
    • topic (string, optional): Optional topic filter ("GENERAL", "DEVELOPER_API", "MCP", "CONSOLE_UI", "RCS_SPECS", or "BILLING").
  • Output Format: Object containing query and an array of top matching results with source, heading, and snippet.

4. Resources & Real-Time Subscriptions

The MCP server exposes workspace resources (accessible under both mcp:read and mcp scopes) that connected AI clients can list, read, and subscribe to over SSE:

messages://inbox (Static Resource URI)

Contains the 20 most recent workspace messages (incoming customer replies and outbound messages).

  • MIME Type: application/json
  • Format: JSON array containing id, recipient, content, status, and date.

messages://{recipient} (Dynamic Resource Template)

Exposes a parameterized chat log stream for any specific customer phone number in international E.164 format (e.g. messages://+447822857257).

  • MIME Type: application/json
  • Template Parameter: recipient (string, required, E.164 phone number).

Real-Time Update Notifications

Connected MCP client agents can subscribe to messages://inbox:

  1. When a contact replies or taps an interactive quick-reply chip, the carrier delivers the inbound event to RubiConnect.
  2. The MCP Server immediately broadcasts a JSON-RPC notifications/resources/updated event (uri: "messages://inbox") over active SSE streams for that tenant.
  3. The AI client calls resources/read to fetch the new reply and continue the workflow in real time.

5. Rate-Limiting, Session Lifecycle & Security

  • Least-Privilege Read-Only Enforcement (`mcp:read`): Tokens authorized with mcp:read only see the 16 read-only tools in tools/list. Direct tools/call invocations of any write tool (send_message, create_template, manage_templates, submit_template_to_meta, create_campaign, create_flow, update_flow, clone_flow, delete_flow, trigger_flow) are rejected at the execution boundary, and REST write calls (POST /api/v1/messages/send, POST /api/v1/campaigns, POST /api/flows/start) return HTTP 403 with WWW-Authenticate: Bearer error="insufficient_scope", scope="mcp".
  • OAuth 2.1 Cryptographic Protections: Authorization requests enforce mandatory S256 PKCE challenges, exact-string redirect_uri verification against registered URIs, single-use transactional authorization codes (10-minute TTL), and instant token revocation via POST /api/oauth/revoke.
  • Token-Bucket Rate Limiting: Every MCP request consumes 1 token from the key's Token Bucket capacity and returns X-RateLimit-Limit / X-RateLimit-Remaining headers (HTTP 429 Too Many Requests with Retry-After when exhausted).
  • SSE Session Lifecycle & Automatic Rehydration: Idle SSE connections automatically close after 2 minutes of inactivity to conserve cloud resources. If a subsequent JSON-RPC POST arrives with a valid Bearer credential and mcp-session-id after an idle disconnect or serverless instance scale-out, RubiConnect transparently rehydrates the session without dropping the tool call.
  • Action Audit Trail & Draft Safety: Every execution of a write/action tool (isAction: true) writes a tenant-scoped MCP_TOOL_EXECUTED entry to your workspace audit log. WhatsApp templates created via create_template default to submitToMeta: false (draft-first mode), and campaigns created via create_campaign support sendNow: false to stage a "Draft" campaign for manual console review before dispatch.
  • Idempotent Retries (`send_message` & `POST /api/v1/messages/send`): Pass an optional idempotencyKey argument to send_message (or Idempotency-Key header / idempotencyKey body field on POST /api/v1/messages/send) so retried requests within 24 hours return the original messageId or broadcastId without texting the recipient twice. Keys are isolated per accountId, return an in-progress conflict (IDEMPOTENCY_KEY_IN_PROGRESS / HTTP 409) during concurrent retries, reject payload mismatches (IDEMPOTENCY_KEY_PAYLOAD_MISMATCH / HTTP 422), and release cleanly if dispatch fails.

6. Platform Integrations (Salesforce Agentforce, HubSpot, Shopify)

External CRM and e-commerce platforms can consume the RubiConnect MCP server to allow their native AI agents to inspect conversations or trigger communications.

Salesforce Agentforce & Einstein Copilot

  1. Named Credentials: Configure an OAuth 2.1 or API-Key Named Credential in Salesforce Setup targeting https://console.rubiconnect.com/api/mcp (use scope mcp:read for read-only support copilots or mcp for outbound outreach agents).
  2. Agent Actions: Expose check_capability, get_conversation_history, list_flows, trigger_flow, send_message, or create_campaign to Agentforce / Einstein Copilot.

HubSpot Breeze & AI Agents

  1. Custom Workflow Extensions: Connect HubSpot Breeze agents or custom workflow actions to /api/mcp or /api/v1/messages/send.
  2. Automated Outreach & Flows: When a CRM lifecycle stage changes (e.g. Lead Status becomes "Contacted"), invoke trigger_flow to enroll the contact in an interactive multi-step RCS/WhatsApp flow, or send_message to deliver a branded card or approved WhatsApp template.

Shopify AI Agents & Flow

  1. Order & Cart Events: Connect e-commerce AI support agents (with mcp:read for order/inbox lookup or mcp for proactive notifications).
  2. Interactive Recovery: Invoke send_message to dispatch rich RCS carousels or WhatsApp utility updates directly to the shopper's handset.