An async Python-based Slackbot with Docker support and MCP tool integration.
- π€ Async Slack bot using
slack-bolt - π³ Docker containerization for easy deployment
- π FastAPI-based API for external integrations
- π οΈ MCP tool for Claude integration
- πΈ Support for text, images, and file uploads
- π Thread replies and rich message formatting
All extended guides now live in the vibe/ directory:
Run the interactive setup wizard:
python setup.py --installThis will prompt you for:
- Slack Bot Token (xoxb-...)
- Slack App Token (xapp-...)
- Slack Signing Secret
- Optional: Default channel ID
- API configuration
python setup.py --buildpython setup.py --startOn Windows (PowerShell):
scripts\start_bot.ps1Or run locally without Docker:
python -m bot.main-
Create a new app (or use existing)
-
Configure Bot Token Scopes:
app_mentions:readchannels:historychannels:readchat:writefiles:writeim:historyim:readim:writeusers:read
-
Enable Socket Mode and get App Token
-
Install app to your workspace
-
Copy tokens and run
python setup.py --install
The bot exposes a REST API on port 8765 (configurable).
curl -X POST http://localhost:8765/send \
-H "Content-Type: application/json" \
-d '{
"channel": "C1234567890",
"text": "Hello from Gnosis!"
}'curl -X POST http://localhost:8765/send-with-image \
-F "channel=C1234567890" \
-F "text=Check out this image!" \
-F "image=@/path/to/image.png"curl -X POST http://localhost:8765/reply \
-F "channel=C1234567890" \
-F "thread_ts=1234567890.123456" \
-F "text=This is a reply"The MCP tool allows Claude and other MCP clients to interact with Slack.
- Install MCP dependencies:
cd mcp
pip install -r requirements.txt- Add to your MCP configuration (e.g., Claude Desktop config):
{
"mcpServers": {
"gnosis-slackbot": {
"command": "python",
"args": [
"/path/to/gnosis-slackbot/mcp/slackbot_mcp.py"
]
}
}
}slack_send_message- Send text messagesslack_send_image- Send imagesslack_reply- Reply to threadsslack_upload_file- Upload filesslack_get_user- Get user infoslack_get_channel- Get channel info
All outgoing bot messages (API sends, DM auto-replies, mention responses, slash command replies, and file uploads) are mirrored into logs/slack_messages.log. The log is newline-delimited JSON so it can be tailed by other agents.
- Configure the path with
SLACK_MESSAGE_LOG(defaults tologs/slack_messages.log). - Attachments uploaded through the bot are mirrored to
logs/slack_messages/attachments/(override withSLACK_ATTACHMENTS_DIR). Each log entry includes alocal_copyfield pointing to the saved file when available. - Within the Codex container, the
slack-logMCP server provides helpers:slack_log_statusβ confirm the file exists and report size/mtime.slack_log_tailβ fetch the most recent entries.slack_log_sinceβ retrieve entries newer than an ISO timestamp.
Example tail command from the Codex CLI:
codex tool slack-log slack_log_tail '{"tail": 20}'docker logs -f gnosis-slackbotpython setup.py --stopOr manually:
docker stop gnosis-slackbot
docker rm gnosis-slackbotpython setup.py --stop
python setup.py --build
python setup.py --startgnosis-slackbot/
βββ bot/
β βββ __init__.py
β βββ main.py # Entry point
β βββ slack_bot.py # Slack bot logic
β βββ api_server.py # FastAPI server
βββ vibe/
β βββ API_DOCUMENTATION.md
β βββ CHECKLIST.md
β βββ PROJECT_SUMMARY.md
β βββ SETUP_GUIDE.md
βββ mcp/
β βββ slackbot_mcp.py # MCP tool implementation
β βββ requirements.txt
βββ scripts/
β βββ start_bot.sh # Unix/macOS launcher
β βββ start_bot.ps1 # Windows PowerShell launcher
β βββ restart_container.sh
β βββ check_channel_join.py
β βββ test_container.py
β βββ test_send_message.py
βββ Dockerfile
βββ requirements.txt
βββ setup.py # Setup and management script
βββ .env # Configuration (created by setup)
βββ README.md
All configuration is stored in .env:
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
SLACK_SIGNING_SECRET=...
SLACK_DEFAULT_CHANNEL=C1234567890
API_HOST=0.0.0.0
API_PORT=8765
DEBUG=false# Install dependencies
pip install -r requirements.txt
# Run bot
python -m bot.mainSet DEBUG=true in .env for verbose logging.
- Check logs:
docker logs gnosis-slackbot - Verify tokens in
.env - Ensure Socket Mode is enabled in Slack app
- Check bot has required scopes
- Check if container is running:
docker ps - Verify port mapping:
-p 8765:8765 - Check firewall settings
- Verify API is running:
curl http://localhost:8765/health - Check MCP tool configuration path
- Review MCP logs
MIT
For issues and questions, please create an issue in the repository.