ClawSync Documentation
Complete setup guide for ClawSync, an open source AI agent platform with chat UI, skills system, MCP support, and multi-model routing.
Real-time Chat
Streaming responses with markdown rendering and conversation history.
Multi-Model
Claude, GPT, Grok, Gemini, or any OpenRouter model.
Skills System
Template, webhook, or code-based skills with security controls.
SyncBoard Admin
Private dashboard to configure everything about your agent.
Quickstart
Get ClawSync running locally in under 5 minutes.
Clone the repository
git clone https://github.com/waynesutton/clawsync.git
cd clawsync
Install dependencies
npm install
Start Convex backend
This creates your Convex project and starts the dev server.
npx convex dev
Set your API key
In the Convex dashboard, add your AI provider API key:
# For Claude (recommended)
ANTHROPIC_API_KEY=sk-ant-...
# For GPT
OPENAI_API_KEY=sk-...
# For Grok
XAI_API_KEY=xai-...
Start frontend
npm run dev
Complete setup wizard
Open http://localhost:5173/setup and configure your agent's name, personality, and model.
Project Structure
clawsync/
├── convex/ # Backend (Convex functions)
│ ├── agent/ # AI agent core
│ │ ├── clawsync.ts # Agent definition
│ │ ├── security.ts # Security checker
│ │ ├── toolLoader.ts # Dynamic tool loading
│ │ └── modelRouter.ts # Model resolution
│ ├── lib/ # Shared utilities
│ ├── schema.ts # Database schema
│ ├── http.ts # HTTP endpoints
│ └── setup.ts # Seed data
├── src/ # Frontend (React)
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ ├── styles/ # CSS tokens and globals
│ ├── hooks/ # React hooks
│ └── lib/ # Utilities
├── content/ # Content files
│ └── soul.md # Default agent personality
└── public/ # Static assets
Convex Setup
ClawSync uses Convex as its backend. Convex provides real-time database, serverless functions, and file storage.
Creating a Convex Project
When you run npx convex dev for the first time:
- You'll be prompted to log in or create a Convex account
- Choose "Create a new project" when asked
- The Convex CLI will generate your project and deployment URL
Convex Dashboard
Access your Convex dashboard at dashboard.convex.dev to:
- View and edit data in your tables
- Set environment variables
- View function logs
- Monitor usage and performance
Components
ClawSync uses these Convex components (configured in convex/convex.config.ts):
| Component | Purpose |
|---|---|
@convex-dev/agent |
AI agent framework with tool calling |
@convex-dev/rate-limiter |
Rate limiting for API calls |
@convex-dev/action-cache |
Caching for external API responses |
Environment Variables
Set these in the Convex dashboard under Settings → Environment Variables.
AI Provider Keys
At least one is required:
| Variable | Provider | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Claude (Anthropic) | Required* |
OPENAI_API_KEY |
GPT (OpenAI) | Optional |
XAI_API_KEY |
Grok (xAI) | Optional |
OPENROUTER_API_KEY |
OpenRouter (300+ models) | Optional |
*At least one AI provider key is required.
SyncBoard Authentication
| Variable | Description | Required |
|---|---|---|
SYNCBOARD_PASSWORD_HASH |
SHA-256 hash of admin password | Required |
Generate a password hash:
echo -n "your-password" | shasum -a 256
X/Twitter Integration
| Variable | Description |
|---|---|
X_BEARER_TOKEN |
For reading tweets (App-only auth) |
X_API_KEY |
OAuth 1.0a consumer key |
X_API_SECRET |
OAuth 1.0a consumer secret |
X_ACCESS_TOKEN |
User access token |
X_ACCESS_SECRET |
User access token secret |
AgentMail
| Variable | Description |
|---|---|
AGENTMAIL_API_KEY |
AgentMail API key from console.agentmail.to |
WorkOS AuthKit (Optional)
| Variable | Description |
|---|---|
WORKOS_CLIENT_ID |
WorkOS application client ID |
WORKOS_API_KEY |
WorkOS API key |
WORKOS_REDIRECT_URI |
OAuth callback URL |
Database Schema
ClawSync's database tables (defined in convex/schema.ts):
Core Tables
| Table | Purpose |
|---|---|
agentConfig |
Agent name, soul, model settings |
threads |
Conversation threads |
messages |
Chat messages within threads |
activityLog |
Agent action history |
Skills & Tools
| Table | Purpose |
|---|---|
skillRegistry |
Registered skills with approval status |
skillTemplates |
Pre-built skill templates |
skillInvocations |
Skill execution history |
mcpServers |
Connected MCP servers |
Channels
| Table | Purpose |
|---|---|
channelConfig |
Channel settings (Telegram, Discord, etc.) |
xConfig |
X/Twitter configuration |
xTweets |
Cached tweets |
agentMailConfig |
AgentMail settings |
agentMailInboxes |
Email inboxes |
agentMailMessages |
Email message log |
Multi-Agent
| Table | Purpose |
|---|---|
agents |
Agent configurations and status |
souls |
Shared soul documents |
agentSkillAssignments |
Per-agent skill assignments |
agentMcpAssignments |
Per-agent MCP server assignments |
agentInteractions |
Agent-to-agent communication log |
Model Providers
ClawSync supports multiple AI model providers. Configure your preferred provider in the setup wizard or SyncBoard.
Anthropic (Claude)
Recommended for best agent capabilities.
| Model | Best For |
|---|---|
| claude-sonnet-4-20250514 | Best balance of speed and capability |
| claude-3-5-haiku-20241022 | Fast responses, lower cost |
| claude-opus-4-20250514 | Most capable, complex reasoning |
OpenAI (GPT)
| Model | Best For |
|---|---|
| gpt-4o | Most capable GPT model |
| gpt-4o-mini | Fast and cost-effective |
xAI (Grok)
| Model | Best For |
|---|---|
| grok-3 | Most capable Grok model |
| grok-3-fast | Faster responses |
OpenRouter
Access 300+ models through a single API. Set OPENROUTER_API_KEY and use any model ID from openrouter.ai/models.
Agent Configuration
Configure your agent in SyncBoard → Overview or via the setup wizard.
Settings
| Setting | Description |
|---|---|
| Name | Your agent's display name |
| Model Provider | Which AI provider to use |
| Model | Specific model within the provider |
| Temperature | Response creativity (0-1) |
| Max Tokens | Maximum response length |
Soul Document
The soul document defines your agent's personality, knowledge, and behavior. Edit it in SyncBoard → Soul.
Structure
# Agent Identity
You are [name], a [role description].
# Personality
- Trait 1
- Trait 2
- Communication style
# Knowledge Areas
- Domain expertise
- Special capabilities
# Behavioral Guidelines
- How to handle specific situations
- What to avoid
Write your soul document in natural language. The agent will incorporate this into its system prompt.
Multi-Agent System
Run multiple agents simultaneously, each with independent configurations. Manage agents in SyncBoard > Agents.
Creating agents
Each agent has its own name, model, provider, soul, skills, and MCP server assignments. Create agents from SyncBoard > Agents or during the setup wizard (which creates your first default agent).
Agent controls
Each agent supports these operational modes:
| Mode | Behavior |
|---|---|
| Auto | Runs automatically, processes messages as they arrive |
| Paused | Stops processing until resumed |
| Single Task | Processes one message then pauses |
| Think to Continue | Pauses after each response for user confirmation |
Shared soul documents
Soul documents can be shared across agents. Create reusable souls in SyncBoard > Souls and assign them to one or many agents. Each agent can also have its own inline soul document.
Per-agent assignments
Each agent can have its own set of skills and MCP servers. Assign them in the Agent Detail page under the Skills and MCP tabs.
Agent-to-agent interaction
Agents can communicate with each other. When multiple agents are configured, each agent gets dynamically generated ask_agent_* tools that let it query other agents. Interactions are logged in the agentInteractions table.
Agent activity feed
View all agent activity in a unified feed at SyncBoard > Agent Feed, or filter by individual agent. Each activity log entry includes which agent performed the action.
Database tables
| Table | Purpose |
|---|---|
agents |
Agent configurations (name, model, status, mode, soul reference) |
souls |
Reusable soul documents shared across agents |
agentSkillAssignments |
Per-agent skill assignments |
agentMcpAssignments |
Per-agent MCP server assignments |
agentInteractions |
Agent-to-agent communication log |
API
The HTTP API supports multi-agent:
# List all agents
GET /api/v1/agents
# Chat with a specific agent
POST /api/v1/agent/chat
{
"message": "Hello",
"agentId": "optional-agent-id"
}
All multi-agent features are optional. If you only have one agent, everything works exactly as before. Existing API calls without agentId use the default agent.
Skills System
Skills extend your agent's capabilities. Manage them in SyncBoard → Skills.
Skill Types
Template Skills
Pre-built skills from the template library. Select a template and customize parameters.
Webhook Skills
Call external APIs when the agent invokes the skill.
{
"url": "https://api.example.com/action",
"method": "POST",
"headers": {
"Authorization": "Bearer {{secret:API_KEY}}"
}
}
Code Skills
TypeScript functions that run in Convex. (Coming soon)
Skill Approval
All skills require admin approval before they can be used. This prevents unauthorized tool usage.
Security Controls
- Rate limiting: Max invocations per minute
- Timeout: Maximum execution time
- Security check: Input validation before execution
MCP Servers
Connect to external MCP (Model Context Protocol) servers to give your agent access to additional tools.
Adding an MCP Server
- Go to SyncBoard → MCP
- Click "Add MCP Server"
- Enter the server name and URL
- Approve the server to enable its tools
Server Requirements
- Must implement the MCP protocol
- Must be accessible from your Convex backend
- Tools are discovered automatically
Only connect to trusted MCP servers. Malicious servers could expose sensitive data or execute harmful actions.
Channel Integrations
Connect your agent to messaging platforms. Configure in SyncBoard → Channels.
Supported Channels
| Channel | Status | Requirements |
|---|---|---|
| Telegram | Webhook ready | Bot token from @BotFather |
| Discord | Webhook ready | Bot application with message intents |
| Webhook ready | Twilio WhatsApp API | |
| Slack | Webhook ready | Slack app with Events API |
| Webhook ready | Resend or similar provider |
Webhook Setup
Each channel sends webhooks to your Convex HTTP endpoint:
https://your-deployment.convex.site/webhook/telegram
https://your-deployment.convex.site/webhook/discord
https://your-deployment.convex.site/webhook/whatsapp
https://your-deployment.convex.site/webhook/slack
https://your-deployment.convex.site/webhook/email
X/Twitter Integration
Connect your agent to X (Twitter) to read tweets, reply to mentions, and post updates.
Setup
- Create a developer account at developer.twitter.com
- Create a project and app with Read and Write permissions
- Generate OAuth 1.0a credentials
- Set environment variables (see Environment Variables section)
- Enable features in SyncBoard → X
Features
| Feature | Description |
|---|---|
| Auto-reply | Agent responds to @mentions automatically |
| Post from agent | Agent can post original tweets |
| Show on landing | Display tweets on public landing page |
AgentMail Integration
AgentMail provides email inboxes for your AI agent. Send, receive, and process emails programmatically.
Setup
- Get an API key from console.agentmail.to
- Set
AGENTMAIL_API_KEYin your Convex environment variables - Enable AgentMail in SyncBoard → AgentMail
- Create your first inbox
Features
| Feature | Description |
|---|---|
| Multiple inboxes | Create and manage multiple email addresses |
| Send emails | Agent can send emails on your behalf |
| Receive emails | Incoming emails forwarded to agent |
| Auto-reply | Agent automatically responds to emails |
| Rate limiting | Configurable emails per hour |
| MCP tools | Email tools available via MCP |
Environment Variable
AGENTMAIL_API_KEY=your-api-key-here
SyncBoard Dashboard
SyncBoard is your private admin dashboard for managing all aspects of your agent.
Sections
| Section | Purpose |
|---|---|
| Overview | Agent stats, quick actions |
| Agents | Create and manage multiple agents |
| Souls | Shared personality documents |
| Agent Feed | Unified activity across all agents |
| Soul | Edit agent personality |
| Models | Configure AI model |
| Skills | Manage and approve skills |
| MCP | Connect MCP servers |
| Channels | Configure messaging platforms |
| X | Twitter integration |
| AgentMail | Email inbox management |
| Threads | View conversation history |
| Activity | Agent action log |
| API | Manage API keys |
| Config | General settings |
Authentication
SyncBoard Password Auth
Basic password protection for the admin dashboard. Set SYNCBOARD_PASSWORD_HASH in your environment variables.
WorkOS AuthKit (Optional)
For enterprise SSO, ClawSync has placeholders for WorkOS AuthKit integration:
- Create a WorkOS account at workos.com
- Create an application and configure OAuth
- Set the environment variables
- Uncomment the AuthKit provider in
src/main.tsx
WorkOS integration requires additional code changes. See convex/auth.config.ts for the JWT validation skeleton.
API Keys
Generate API keys in SyncBoard → API to allow external applications to interact with your agent.
API Endpoints
# Send a message
POST /api/chat
{
"message": "Hello agent",
"threadId": "optional-thread-id"
}
# Get thread messages
GET /api/threads/:threadId/messages
# Create new thread
POST /api/threads
Authentication
Include your API key in the Authorization header:
Authorization: Bearer your-api-key
Deployment
ClawSync uses Convex for hosting and deployment.
Deployment Options
| Option | Best For |
|---|---|
| Convex Storage | Simplest setup, development |
| Convex + Cloudflare CDN | Production with custom domains |
| Cloudflare Pages | Best performance |
Deploy Commands
# Development
npm run dev
# Production (Convex Storage)
npm run deploy
# Production (Cloudflare)
npm run deploy:cf
Production Checklist
Complete these steps to secure your deployment.
Security
- Set a strong
SYNCBOARD_PASSWORD_HASH - Enable rate limiting on all channels
- Review and approve only trusted skills
- Audit connected MCP servers
Configuration
- Configure your AI provider API key
- Set up your soul document
- Test all enabled channels
- Verify webhook endpoints are accessible
Monitoring
- Check activity logs regularly in SyncBoard
- Monitor Convex dashboard for errors
- Set up alerts for failed skill invocations