Slack MCP Server
Enables AI assistants to interact with Slack workspaces through natural language, supporting channel management, message operations, user profiles, reactions, and threaded conversations.
README
Slack MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Slack's API. This server enables AI assistants like Claude to interact with Slack workspaces, manage channels, send messages, and perform various Slack operations.
Features
- Channel Management: List public channels and get channel information
- Message Operations: Post messages, reply to threads, and get message history
- User Management: List users and get detailed user profiles
- Reactions: Add emoji reactions to messages
- Thread Support: Get thread replies and post threaded responses
- Pagination: Support for paginated results across all list operations
- Authentication: Secure OAuth-based authentication via Nango
Prerequisites
- Python 3.13+
- Slack Bot Token with appropriate permissions
- Slack Team ID
- Nango integration for credential management (optional)
Installation
- Clone the repository (or create the project structure):
mkdir slack-mcp-server
cd slack-mcp-server
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -e .
Configuration
Environment Variables
Create a .env file in the project root with the following variables:
NANGO_BASE_URL=https://api.nango.dev
NANGO_SECRET_KEY=your-nango-secret-key
NANGO_CONNECTION_ID=your-connection-id
NANGO_INTEGRATION_ID=slack
Slack App Setup
- Create a Slack App at api.slack.com
- Add Bot Token Scopes:
channels:read- View basic information about public channelschannels:history- View messages in public channelschat:write- Send messages as the botreactions:write- Add emoji reactionsusers:read- View people in the workspaceusers:read.email- View email addresses (if needed)
- Install the app to your workspace
- Copy the Bot User OAuth Token to your
.envfile
Claude Desktop Configuration
Add this configuration to your Claude Desktop config file:
Location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"slack": {
"command": "uvx",
"args": ["git+https://github.com/ampcome-mcps/slack-mcp.git"],
"env": {
"NANGO_BASE_URL": "NANGO BASE URL",
"NANGO_SECRET_KEY":"ENTER YOUR NANAGO SECRET KEY",
"NANGO_CONNECTION_ID":"ENTER NANGO CONNECTION ID",
"NANGO_INTEGRATION_ID":"ENTER NANGO INTEGRATION ID"
}
}
}
}
Available Tools
The MCP server provides the following tools for Claude:
Channel Operations
slack_list_channels- List public channels with paginationget_conversation_info- Get detailed information about a specific channel
Message Operations
slack_post_message- Post a new message to a channelslack_reply_to_thread- Reply to a specific message threadslack_get_channel_history- Get recent messages from a channelslack_get_thread_replies- Get all replies in a message thread
User Operations
slack_get_users- List all users in the workspaceslack_get_user_profile- Get detailed profile information for a user
Interaction Operations
slack_add_reaction- Add emoji reactions to messages
Usage Examples
Once configured with Claude, you can use natural language commands like:
- "List all the channels in our Slack workspace"
- "Post a message to the #general channel saying 'Hello team!'"
- "Get the recent messages from the #development channel"
- "Reply to that thread with 'Thanks for the update'"
- "Add a thumbs up reaction to that message"
- "Show me the user profile for John Doe"
Running the Server Standalone
For testing or development purposes, you can run the server directly:
python main.py
The server will start and listen for MCP protocol messages via stdin/stdout.
Project Structure
slack-mcp-server/
├── main.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── .env # Environment variables (create from template)
├── .env.example # Environment variables template
├── README.md # This file
└── .gitignore # Git ignore rules
Development
Key Components
- SlackClient: Handles all Slack API interactions using httpx
- MCP Server: Implements the Model Context Protocol for tool exposure
- Tool Definitions: Structured schemas for all available Slack operations
- Error Handling: Comprehensive error handling and logging
Adding New Tools
To add new Slack API functionality:
- Add the method to the
SlackClientclass - Define the tool schema in the
TOOLSlist - Add the tool handler in the
call_toolfunction
Dependencies
httpx- Async HTTP client for Slack API callsmcp- Model Context Protocol frameworkpython-dotenv- Environment variable management
Troubleshooting
Common Issues
- Authentication Errors: Verify your
SLACK_BOT_TOKENis correct and has necessary scopes - Channel Not Found: Ensure the bot has access to the channel and it's not archived
- Permission Denied: Check that your Slack app has the required OAuth scopes
- Rate Limiting: The server handles Slack's rate limits automatically
Debugging
The server logs debug information to stderr. Check the Claude Desktop logs or run the server directly to see detailed error messages.
Security Notes
- Store sensitive tokens in environment variables, never in code
- Use
.gitignoreto prevent committing.envfiles - Regularly rotate your Slack bot tokens
- Follow the principle of least privilege for OAuth scopes
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues related to:
- Slack API: Check the Slack API documentation
- MCP Protocol: See the MCP specification
- This server: Open an issue in the project repository
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.