Sponsored by Deepsite.site

agentic-slackbot

Created By
John-Lina year ago
An agentic Slack bot with MCP support.
Content

agentic-slackbot

A simple Slack bot that uses the OpenAI Agents SDK to interact with the Model Context Protocol (MCP) server.

Install Dependencies

uv sync

Environment Variables

Create a .envrc file in the root directory of the project and add the following environment variables:

export OPENAI_API_KEY=""
export SLACK_BOT_TOKEN=""
export SLACK_APP_TOKEN=""
export OPENAI_MODEL="gpt-4o"
export HTTP_PROXY=""

If you are using Azure OpenAI, you can set the following environment variables instead:

AZURE_OPENAI_API_KEY=""
AZURE_OPENAI_ENDPOINT="https://<myopenai>.azure.com/"
OPENAI_MODEL="gpt-4o"
OPENAI_API_VERSION="2025-03-01-preview"

If you are using Langfuse

export LANGFUSE_PUBLIC_KEY="xxx"
export LANGFUSE_SECRET_KEY="xxx"
export LANGFUSE_HOST="xxx"

Running the Bot

uv run bot

Running the bot in docker

# Build the Docker image
docker build . -t agentic-slackbot

# Run the Docker container
docker run -e SLACK_BOT_TOKEN="" \
    -e SLACK_APP_TOKEN="" \
    -e HTTP_PROXY="" \
    -e OPENAI_PROXY_BASE_URL="" \
    -e OPENAI_PROXY_API_KEY="" \
    -e OPENAI_MODEL=gpt-4o \
    -e FIRECRAWL_API_URL="" slackbot

Credit

This project is based on the sooperset/mcp-client-slackbot example.

Recommend Clients
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
HyperChatHyperChat is a Chat client that strives for openness, utilizing APIs from various LLMs to achieve the best Chat experience, as well as implementing productivity tools through the MCP protocol.
Roo Code (prev. Roo Cline)Roo Code (prev. Roo Cline) gives you a whole dev team of AI agents in your code editor.
LutraLutra is the first MCP compatible client built for everyone
chatmcpChatMCP is an AI chat client implementing the Model Context Protocol (MCP).
y-cli 🚀A Tiny Terminal Chat App for AI Models with MCP Client Support
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
A Sleek AI Assistant & MCP Client5ire is a cross-platform desktop AI assistant, MCP client. It compatible with major service providers, supports local knowledge base and tools via model context protocol servers .
Cline – #1 on OpenRouterAutonomous coding agent right in your IDE, capable of creating/editing files, executing commands, using the browser, and more with your permission every step of the way.
MCP PlaygroundCall MCP Server Tools Online
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Refact.aiOpen-source AI Agent for VS Code and JetBrains that autonomously solves coding tasks end-to-end.
GOOGLE-ADS---ADPLUGThe Google Ads MCP server for Claude and ChatGPT. Connect Google Ads to the AI you already use. Ask it to audit search terms, check pacing, compare CPA, and prepare changes you can review before anything touches the account.
MCP ConnectEnables cloud-based AI services to access local Stdio based MCP servers via HTTP requests
Cherry Studio🍒 Cherry Studio is a desktop client that supports for multiple LLM providers.
Continue⏩ Create, share, and use custom AI code assistants with our open-source IDE extensions and hub of models, rules, prompts, docs, and other building blocks
ZedCode at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WindsurfThe new purpose-built IDE to harness magic