How It Works
The architecture is simple:- Host your agent as an HTTP service on a cloud platform
- Connect chat platforms via webhooks
- Messages flow: Chat app → Your server → Craft Agent → Response back
Step 1: Wrap Your Agent as an HTTP Service
Create a simple server that calls the Craft CLI:POST /chat { message } → { reply }
Step 2: Deploy to a Cloud Platform
Render (Recommended)
Render is the easiest option - push your repo and it just works.1
Create a Web Service
In Render dashboard, create a new Web Service and connect your Git repo.
2
Configure build settings
- Build Command:
curl -fsSL https://agents.craft.do/install.sh | bash && npm install - Start Command:
node server.js
3
Add environment variables
CRAFT_ANTHROPIC_API_KEY- Your Anthropic API keyCRAFT_MCP_URL- Your workspace MCP URL
4
Deploy
Render builds and deploys automatically. You’ll get a URL like
https://your-bot.onrender.comRender’s free tier spins down after 15 minutes of inactivity. The first request after sleep takes 30 seconds. For always-on service, use a paid plan ($7/month).
Railway
Railway is similar - Git deploy with a simple dashboard.1
Create a project
Connect your GitHub repo to a new Railway project.
2
Add environment variables
Set
CRAFT_ANTHROPIC_API_KEY and CRAFT_MCP_URL in the Variables tab.3
Configure start command
Railway auto-detects Node.js. Set start command if needed.
Step 3: Connect Chat Platforms
Slack
Best for team/workspace use. No app review needed for internal bots.1
Create a Slack App
Go to api.slack.com/apps and create a new app.
2
Enable Event Subscriptions
- Turn on Event Subscriptions
- Set Request URL:
https://your-bot.onrender.com/slack/events - Subscribe to
message.channelsand/ormessage.imevents
3
Add bot permissions
Under OAuth & Permissions, add scopes:
chat:write- to send messageschannels:history- to read channel messagesim:history- to read DMs
4
Install to workspace
Install the app and copy the Bot User OAuth Token.
Telegram
Very bot-friendly with minimal setup.1
Create a bot
Message @BotFather on Telegram and use
/newbot to create your bot. Save the token.2
Set webhook
Call the Telegram API to point at your server:
Discord
Discord supports HTTP interactions for webhook-based bots.1
Create a Discord Application
Go to Discord Developer Portal and create an app.
2
Configure interactions endpoint
Set Interactions Endpoint URL to
https://your-bot.onrender.com/discord/interactions3
Add bot to server
Generate an OAuth2 URL with
bot and applications.commands scopes.Messenger (Facebook/Instagram)
More setup steps, but doable:- Create a Meta app at developers.facebook.com
- Add the Messenger product
- Connect to a Facebook Page
- Configure webhook URL and verify token
- Handle incoming messages via the webhook, reply via Send API
Some Messenger features require app review for public use. For personal/testing use, you can skip review.
- Meta Business account
- WhatsApp Business account verification
- Cloud API setup
Platform Comparison
| Platform | Setup Difficulty | Best For |
|---|---|---|
| Slack | Easy | Team/workspace use |
| Telegram | Easiest | Personal use, public bots |
| Discord | Moderate | Communities, servers |
| Messenger | Moderate | Facebook/Instagram users |
| Hard + restricted | Business support only |
Tips
Start with Slack or Telegram
Start with Slack or Telegram
These are the easiest to set up. Get one working before adding more platforms.
Handle timeouts gracefully
Handle timeouts gracefully
Chat platforms expect quick responses (Slack times out after 3 seconds). Acknowledge immediately and process async.
Add rate limiting
Add rate limiting
Prevent abuse by limiting requests per user/channel. Simple in-memory tracking works for low-volume bots.
Log everything
Log everything
Log incoming messages and responses for debugging. Cloud platforms provide built-in logging.
Consider cold start latency
Consider cold start latency
Free tier hosts spin down when idle. Either upgrade to paid, or set up a health check ping to keep the service warm.
Cost Summary
For light personal use:| Component | Cost |
|---|---|
| Render/Railway (free tier) | $0 (with sleep) |
| Render/Railway (always-on) | ~$5-7/month |
| Slack/Telegram/Discord | Free |
| Anthropic API | Pay per use |