aiGalen Guan

OpenTag Deep Dive: The Open-Source 'Claude in Slack' — CopilotKit's Multi-Platform Agent Framework

OpenTag Deep Dive: The Open-Source "Claude in Slack"

On June 26, 2026, CopilotKit released OpenTag on GitHub. Three days later: 299 stars, 38 forks, MIT license. Its positioning is refreshingly direct:

An open-source alternative to Claude in Slack.

Translation: you run your own AI agent inside Slack — it reads threads, answers questions, calls your tools, and renders rich results right in the conversation. Open-source, self-hosted, bring your own model, wire your own tools. No per-seat pricing, no lock-in.

What OpenTag Is

OpenTag is not a standalone product — it's a reference implementation within the CopilotKit ecosystem. It demonstrates how to build a multi-platform AI agent in 30 minutes using the @copilotkit/bot SDK.

Core capabilities:

  • Auto-responds when @mentioned in Slack threads
  • Reads full thread context, understands conversations
  • Calls Linear to query/create issues, calls Notion to search/create docs
  • Renders charts (Chart.js), diagrams (Mermaid), and tables inline
  • Human-in-the-loop approval: any write operation (create issue, write doc) requires a human click to confirm
  • Same codebase runs on Slack, Discord, Telegram, and WhatsApp

Architecture: Three Processes, One Codebase

OpenTag's architecture is remarkably lean — three processes, all TypeScript:

Slack / Discord / Telegram / WhatsApp ──@mention──▶  bot (app/)  ──AG-UI──▶  runtime (runtime.ts)
                                                          │  BuiltInAgent (LLM)
                                                          ├── Linear  MCP  (hosted)
                                                          └── Notion  MCP  (sidecar)
Process File Responsibility
Bot app/index.ts Multi-platform adapters, tool registration, render components, approval gating
Agent runtime.ts LLM backend, a single BuiltInAgent, exposed via AG-UI protocol
Notion MCP Standalone sidecar Streamable-HTTP wrapper around the official @notionhq/notion-mcp-server

Key design decisions:

  • The agent backend is a few dozen lines of TypeScript. No Python, no LangGraph, no A2UI middleware. Just a CopilotSseRuntime + BuiltInAgent.
  • Bot and Agent communicate via the AG-UI protocol. AG-UI is CopilotKit's Agent-UI protocol, defining how agents expose tools, state, and streaming output to frontends.
  • MCP connections are fault-tolerant. Each MCP server has an 8-second connection timeout; a failed connection never aborts the entire turn — the agent continues with whatever tools remain available.

Multi-Platform: One app/ Codebase, Four Platforms

This is OpenTag's most elegant design. createBot accepts an array of platform adapters, each activated only when its corresponding secrets are present:

const adapters: PlatformAdapter[] = [];

if (have("SLACK_BOT_TOKEN", "SLACK_APP_TOKEN")) {
  adapters.push(slack({ botToken, appToken, ... }));
}
if (have("DISCORD_BOT_TOKEN", "DISCORD_APP_ID")) {
  adapters.push(discord({ botToken, appId, ... }));
}
if (have("TELEGRAM_BOT_TOKEN")) {
  adapters.push(telegram({ token, ... }));
}
if (have("WHATSAPP_ACCESS_TOKEN", ...)) {
  adapters.push(whatsapp({ ... }));
}

Each adapter contributes its own built-in tools (e.g. lookup_slack_user) and context (tagging and formatting guidance), injected only when that platform is active — the model never receives another platform's conventions.

Everything else — tools, components, approval gating, rendering — is platform-agnostic and shared verbatim across all four platforms.

Generative UI: Charts and Tables in Chat

OpenTag doesn't just return text. It renders directly in Slack messages:

  • Charts: the render_chart tool accepts a Chart.js config object, rendered to PNG via Playwright in a local headless browser
  • Diagrams: the render_diagram tool accepts Mermaid source, rendered to an image
  • Tables: the render_table tool renders native Slack tables
  • Issue cards: the issue_card component renders rich Linear Issue cards
  • Notion page cards: Notion pages displayed as structured cards

Critical security design: chart rendering happens in a local headless browser — your data is never sent to any rendering service.

Human-in-the-Loop: Write Operations Must Be Confirmed

OpenTag implements a blocking confirm_write gate:

Agent decides to create a Linear Issue
  │
  ▼
Calls confirm_write tool
  │
  ▼
Slack message shows [Create] [Cancel] buttons
  │
  ▼
User clicks Create → Agent executes the write
User clicks Cancel → Operation cancelled

The significance of this design: the agent can propose, but the final decision on writes belongs to the human. This is a critical safety pattern for production-grade agent systems.

Slash Commands

OpenTag registers four app-level slash commands:

Command Function
/agent <text> Mention-free entry point; runs the agent with the command text
/triage [note] Summarizes the conversation and proposes issues to file
/preview <title> Privately previews the issue the agent would file (only you see it)
/file-issue Opens a structured issue form modal

Comparison with Claude in Slack

Dimension OpenTag Claude in Slack
Open source ✅ MIT ❌ Proprietary
Self-hosted ✅ Fully self-hosted ❌ Anthropic cloud
Model choice ✅ Bring your own (OpenAI/Anthropic/Google) ❌ Claude only
Tool integration ✅ Linear + Notion + custom MCP ❌ Limited
Multi-platform ✅ Slack/Discord/Telegram/WhatsApp ❌ Slack only
Generative UI ✅ Charts/diagrams/tables/cards ❌ Text only
Human-in-the-loop ✅ Built-in confirm_write ❌ None
Pricing Free (self-hosting costs) Per-seat pricing
Ops burden You deploy and maintain Zero ops

Multi-Dimensional Scoring

Dimension Score Notes
Architecture 9/10 Multi-platform adapter pattern is elegant, AG-UI protocol decoupling is clean, MCP fault-tolerance is mature
Code quality 8/10 Minimal code (dozens of lines runtime + hundreds of lines app), type-safe, has unit tests
Innovation 7/10 Generative UI + human-in-the-loop are highlights, but the overall pattern isn't new
Practicality 8/10 Out-of-the-box Linear/Notion integration, multi-platform support, genuinely deployable
Extensibility 9/10 Copy the app/ directory to create a new bot, MCP tools are arbitrarily extensible
Maturity 6/10 Some bot SDK packages not yet on npm, must run from monorepo

Overall: 8/10. OpenTag is currently the most complete and elegant open-source Slack Agent implementation. It's not an academic demo — it has real multi-platform support, Generative UI, human-in-the-loop approval, and MCP tool integration. If you need an AI agent that actually works inside Slack, OpenTag is the best open-source starting point.

Limitations and Risks

  1. npm packages not ready: @copilotkit/bot-telegram, -whatsapp, and -store-redis aren't published to npm yet; must run from the CopilotKit monorepo for now.
  2. CopilotKit ecosystem dependency: OpenTag is deeply coupled to CopilotKit's SDK and AG-UI protocol. If CopilotKit pivots or sunsets, migration costs are high.
  3. No persistence by default: Uses in-memory storage by default; approval state is lost on restart. Requires additional Redis configuration.
  4. Slack limitations: Slack's Block Kit has constraints on rich text rendering; complex UI may be truncated.

Conclusion

OpenTag is an important piece of the CopilotKit ecosystem puzzle. It proves that a production-grade Slack Agent doesn't need Python, LangGraph, or a microservice architecture — a few dozen lines of TypeScript is enough.

Its real value isn't in the code itself (there's very little of it), but in the architectural patterns it demonstrates:

  1. Multi-platform adapter pattern: one set of business logic, multiple platform adapters, auto-activated by secret presence
  2. AG-UI protocol decoupling: Bot and Agent communicate via a standard protocol, independently deployable and extensible
  3. MCP tool integration: Linear and Notion connected via MCP, tool discovery and invocation fully standardized
  4. Human-in-the-loop approval: write operations must pass human confirmation — this is the safety baseline for production agents

Our recommendation: if you need to deploy an AI agent in Slack/Discord, start directly from OpenTag. Copy the app/ directory, modify the system prompt in runtime.ts, wire up your own MCP tools — within 30 minutes you'll have a multi-platform agent running on your own infrastructure.

References