SuperAPI AI Directory

mcp-client-slackbot

A simple Slack bot that uses LLMs and the Model Context Protocol (MCP) tools.

Open website

About this tool

MCP Simple Slackbot is a simple Slack bot based on the Model Context Protocol (MCP), designed to enhance its functionality through external tools. It uses LLM capabilities to respond to user messages in channels and direct messages, and supports multiple LLM providers, including OpenAI, Groq, and Anthropic.

Main capabilities:

  • AI-powered assistant: Leverages LLM capabilities to reply to messages in channels and direct messages.
  • MCP integration: Full access to MCP tools, such as SQLite databases and web scraping.
  • Multi-LLM support: Can work with OpenAI, Groq, and Anthropic models.
  • App Home tab: Displays available tools and usage information.

Usage:

  1. Create a Slack app: Create a new app at api.slack.com/apps, select "Create from an app manifest," copy the contents of mcp_simple_slackbot/manifest.yaml into the manifest editor, create it, and install it to the workspace. In the "Basic Information" section, generate an app-level token, add the connections:write permission, and record the Bot Token (xoxb-...) and App Token (xapp-...).
  2. Install dependencies.
  3. Configure environment variables: Create a .env file in the mcp_simple_slackbot directory (refer to the .env.example template).
  4. Run the bot: Connect all configured MCP servers, discover available tools, start the Slack app in Socket Mode, and listen for mentions and direct messages.

Interaction methods:

  • Direct messages: Send a direct message to the bot directly.
  • Channel mentions: Mention the bot in a channel using @MCP Assistant.
  • App Home: Visit the bot's App Home tab to view available tools.

Architecture:

  • SlackMCPBot: Core class, manages Slack events and message processing.
  • LLMClient: Handles communication with LLM APIs (OpenAI, Groq, Anthropic).
  • Server: Manages communication with MCP servers.
  • Tool: Represents an available tool from an MCP server.

Message processing flow: After receiving a message, the bot sends the message along with the availabletools to the LLM; if the LLM response contains a tool call, it executes that tool; returns the result to the LLM for interpretation; and finally sends the final response to the user.

This project is based on the MCP Simple Chatbot example.