Skip to main content

Overview

The lua integrations command enables you to connect your agent to third-party services like Linear, Discord, Google Calendar, HubSpot, and 250+ other integrations via Unified.to. When you connect an integration:
  • An MCP server is automatically created to expose tools to your agent
  • Triggers can be set up to wake up your agent when events occur in the connected service
lua integrations              # Interactive mode
lua integrations connect      # Connect a new integration
lua integrations list         # List connected integrations
lua integrations available    # View available integrations
lua integrations info <type>  # View integration details (scopes, triggers)
lua integrations disconnect   # Disconnect an integration
lua integrations update       # Update connection scopes
lua integrations webhooks     # Manage triggers (webhook subscriptions)
lua integrations mcp          # Manage MCP servers for connections
Limit: Only 1 connection per integration type is allowed per agent. To change scopes, use lua integrations update.

How It Works

  1. Connect: Authenticate with a third-party service via OAuth or API token
  2. Auto-MCP: An MCP server is automatically created and activated for the connection
  3. Agent Access: Your agent can now use tools from that integration (e.g., create Linear issues, send Discord messages)
  4. Triggers (NEW): Set up event-driven triggers to wake up your agent when things happen (e.g., a task is created, a message is received)

Commands

lua integrations connect

Connect a new third-party integration with optional triggers.
# Interactive mode (recommended for first-time setup)
lua integrations connect

# Non-interactive: connect Linear with OAuth and all scopes
lua integrations connect --integration linear --auth-method oauth --scopes all

# Connect with triggers enabled (agent wakes up on events)
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created,task_task.updated

# Connect with all available triggers
lua integrations connect --integration linear --auth-method oauth --scopes all --triggers all

# Use a custom webhook URL instead of agent trigger
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created --custom-webhook --hook-url https://my-server.com/webhook

# Specify specific scopes
lua integrations connect --integration linear --auth-method oauth --scopes "task_task_read,task_task_write"

# Use API token authentication
lua integrations connect --integration linear --auth-method token

# Control sensitive data visibility
lua integrations connect --integration discord --auth-method oauth --scopes all --hide-sensitive false
What happens:
  1. CLI fetches available integrations
  2. You select or specify an integration and auth method
  3. Browser opens for OAuth authorization (or you enter API credentials)
  4. Connection is established and stored
  5. MCP server is automatically created and activated
  6. If triggers are specified, webhook subscriptions are created to wake up your agent on events
Triggers: When using --triggers, events in the connected service (e.g., “a task was created in Linear”) will automatically wake up your agent with the event data in runtimeContext. This enables event-driven workflows without polling.

lua integrations list

View all connected integrations and their status.
lua integrations list
Output:
============================================================
🔗 Connected Integrations
============================================================

🟢 Linear
   ID: 6978e0294d9c2007ed5cb129
   Status: Active
   MCP Server: linear (✅ active)
   Connected: 1/27/2026

🟡 Discord
   ID: 6979e707ea702a223666bfd2
   Status: Connected (tools pending)
   MCP Server: discord (⏸️ inactive)
   Connected: 1/28/2026

============================================================
Total: 2 connection(s)
Status Icons:
  • 🟢 Active - Connection healthy, tools available
  • 🟡 Connected (tools pending) - Connection healthy, MCP server inactive
  • 🔴 Unhealthy - Re-authorization required
  • ⏸️ Paused - Connection paused

lua integrations info

View detailed information about an integration type, including available OAuth scopes and triggers. This is useful for discovering what’s available before connecting.
# View integration details
lua integrations info linear

# Output as JSON (for scripting/AI agents)
lua integrations info linear --json
Output:
============================================================
📋 Integration Info: Linear
============================================================

🔑 OAuth Scopes:
   ✓ task_task_read
     Manage and view issues in Linear
   ✓ task_task_write
     Create and update issues in Linear
   ✓ task_project_read
     View projects in Linear
   ...

⚡ Available Triggers:
   • task_task.created [virtual, 60min interval]
     A new issue was created in Linear
   • task_task.updated [virtual, 60min interval]
     An issue was updated in Linear
   • task_task.deleted [virtual, 60min interval]
     An issue was deleted in Linear
   • task_comment.created [virtual, 60min interval]
     A new comment was added to an issue
   ...

============================================================
Friendly Labels: Scopes and triggers display user-friendly descriptions (e.g., “A new issue was created in Linear” instead of “task_task.created”) to help non-technical users understand what each option does.

lua integrations available

List all available integrations you can connect.
lua integrations available
Shows integrations grouped by category (task, messaging, crm, etc.) with auth type indicators:
  • 🔐 OAuth only
  • 🔑 API Token only
  • 🔐🔑 Both available

lua integrations update

Update an existing connection’s OAuth scopes. This re-authorizes the connection with new permissions.
# Interactive mode
lua integrations update

# Non-interactive: update Linear with all scopes
lua integrations update --integration linear --scopes all

# Specific scopes
lua integrations update --integration linear --scopes "task_task_read,task_task_write,task_project_read"
Update deletes the old connection and creates a new one with updated scopes. You’ll need to re-authorize in the browser.

lua integrations disconnect

Remove a connected account. This also deletes the associated MCP server and any webhook subscriptions.
# Interactive mode
lua integrations disconnect

# Non-interactive
lua integrations disconnect --connection-id 6978e0294d9c2007ed5cb129

lua integrations webhooks

Manage triggers (webhook subscriptions) for connected integrations. Triggers let your agent receive events when things happen in connected services (e.g., task created, message received).
List all triggers:
lua integrations webhooks list

# Output as JSON for scripting
lua integrations webhooks list --json
Output:
────────────────────────────────────────────────────────────────────────────────
⚡ Triggers / Webhook Subscriptions
────────────────────────────────────────────────────────────────────────────────

📦 linear
   ✅ task_task.created (poll, agent trigger)
      ID: 698304fa49d44978357b6435
   ✅ task_task.updated (poll, agent trigger)
      ID: 698304fb49d44978357b6436

────────────────────────────────────────────────────────────────────────────────
Total: 2 trigger(s)
JSON Output:
{
  "triggers": [
    {
      "id": "698304fa49d44978357b6435",
      "integrationType": "linear",
      "objectType": "task_task",
      "event": "created",
      "webhookType": "virtual",
      "hookUrl": "https://api.heylua.ai/webhook/unifiedto/data",
      "status": "active",
      "interval": 60,
      "connectionId": "698304f949d44978357b6425"
    }
  ],
  "total": 1
}
Webhook IDs are displayed for each trigger, making it easy to delete specific triggers using --webhook-id.

lua integrations mcp

Manage MCP servers for connections. MCP servers are automatically created when you connect an integration, but you can activate/deactivate them manually.
List connections with MCP server status:
lua integrations mcp list
Output:
────────────────────────────────────────────────────────────────────────────────
🔌 MCP Servers for Connections
────────────────────────────────────────────────────────────────────────────────

  Connection: 6978e0294d9c2007ed5cb129
  Integration: Linear
  MCP Server: linear
  Status: ✅ active
────────────────────────────────────────────────────────────────────────────────

Non-Interactive Mode

All integrations commands support non-interactive mode for CI/CD, automation, and AI coding assistants.

Discovery Commands

Use these to discover available options before connecting:
# List available integrations
lua integrations available

# Get integration details (scopes and triggers)
lua integrations info linear
lua integrations info linear --json

# List available trigger events
lua integrations webhooks events --integration linear
lua integrations webhooks events --integration linear --json

Connect Options

OptionDescription
--integration <type>Integration type (e.g., linear, discord, googlecalendar)
--auth-method <method>Authentication method: oauth or token
--scopes <scopes>Comma-separated OAuth scopes, or all for all available
--hide-sensitive <bool>Hide sensitive data from MCP tools (default: true)
--triggers <events>Comma-separated triggers (e.g., task_task.created,task_task.updated) or all
--custom-webhookUse custom webhook URL instead of agent trigger
--hook-url <url>Custom webhook URL (use with --custom-webhook)

Info Options

OptionDescription
--jsonOutput as JSON for scripting

Disconnect Options

OptionDescription
--connection-id <id>Connection ID to disconnect

Trigger/Webhook Options

OptionDescription
--connection <id>Connection ID for the trigger
--integration <type>Integration type (for events discovery)
--object <type>Object type (e.g., task_task, calendar_event)
--event <type>Event type: created, updated, or deleted
--hook-url <url>Custom webhook URL (default: agent trigger)
--interval <minutes>Polling interval for virtual webhooks
--webhook-id <id>Trigger ID (for delete action)
--jsonOutput as JSON (for events command)

MCP Options

OptionDescription
--connection <id>Connection ID for MCP operations

Examples

# Discover available integrations and their details
lua integrations available
lua integrations info linear --json

# Connect with triggers in one command
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created,task_task.updated

# Connect with all available triggers
lua integrations connect --integration linear --auth-method oauth --scopes all --triggers all

# Create additional trigger after connection
lua integrations webhooks create \
  --connection 6978e0294d9c2007ed5cb129 \
  --object task_task \
  --event deleted

# Create trigger with custom webhook URL
lua integrations webhooks create \
  --connection 6978e0294d9c2007ed5cb129 \
  --object task_task \
  --event created \
  --hook-url https://my-server.com/webhook

# Disconnect
lua integrations disconnect --connection-id 6978e0294d9c2007ed5cb129

Workflow Example

1

Discover Available Integrations

# See what integrations are available
lua integrations available

# Get details about a specific integration
lua integrations info linear
View available integrations, their OAuth scopes, and trigger events.
2

Connect with Triggers

# Connect with triggers enabled (recommended)
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created,task_task.updated
Complete OAuth in the browser. MCP server is auto-created and activated. Triggers are set up to wake your agent on events.
3

Verify Connection

lua integrations list
Confirm the connection shows as Active (🟢) and triggers are configured.
4

Test with Agent

lua chat -e sandbox -m "Create a Linear issue titled 'Test from Lua'"
Your agent should now have access to Linear tools.
5

View Active Triggers

lua integrations webhooks list
See all active triggers. When events occur in Linear, your agent will be notified automatically.

Event-Driven Triggers

Triggers are a powerful way to make your agent reactive to external events. Instead of polling or manually checking for updates, your agent automatically wakes up when something happens.

How Triggers Work

  1. You connect an integration with triggers enabled
  2. Unified.to monitors the connected service for events
  3. When an event occurs (e.g., a task is created), Unified.to sends a webhook
  4. Your agent wakes up with the event data in runtimeContext
  5. The agent can respond based on what happened

Example: React to New Linear Issues

# Connect Linear with trigger for new issues
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created
When a new issue is created in Linear, your agent receives the event data and can:
  • Send a notification to Slack
  • Update a dashboard
  • Assign the issue to a team member
  • Any other action your agent is configured to perform

Trigger Types

TypeDescription
NativeReal-time webhooks (when the integration supports them)
VirtualPolling-based (Unified.to checks at intervals, default 1 hour)
Most integrations use virtual webhooks. The polling interval can be configured:
# Set a 2-hour polling interval
lua integrations webhooks create --connection abc123 --object task_task --event created --interval 120

Authentication Types

  • Secure authorization flow via browser
  • Scope selection for fine-grained permissions
  • Automatic token refresh
  • Requires OAuth to be configured for the integration in your Unified.to workspace

API Token / Personal Access Token

  • Direct credential entry
  • Simpler setup
  • Token fields vary by integration (e.g., API Key, Personal Access Token, Bot Token)
  • Instructions shown during connection for where to obtain credentials

Tips

Triggers are the easiest way to make your agent reactive. Enable them during connection:
# Enable triggers during connection
lua integrations connect --integration linear --auth-method oauth --scopes all \
  --triggers task_task.created,task_task.updated

# Or add triggers later
lua integrations webhooks create --connection abc123 --object task_task --event created
Your agent automatically wakes up when events occur - no polling required!
Use discovery commands to understand what’s available:
# See all integrations
lua integrations available

# Get detailed info about an integration
lua integrations info linear

# See available trigger events
lua integrations webhooks events --integration linear
This is especially useful for AI coding assistants building agents programmatically.
By default, --hide-sensitive true is enabled, which hides sensitive fields from MCP tool responses. Disable only if your agent needs access to sensitive data:
lua integrations connect --integration discord --auth-method oauth --scopes all --hide-sensitive false
When using OAuth, select only the scopes your agent needs. Use all during development, then restrict to specific scopes in production:
# Development
lua integrations connect --integration linear --auth-method oauth --scopes all

# Production
lua integrations connect --integration linear --auth-method oauth --scopes "task_task_read,task_task_write"
Each agent can have only one connection per integration type. To change accounts or scopes, use lua integrations update or disconnect and reconnect.
Use --json for machine-readable output:
lua integrations info linear --json
lua integrations webhooks events --integration linear --json
Perfect for CI/CD pipelines and AI coding assistants.

See Also