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_slacksummarize 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: Agent Communication MCP Server
๐ 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.
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'fetch' but doesn't specify whether this is a read-only operation, requires authentication, has rate limits, or how it handles errors. This leaves significant gaps in understanding the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (2 parameters, no annotations, but with an output schema), the description is minimally adequate. The output schema likely covers return values, reducing the need for description details, but the description fails to address key behavioral aspects like permissions or error handling, leaving it incomplete for safe use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter details. The description adds minimal semantics by implying 'channel_id' and 'limit' are used to fetch messages, but it doesn't explain what 'recent' means, the format of 'channel_id', or default behavior for 'limit' (though the schema shows a default of 5). This insufficiently compensates for the lack of schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('fetch') and resource ('recent messages from a Slack channel'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_user_messages' which might also retrieve messages, leaving room for ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as 'get_user_messages' or 'post_message'. The description lacks context about prerequisites, constraints, or typical use cases, offering minimal direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_user_infoB
Get Slack user info by username or real name.
Args:
username: Slack display name or real name (not user ID).
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool retrieves user info but doesn't specify what info is returned (e.g., profile details, status), whether it requires authentication, rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with the main purpose stated clearly in the first sentence. The additional parameter explanation is concise and adds value without redundancy. However, the formatting with quotes and line breaks slightly detracts from optimal structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there's an output schema (which should cover return values), the description doesn't need to explain outputs. However, for a tool with no annotations and only basic parameter info, it lacks details on behavioral aspects like authentication or error cases. It's adequate but has clear gaps in providing a complete context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context for the single parameter: 'username: Slack display name or real name (not user ID).' This clarifies the parameter's purpose and constraints beyond the schema, which has 0% description coverage. Since there's only one parameter and the description compensates well, it earns a high score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get Slack user info by username or real name.' It specifies the verb ('Get'), resource ('Slack user info'), and scope ('by username or real name'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from its sibling tools (e.g., get_user_messages), which slightly limits its differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by specifying 'by username or real name' and noting that it's 'not user ID,' which helps clarify when to use this tool versus alternatives that might use IDs. However, it doesn't explicitly state when to use this tool over siblings like get_user_messages or provide clear exclusions, leaving some ambiguity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| username | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states basic functionality. It doesn't disclose behavioral traits like permissions needed, rate limits, pagination, error handling, or whether it's read-only (implied by 'Fetch' but not explicit). This is inadequate for a tool with potential Slack API constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose, followed by a concise Args section. Every sentence adds value: the first defines the tool, and the param explanations are necessary. No redundant or verbose content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters, no annotations, and an output schema (which handles return values), the description is minimally adequate. It covers purpose and param semantics but lacks behavioral context (e.g., Slack API nuances). For a tool interacting with external services, more completeness is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context beyond the schema: it explains 'username' includes 'real name' (not just username), 'limit' checks messages (not fetches exactly that many), and clarifies the purpose of each param. With 0% schema description coverage, this compensates well, though 'channel_id' semantics could be more detailed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Fetch messages') and target ('by a specific user from a Slack channel'), specifying the resource (messages) and scope (user, channel). It distinguishes from siblings like 'get_recent_slack_messages' (general messages) and 'post_message' (sending), but not explicitly from 'get_user_info' (user metadata).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when needing messages from a specific user in a channel, but lacks explicit guidance on when to use this vs. 'get_recent_slack_messages' (e.g., for filtering) or 'get_user_info' (for user details). No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
post_messageC
Post a message to a Slack channel.
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Post') but doesn't mention any behavioral traits like required permissions, rate limits, whether the message is editable, or what happens on success/failure. This leaves significant gaps for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's function without any wasted words. It's appropriately sized and front-loaded with the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a mutation tool with no annotations, 0% schema coverage, but an output schema exists, the description is minimally adequate. The output schema may cover return values, but the description lacks context about permissions, error handling, or usage scenarios, leaving it incomplete for safe operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'channel_id' represents (e.g., format like C123456) or what 'text' can contain (e.g., markdown, emojis, attachments). This leaves both parameters semantically unclear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Post a message') and target resource ('to a Slack channel'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'get_recent_slack_messages' or 'get_user_messages', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There are sibling tools for retrieving messages, but no indication of when posting is appropriate versus reading, or any prerequisites like channel access permissions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- Changed
get_recent_slack_messages1 field changed- added
Input schema / titleAdded value: +"get_recent_slack_messagesArguments"
- Changed
get_user_info1 field changed- added
Input schema / titleAdded value: +"get_user_infoArguments"
- Changed
get_user_messages1 field changed- added
Input schema / titleAdded value: +"get_user_messagesArguments"
- Changed
post_message1 field changed- added
Input schema / titleAdded value: +"post_messageArguments"
4 tool updates
- First observed
get_recent_slack_messages - First observed
get_user_info - First observed
get_user_messages - First observed
post_message
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.
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Related MCP Servers
- -
- AlicenseNot gradedqualityAmaintenanceEnables 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.1,014 npm4MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to search and retrieve messages within a Slack workspace using the Slack Web API. It supports specific channel filtering and includes built-in rate limit handling for efficient message discovery.25 npmMIT
- AlicenseNot gradedqualityCmaintenanceA bearer-authed message hub for AI coding agents to communicate across machines and sessions, providing tools for sending, polling, and managing channels.MIT