mcp_slack
Provides tools for fetching and processing Slack messages, including retrieving recent messages from channels, getting messages from specific users, summarizing channel conversations, and grouping messages by sender
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp_slack summarize the last 50 messages in the general channel"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Slack-MCP
This project is a Multi-Tool MCP (Model Context Protocol) server for Slack automation using the FastMCP library. It allows you to fetch and process Slack messages using AI agents.This project is great example to learn and Build Understanding reagarding MCPs.
๐ Folder Structure
slack-mcp/
โโโ main.py # Main MCP tool server with multiple tools
โโโ .env # Store your SLACK_TOKEN safely here
โโโ smithery.yaml # Configuration for Smithery deployment
โโโ README.md # This file
โโโ uv-lock
โโโ pyproject.toml # Python dependencies
Related MCP server: agenthub MCP
๐ Tools in This MCP
1. get_recent_messages
Fetches the most recent messages from a given Slack channel.
Inputs:
channel_id,limitReturns: Formatted recent messages.
2. get_user_messages
Fetches messages from a specific user within a channel.
Inputs:
channel_id,username,limitReturns: Messages sent by the user.
3. summarize_recent_messages
Summarizes the last N messages from a channel using a connected LLM.
Inputs:
channel_id,limitReturns: AI-generated summary.
4. group_messages_by_user
Groups recent channel messages by sender.
Inputs:
channel_id,limitReturns: A grouped format like:
@user1: - Message 1 - Message 2 @user2: - Message A
๐ช Slack OAuth Setup & Token Generation
1. Create a Slack App
Go to: https://api.slack.com/apps
Click Create New App > From Scratch
Give it a name and choose your workspace
2. Set OAuth Scopes
In OAuth & Permissions, under Bot Token Scopes, add:
channels:readchannels:historyusers:readchat:write(optional for sending messages)
3. Install to Workspace
Click Install App to Workspace
Authorize permissions
Copy the Bot User OAuth Token (starts with
xoxb-...)
4. Save the Token
Create a .env file:
SLACK_TOKEN=xoxb-your-token-hereIf you change scopes later:
Revisit OAuth & Permissions
Click Reinstall App to apply new scopes
โจ Testing the Tools
On MCP Inspector (Local)
Run the server:
python main.pyUse MCP Inspector to call tools and test output
mcp dev main.pyOn Smithery (Cloud)
Push your code to GitHub
Deploy your MCP to Smithery
Use the "Run tool" tab to test individual tools
On Claude (Cloud Desktop)
You can connect these tools via Smithery to Claude workflows for real-time Slack insights and summaries.
๐ Requirements
Install dependencies with:
uv pip install -r pyproject.tomlOr manually:
pip install fastmcp httpx python-dotenv๐ง Environment File (.env)
SLACK_TOKEN=xoxb-123-your-token๐ Contributing
Pull requests are welcome. If youโd like to add new Slack tools (e.g., send_message, track_reactions, etc.), feel free to open an issue or PR.
๐น Video Demo On claude desktop:
https://github.com/user-attachments/assets/37d905a5-6382-40ce-9500-2dd744656546
๐ Acknowledgments
FastMCP by Model Context Protocol
Smithery.ai for deploying and testing MCPs
Slack Web API Docs: https://api.slack.com/
๐ Example Output
Grouped Slack Messages:
@bakar:
- Just pushed latest PR
- Working on the backend API
@hamza:
- Updated Figma designs
- Fixed navbar bug๐ Smithery.ai (Cloud Deployment)
Here is the URL go and checkout this mcp_server: Slack_MCP_Server
๐งโ๐ป Author
Built by Abu Bakar Yasir โ Computer Engineering @ COMSATS + AI Software Engineer | Full Stack Developer ๐
Available Tools
4 toolsget_recent_slack_messagesC
Fetch recent messages from a Slack channel.
Inputs: channel_id (required), limit. Returns: result
get_user_infoB
Get Slack user info by username or real name.
Args:
username: Slack display name or real name (not user ID).
Inputs: username (required). Returns: result
get_user_messagesB
Fetch messages by a specific user (given by name) from a Slack channel.
Args:
channel_id: The Slack channel ID.
username: The Slack username or real name of the user.
limit: How many messages to check (optional).
Inputs: channel_id (required), username (required), limit. Returns: result
post_messageC
Post a message to a Slack channel.
Inputs: channel_id (required), text (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 4 tools
The tools are mostly distinct, but get_recent_slack_messages and get_user_messages could be confused as both fetch messages from channels. However, get_user_messages specifies a user filter, which helps differentiate it. The other tools (get_user_info, post_message) have clear, non-overlapping purposes.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., get_recent_slack_messages, post_message). There are no deviations in naming conventions, making the set predictable and readable.
With only 4 tools, the server feels thin for a Slack integration, which typically involves more operations like managing channels, files, or reactions. However, it covers basic messaging and user info, so it's borderline but not severely lacking.
The server covers core messaging operations (post and fetch) and user info, but there are notable gaps such as updating or deleting messages, listing channels, or handling reactions. Agents can work around this for basic tasks, but advanced workflows may fail.
Maintenance
Related MCP Connectors
Query channels, search messages, and read threads, users and reactions in your Stream Chat app.
Message channels between the agents of different people, one-to-one or in groups.
Agent-to-agent chat: find rooms, read messages, post and reply.
Read Clanksquare's public channels, where AI agents post signed messages. Read-only, no key.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to communicate with each other through Slack-like room-based channels with messaging, mentions, presence management, and long-polling for real-time collaboration.40 npm5MIT
- AlicenseNot gradedqualityDmaintenanceA bearer-authed message hub for AI coding agents to communicate across machines and sessions, providing tools for sending, polling, and managing channels.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code agents to communicate across sessions, terminals, and repositories through shared channels with persistent context.MIT
- AlicenseNot gradedqualityBmaintenanceConnect AI agents to shared Ping chat rooms for collaboration, with auto-delivery of new messages. Enables agents to chat and share context with each other through the MCP protocol.317,248 npm1MIT