Memory 019e95be

Memory ID (Session ID): 019e95be-d0d1-7000-9df7-99b17bd27363
Last Updated: 2026-06-05 05:14:24

Fact Summary

OMP Discord Integration — Three Tiers

Tier 1: Discord Webhooks (Simplest, 5 min)

  • Create webhook in Discord channel settings → Integrations → Webhooks
  • Use from OMP via bash tool: curl -X POST -H 'Content-Type: application/json' -d '{"content":"message"}' $DISCORD_WEBHOOK_URL
  • One-way only (OMP → Discord), no bot needed
  • Set DISCORD_WEBHOOK_URL as env var, never commit to git

Tier 2: MCP Discord Server (Bidirectional, 15 min)

  • Best MCP server: @iqai/mcp-discord (npm package, GitHub: IQAIcom/mcp-discord)
    • Supports: send/read messages, manage channels, list servers, add reactions
    • Requires: DISCORD_TOKEN env var (bot token from Discord Developer Portal)
  • Config location: ~/.omp/agent/mcp.json
  • Example config:
{
  "mcpServers": {
    "discord": {
      "command": "npx",
      "args": ["-y", "@iqai/mcp-discord"],
      "env": { "DISCORD_TOKEN": "<bot-token>" }
    }
  }
}
  • Bot setup: Discord Developer Portal → New Application → Bot → enable MESSAGE_CONTENT intent → generate invite with permissions (Send Messages, Read Message History, Manage Messages, Add Reactions) → invite to server
  • Verify with: /mcp reload + /mcp test discord

Tier 3: OMP Extension (Automated, 30 min)

  • Create extension at ~/.omp/agent/extensions/discord-notify.ts
  • Uses OMP ExtensionAPI to hook events: agent_end, tool_call, etc.
  • Posts to Discord via webhook using global fetch (available in Bun)
  • Register in ~/.omp/agent/config.yml under extensions: array
  • No bundling needed if only using fetch and OMP APIs
  • Extension bundling caveat (from prior memory): OMP legacy loader mirrors to /tmp/, breaking relative requires; must bundle with bun build keeping @earendil-works/pi-coding-agent external

Current System State (0rk.de server)

  • OMP config: ~/.omp/agent/config.yml — has mcp.discoveryMode: true and extensions array
  • No ~/.omp/agent/mcp.json exists yet (needs creation for MCP servers)
  • Existing extension: pi-langfuse at /home/dev/.omp/plugins/node_modules/pi-langfuse

Security Rules

  • Never commit Discord bot tokens or webhook URLs to git
  • Use env vars: DISCORD_TOKEN, DISCORD_WEBHOOK_URL
  • Webhook URLs are bearer tokens — treat as passwords
  • Use least-privilege bot permissions
  • Enable only needed gateway intents

Decision Matrix

NeedTierTime
Ping me when doneTier 1 (Webhook)5 min
Talk to Discord from OMPTier 2 (MCP)15 min
Auto-notify on completionsTier 3 (Extension)30 min
Full Discord adminTier 2 (MCP)15 min
All of the aboveTier 2 + 345 min

Key OMP Docs Referenced

  • omp://extensions.md, omp://hooks.md, omp://mcp-config.md, omp://custom-tools.md, omp://sdk.md

Reference Session