Resources
11Install
npx skillscat add hansakoch/omnigent-cloudflare Install via the SkillsCat registry.
SKILL.md
Omnigent Cloudflare Server
Purpose
Deploy a self-contained Omnigent server on Cloudflare Workers + D1. Provides REST API, WebSocket tunnels, and web UI for AI agent orchestration.
When to Use
- Deploying an Omnigent server to Cloudflare
- Running a serverless agent orchestration platform
- Enabling multi-device access to agent sessions
- Zero-infrastructure server deployment
Setup
Prerequisites
- Cloudflare account
- Domain on Cloudflare
- Wrangler CLI (
npm install -g wrangler) - Node.js 18+
Deploy
cd deploy/cloudflare
# One-click setup
chmod +x setup.sh
./setup.shOr manually:
# Create database
wrangler d1 create omnigent-db
# Update wrangler.toml with database_id
# Initialize schema
wrangler d1 execute omnigent-db --file=./schema.sql
wrangler d1 execute omnigent-db --file=./schema.sql --remote
# Deploy
wrangler deploySecurity Setup
Set up Cloudflare Access for email + PIN protection:
- Go to Cloudflare Zero Trust Dashboard
- Create Access Application for your domain
- Add policy with email addresses allowed
- Users login with email + one-time PIN
Usage
Health Check
curl https://your-domain.com/healthList Agents
curl https://your-domain.com/v1/agentsCreate Session
curl -X POST -H "Content-Type: application/json" \
-d '{"agent_id": "agent_mimo", "title": "My session"}' \
https://your-domain.com/v1/sessionsPost Message
curl -X POST -H "Content-Type: application/json" \
-d '{"content": "Hello, agent!", "role": "user"}' \
https://your-domain.com/v1/sessions/SESSION_ID/messagesWebSocket Tunnel
Connect via WebSocket:
const ws = new WebSocket('wss://your-domain.com/v1/runner/tunnel?runner_id=my-runner&conversation_id=conv_xxx');Key Files
src/index.js— Worker code (API + WebSocket + routing)schema.sql— D1 database schemapublic/index.html— Web UIwrangler.toml— CF Worker configurationsetup.sh— One-click setup script
Notes
- D1 is eventually consistent (slight delay for cross-region reads)
- WebSocket messages limited to 100KB
- Free tier covers light usage (~100K requests/day)
- Authentication handled by Cloudflare Access
Troubleshooting
Database errors
- Check
wrangler.tomlhas correctdatabase_id - Run schema initialization again
Access issues
- Verify Cloudflare Access is configured
- Check allowed email addresses in policy
- Ensure domain is proxied (orange cloud)
WebSocket issues
- Ensure URL uses
wss://(notws://) - Check query parameters:
runner_idandconversation_id