Mastra Slack Agent Template

Mastra Slack Agent Template

A Slack agent template with tools, sandboxes, and GitHub access.

A starting point for building a Slack agent. It handles mentions, DMs, threads, files, workspace search, and streamed replies.

How it works

Each thread gets its own E2B sandbox with files, shell access, and a browser. The agent can run commands without touching the host machine. Larger requests can be split between several smaller agents.

It also includes web research through Exa, image generation, scheduled tasks, and optional GitHub and AgentMail accounts. New features can be added as skills or MCP servers.

OpenRouter handles model access, and PostgreSQL stores memory and state. The configuration guide explains how to set up the services and Slack app.

Stack

  • Mastra runtime on Bun, TypeScript, and the AI SDK.
  • Slack via the Chat SDK adapter in Socket Mode.
  • OpenRouter models, Exa search, E2B sandboxes.
  • PostgreSQL memory and state, with local observability.