logo
icon

OpenAB Cursor

Open Agent Broker — a lightweight Rust harness that bridges Discord to any ACP-compatible coding CLI (Claude Code, Codex, Gemini, Kiro, Cursor) over stdio JSON-RPC. This template uses the Cursor Agent CLI as the agent backend. Source: https://github.com/openabdev/openab

template cover
Deployed3 times
PublisherzeaburZeabur
Created2026-04-20
Minimum2 Cores4 GB
Recommended4 Cores8 GB
Tags
AIDeveloper ToolsDiscord

OpenAB Cursor

OpenAB is a lightweight, open-source Rust harness that bridges Discord to any Agent Client Protocol-compatible coding CLI over stdio JSON-RPC.

This template deploys the Cursor variant using the openab-cursor image with cursor-agent as the agent backend.

Important Notes

  • Image tag: This template uses a pinned version (0.8.3-beta.4). To upgrade, change the image tag in Zeabur Dashboard → Service → Settings. Available tags: GitHub Packages.
  • Persistent storage: /home/agent is mounted as a persistent volume. Auth credentials (~/.cursor/), MCP config, approvals, and settings survive restarts.
  • Config ownership: The container starts as root and switches to agent user (uid 1000) before running openab. If you encounter permission issues, restart the service — ownership is fixed automatically on boot.
  • Paid subscription required: Cursor Agent CLI requires a paid Cursor subscription (Pro or Business).

Setup

1. Get a Discord Bot Token

  1. Go to https://discord.com/developers/applications and click New Application
  2. Navigate to Bot tab → click Reset Token → copy the token
  3. On the same page, scroll down and enable Message Content Intent under Privileged Gateway Intents
  4. Go to OAuth2 → URL Generator → check scope bot → check permissions: Send Messages, Send Messages in Threads, Create Public Threads, Read Message History, Add Reactions, Manage Messages
  5. Copy the generated URL and open it in your browser to invite the bot to your server

2. Authenticate Cursor (choose one)

The startup script does not enforce any Cursor auth env var. Use whichever method you prefer:

Option A: Device flow (interactive, no env var needed)

After the service is running, open the service terminal in Zeabur Dashboard and run:

runuser -u agent -- cursor-agent login

ℹ️ runuser -u agent runs the login as the agent user, so HOME is set to /home/agent automatically and credentials are owned by agent from the start — no chown or restart needed afterwards.

Follow the on-screen instructions to complete device flow authorization in your browser. New conversations will pick up the new auth on the next session — restart only if you need to invalidate existing in-memory sessions.

Option B: CURSOR_API_KEY env var (no terminal required)

  1. In the Cursor dashboard, go to Settings → Account and create an API key
  2. In Zeabur Dashboard → Service → Variables, add CURSOR_API_KEY with that value
  3. Restart the service. cursor-agent reads the env var directly — no cursor-agent login step needed

3. Get Discord Channel IDs

  1. Open Discord → go to User Settings (gear icon) → Advanced → enable Developer Mode
  2. Right-click the channel where you want the bot to respond → Copy Channel ID
  3. For multiple channels, separate IDs with commas: 123456789012345678,234567890123456789

4. Deploy

Fill in the Discord Bot Token and click deploy. The service connects to Discord automatically. Then authenticate Cursor using the method above.

Add Messaging Platforms (Telegram / LINE / Feishu / Google Chat / MS Teams)

To bridge Telegram, LINE, Feishu/Lark, Google Chat, or MS Teams, deploy the OpenAB Gateway template into the same Zeabur project. Then add these environment variables to this service:

  • GATEWAY_URL = ws://openab-gateway:8080/ws
  • GATEWAY_PLATFORM = one of telegram, line, feishu, googlechat, teams

Restart the service. The startup script auto-injects the [gateway] block into config.toml.

Usage

  • @mention the bot in an allowed channel to start a conversation
  • OpenAB creates a thread for multi-turn conversations — no @mention needed for follow-ups
  • Each thread maps to a persistent Cursor session (24h TTL)

Customization

FileDescription
/home/agent/.config/openab/config.tomlOpenAB config (sessions, reactions, STT, etc.)

config.toml is created from a built-in template on first boot. After that, edit the file directly — environment variables are only used for initial setup. To reset to defaults, delete the file and restart: rm /home/agent/.config/openab/config.toml

For config options, see the OpenAB documentation.

Webhook / Bot Integration

By default, openab ignores messages from other bots and webhooks. To allow webhook-triggered messages (e.g. automated testing or CI pipelines), add the following to your config.toml:

[discord]
allow_bot_messages = "mentions"

With this setting, openab responds to any bot or webhook message that @mentions it. To restrict to a specific webhook, also add:

trusted_bot_ids = ["YOUR_WEBHOOK_USER_ID"]

The webhook user ID is the numeric ID in the webhook URL: https://discord.com/api/webhooks/<ID>/...

Disabling

Leave Discord Bot Token empty. The service sleeps instead of crashing.