bahakizil/Slack_MCP_Server
If you are the rightful owner of Slack_MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Slack MCP Server is a modern integration server designed to connect Slack with Claude Desktop and other MCP clients, leveraging FastMCP 2.8.0 for seamless operations.
send_slack_message
Send messages to Slack channels
get_slack_channels
List all available channels
get_slack_messages
Retrieve messages from channels
get_slack_user_info
Get user information
search_slack_messages
Search across workspace messages
create_slack_channel
Create new channels
ask_ai_question
Ask questions to OpenAI GPT model
send_ai_response_to_slack
AI responds directly in Slack channels
analyze_slack_conversation
AI analysis of Slack conversations
add_mcp_server
Add external MCP server connections
list_mcp_servers
List all configured MCP servers and their status
connect_mcp_server
Connect to an external MCP server
disconnect_mcp_server
Disconnect from an MCP server
list_external_tools
List all tools available from connected MCP servers
call_external_tool
Execute tools from external MCP servers
ask_ai_with_external_tools
AI with access to external MCP tools
š Slack MCP Server
A modern FastMCP server for Slack integration, built with FastMCP 2.8.0 and designed to work seamlessly with Claude Desktop and other MCP clients.
⨠Features
- š§ 16 Powerful Tools: 6 Slack + 3 AI + 7 MCP Server Management tools
- š¤ AI Integration: OpenAI GPT-4o-mini for intelligent responses
- š¬ Smart Slack Bot: AI can respond directly in Slack channels
- š Conversation Analysis: AI-powered analysis of Slack conversations
- š MCP Server Integration: Connect to external MCP servers dynamically
- š ļø External Tool Access: Use tools from other MCP servers through our server
- š§ AI + External Tools: AI can suggest and use external MCP tools
- š Local Development: Easy setup with environment variables
- āļø AWS Ready: Optional AWS Secrets Manager integration for production
- š¤ Claude Desktop: Pre-configured for Claude Desktop integration
- š Modern FastMCP: Built with latest FastMCP 2.8.0 framework
- š”ļø Secure: Environment-based credential management
š ļø Available Tools
š± Slack Tools
- send_slack_message - Send messages to Slack channels
- get_slack_channels - List all available channels
- get_slack_messages - Retrieve messages from channels
- get_slack_user_info - Get user information
- search_slack_messages - Search across workspace messages
- create_slack_channel - Create new channels
š¤ AI-Powered Tools
- ask_ai_question - Ask questions to OpenAI GPT model
- send_ai_response_to_slack - AI responds directly in Slack channels
- analyze_slack_conversation - AI analysis of Slack conversations (summary, sentiment, action items, key topics)
š MCP Server Management Tools
- add_mcp_server - Add external MCP server connections
- list_mcp_servers - List all configured MCP servers and their status
- connect_mcp_server - Connect to an external MCP server
- disconnect_mcp_server - Disconnect from an MCP server
- list_external_tools - List all tools available from connected MCP servers
- call_external_tool - Execute tools from external MCP servers
- ask_ai_with_external_tools - AI with access to external MCP tools
š Quick Start (Local Development)
1. Setup Slack App
-
Go to Slack API and create a new app
-
Enable these Bot Token Scopes:
channels:read
- View basic information about public channelschannels:history
- View messages in public channelschat:write
- Send messages as the botgroups:read
- View basic information about private channelsgroups:history
- View messages in private channelsim:read
- View basic information about direct messagesim:history
- View messages in direct messagesusers:read
- View people in the workspacesearch:read
- Search messages (requires special approval)channels:manage
- Create and manage channels
-
Install the app to your workspace
-
Copy the Bot User OAuth Token (starts with
xoxb-
)
2. Setup OpenAI API
- Go to OpenAI Platform
- Create a new API key
- Copy the API key (starts with
sk-
)
3. Install Dependencies
# Clone or download this repository
cd mcpslack
# Install Python dependencies
pip install -r requirements.txt
4. Configure Environment
# Copy the example environment file
cp .env.example .env
# Edit .env file and add your credentials:
# SLACK_BOT_TOKEN=xoxb-your-actual-bot-token-here
# OPENAI_API_KEY=sk-your-actual-openai-api-key-here
5. Test the Server
# Run the server directly
python main.py
# The server will start and show available tools
š¤ Claude Desktop Integration
1. Install for Claude Desktop
Add this configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"slack-mcp-server": {
"command": "python",
"args": ["/full/path/to/mcpslack/main.py"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-actual-bot-token-here",
"OPENAI_API_KEY": "sk-your-actual-openai-api-key-here"
}
}
}
}
2. Update Path
Replace /full/path/to/mcpslack/main.py
with the actual path to your main.py
file.
3. Restart Claude Desktop
Close and reopen Claude Desktop. You should see all 9 tools available in Claude:
- 6 Slack tools for workspace management
- 3 AI tools for intelligent responses and analysis
š§ AI-Powered Usage Examples
Direct AI Chat
Ask: "What are the key benefits of using microservices architecture?"
Tool: ask_ai_question
AI Slack Bot
Send AI response directly to #general channel:
Tool: send_ai_response_to_slack
Channel: general
Question: "Can you explain our new deployment process?"
Conversation Analysis
Analyze recent discussion in #planning:
Tool: analyze_slack_conversation
Channel: planning
Analysis Type: action_items
Use Cases:
- š¼ Meeting Summaries: Analyze channel conversations for key decisions
- š Sentiment Analysis: Check team mood and engagement
- ā Action Items: Extract tasks and follow-ups from discussions
- š¤ Smart Responses: AI bot answers team questions in real-time
š MCP Server Integration
Add External MCP Servers
Add a weather MCP server:
Tool: add_mcp_server
Server Name: weather-server
URL/Command: https://weather-mcp.example.com/mcp
Connect and Use External Tools
1. Connect to the server:
Tool: connect_mcp_server
Server Name: weather-server
2. List available tools:
Tool: list_external_tools
3. Use external tool:
Tool: call_external_tool
Server: weather-server
Tool: get_weather
Arguments: {"city": "Istanbul"}
AI with External Tools
Ask AI with access to all connected tools:
Tool: ask_ai_with_external_tools
Question: "What's the weather like in Istanbul and should I schedule an outdoor meeting?"
MCP Integration Benefits:
- š Modular: Add any MCP-compatible tool/service
- š¤ Collaborative: Multiple team members can use shared MCP servers
- š§ AI-Enhanced: AI can suggest and use appropriate external tools
- š Scalable: Connect to dozens of specialized MCP servers
āļø AWS Production Deployment
Prerequisites
- AWS CLI configured
- ECR repository created
- ECS cluster and service configured
- AWS Secrets Manager secrets created
1. Create AWS Secrets
# Create Slack Bot Token secret
aws secretsmanager create-secret \
--name slack-mcp/slack-bot-token \
--description "Slack Bot Token for MCP Server" \
--secret-string "xoxb-your-bot-token-here"
# Create OpenAI API Key secret
aws secretsmanager create-secret \
--name slack-mcp/openai-api-key \
--description "OpenAI API Key for AI features" \
--secret-string "sk-your-openai-api-key-here"
# Create other secrets as needed
aws secretsmanager create-secret \
--name slack-mcp/slack-app-token \
--description "Slack App Token" \
--secret-string "xapp-your-app-token-here"
2. Update Environment for AWS
# Set USE_AWS_SECRETS=true in your deployment environment
export USE_AWS_SECRETS=true
export AWS_REGION=us-east-1
3. Deploy with Docker
# Build and tag the image
docker build -t slack-mcp-server:latest .
# Tag for ECR (replace with your account ID)
docker tag slack-mcp-server:latest \
123456789012.dkr.ecr.us-east-1.amazonaws.com/slack-mcp-server:latest
# Login to ECR
aws ecr get-login-password --region us-east-1 | \
docker login --username AWS --password-stdin \
123456789012.dkr.ecr.us-east-1.amazonaws.com
# Push to ECR
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/slack-mcp-server:latest
# Deploy to ECS (update service)
aws ecs update-service \
--cluster slack-mcp-cluster \
--service slack-mcp-service \
--force-new-deployment
4. ECS Task Definition
Use the provided task-definition.json
file with your AWS account details:
# Register the task definition
aws ecs register-task-definition \
--cli-input-json file://task-definition.json
5. Load Balancer Setup
The server will be available at your ALB endpoint:
- Health check:
GET /health
- MCP endpoint:
POST /mcp/
š§ Development
Running Tests
# Install development dependencies
pip install pytest pytest-asyncio
# Run tests (when test files are created)
pytest
Code Structure
mcpslack/
āāā main.py # FastMCP server implementation
āāā requirements.txt # Python dependencies
āāā .env.example # Environment template
āāā .env # Your environment variables
āāā Dockerfile # Container configuration
āāā task-definition.json # ECS task definition
āāā deploy.sh # Deployment script
āāā claude_desktop_config.json # Claude Desktop config
āāā README.md # This file
š Troubleshooting
Common Issues
-
"Slack client not initialized"
- Check your
SLACK_BOT_TOKEN
in.env
file - Ensure the token starts with
xoxb-
- Check your
-
"OpenAI client not initialized"
- Check your
OPENAI_API_KEY
in.env
file - Ensure the token starts with
sk-
- Verify you have sufficient OpenAI credits
- Check your
-
"Missing scope" errors
- Add required scopes in your Slack app settings
- Reinstall the app to your workspace
-
Claude Desktop not loading server
- Check the path in
claude_desktop_config.json
- Ensure Python is in your PATH
- Restart Claude Desktop
- Check the path in
-
AWS deployment issues
- Verify IAM roles have correct permissions
- Check CloudWatch logs for error details
- Ensure secrets exist in Secrets Manager
Debugging
Enable debug mode by setting DEBUG=true
in your .env
file:
DEBUG=true
LOG_LEVEL=DEBUG
š Required Slack Permissions
Make sure your Slack app has these OAuth scopes:
channels:read
- List public channelschannels:history
- Read public channel messageschat:write
- Send messagesgroups:read
- List private channelsgroups:history
- Read private channel messagesusers:read
- Get user informationsearch:read
- Search messages (requires approval)channels:manage
- Create channels
š¤ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally with Claude Desktop
- Submit a pull request
š License
MIT License - see LICENSE file for details.
š Support
- Check the troubleshooting section above
- Review Claude Desktop MCP documentation
- Open an issue for bugs or feature requests
Built with ā¤ļø using FastMCP 2.8.0