This integration path is designed for AI-driven environments. If you’re building a standard programmatic integration, use the Snappy REST API instead.
Prerequisites
Before connecting an AI system to the MCP server, make sure the following are configured in your Snappy Dashboard:- A valid Snappy user account (username, password, and optional TOTP)
- At least one Company and Account
- At least one Collection configured for your Account
- Recipients set up, or ready to be managed via API
How It Works
Your AI system connects to the Snappy MCP server and authenticates using user credentials. Once authenticated, it can call a set of structured tools to retrieve collections, generate personalized content, create campaigns, and send gifts - all through a standardized protocol.Authentication
The MCP server uses session-based authentication. Call thesign-in tool with your Snappy credentials to establish a session:
Available Tools
Tool examples
get-account-collections
create-campaign
The Gift Sending Flow
Regardless of which AI system you’re connecting, the gifting flow follows the same sequence:sign-in- authenticate and establish a sessionget-account-collections- retrieve available collectionscreate-email+create-greeting+choose-reveal- generate personalized content (these three can run in parallel)create-campaign- set up the campaign with recipients and contentsend-gifts- trigger the gift send
Quick Start: Adding to Your AI Agent (MCP Config)
To add Snappy to any MCP-compatible AI environment, point your MCP configuration to the Snappy server URL provided by your account manager:Worked Example: Node.js Bot
A complete Node.js example that handles a/sendgift chat command, authenticates, generates personalized content in parallel, and creates and sends a campaign.
Error Handling
Common error scenarios
Authentication failedsign-in with the totp argument populated.
Resource not found
Retry strategy
Use exponential backoff for transient failures (network errors, timeouts, 5xx). Do not retryAUTH_FAILED or NOT_FOUND.
Best Practices
Secure credentials. Never hardcode username, password, or TOTP. Pull them from environment variables or a secrets manager. When logging tool calls for observability, redactpassword and totp before writing.
Reuse sessions. Don’t call sign-in on every request. Cache the session and refresh only when expired:
create-email, create-greeting, and choose-reveal are independent - call them concurrently to cut latency.
Cache collections. Collection data changes infrequently. A 5-minute in-memory cache keyed by accountId is usually sufficient.
Troubleshooting
Check authentication status before debugging tool calls:get-account-collections and get-collection-products directly to verify the data exists before calling create-campaign.
For additional support, contact your Snappy account manager.