Slack MCP Server
Create a powerful Model Context Protocol (MCP) server for Slack in minutes with our AI Gateway. This guide walks you through setting up seamless Slack integration with enterprise-grade security and instant OAuth authentication.
About Slack API
Slack is the leading business communication platform used by millions of teams worldwide. The Slack API provides comprehensive access to workspaces, enabling you to:
- Channel Management: Create, archive, and manage public/private channels
- Messaging: Send, update, delete, and react to messages
- User Management: Access user profiles and presence information
- File Sharing: Upload, share, and manage files within conversations
- App Interactions: Build interactive experiences with blocks and modals
- Workflow Automation: Trigger workflows and automate repetitive tasks
- Search: Query messages, files, and channels across the workspace
- Real-time Events: Subscribe to workspace events via WebSocket
Key Features
- Web API: RESTful endpoints for all Slack operations
- Events API: Real-time event subscriptions
- Block Kit: Rich, interactive message components
- Rate Limiting: Tier-based limits (1+ per second for most methods)
- File Size: Up to 1GB file uploads
- Message Threading: Full conversation context
- Enterprise Grid: Multi-workspace support
- Audit Logs: Compliance and security tracking
What You Can Do with Slack MCP Server
The MCP server transforms Slack's API into a natural language interface, enabling AI agents to:
Messaging & Communication
-
Smart Message Management
- "Post update about deployment to #engineering channel"
- "Send a DM to Sarah about the meeting notes"
- "Reply to John's question in the thread about API design"
- "Share the quarterly report in #leadership with a summary"
-
Bulk Operations
- "Notify all project channels about the maintenance window"
- "Send personalized welcome messages to new team members"
- "Post daily standup reminders to all engineering channels"
-
Message Search & Analytics
- "Find all messages about 'budget' from last month"
- "Show me unanswered questions in #support channel"
- "List all messages with attachments in #contracts"
Channel & Workspace Organization
-
Channel Management
- "Create a private channel for the Q1 planning committee"
- "Archive all channels that haven't been used in 90 days"
- "Rename #temp-project to #project-apollo"
- "Set the topic for #announcements channel"
-
User & Permission Management
- "Add all engineers to the #tech-updates channel"
- "Show me which channels John has access to"
- "Remove inactive users from private channels"
Automation & Workflows
-
Intelligent Routing
- "Forward all messages containing 'urgent' to #escalations"
- "Auto-respond to FAQs in #help channel"
- "Route customer messages to appropriate support channels"
-
Scheduled Operations
- "Post weekly team achievements every Friday at 4pm"
- "Send daily standup threads to team channels"
- "Share analytics dashboard every Monday morning"
Analytics & Insights
-
Communication Patterns
- "Analyze response times in #customer-support"
- "Show channel activity heatmap for the past month"
- "Identify most engaged team members this week"
-
Content Intelligence
- "Summarize key decisions from #product channel"
- "Extract action items from today's meetings"
- "Find all unresolved issues mentioned this week"
Integration Capabilities
-
Cross-Platform Sync
- "Mirror important Slack messages to email"
- "Create Jira tickets from Slack conversations"
- "Sync Slack threads to Confluence documentation"
-
AI-Powered Features
- "Generate meeting notes from Slack discussions"
- "Translate messages for international team members"
- "Create FAQ from frequently asked questions"
Prerequisites
- Access to Cequence AI Gateway
- Slack workspace with admin privileges
- Ability to create Slack apps
- OAuth app creation permissions
Step 1: Create Slack OAuth App
Before setting up the MCP server, you need to create a Slack app with OAuth credentials.
1.1 Access Slack App Management
- Navigate to api.slack.com/apps
- Click Create New App
- Choose From scratch
- Enter app details:
- App Name: "AI Gateway MCP Integration"
- Pick workspace for development
1.2 Configure OAuth & Permissions
-
In your app settings, go to OAuth & Permissions
-
Add OAuth Redirect URLs:
https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
-
Configure Bot Token Scopes (see Available Scopes section)
-
Configure User Token Scopes if needed
1.3 Install App to Workspace
- Go to OAuth & Permissions
- Click Install to Workspace
- Review permissions and authorize
- Save the tokens:
- Bot User OAuth Token (starts with
xoxb-
) - OAuth Access Token (starts with
xoxp-
)
- Bot User OAuth Token (starts with
1.4 Get Client Credentials
- Go to Basic Information
- Find App Credentials section
- Note down:
- Client ID
- Client Secret
- Signing Secret (for webhook verification)
Step 2: Access AI Gateway Apps
- Log in to your Cequence AI Gateway dashboard
- Navigate to Apps in the left sidebar
- You'll see the list of available third-party applications
Step 3: Find and Select Slack API
- In the Apps section, browse through the Third-party category
- Look for Slack or use the search function
- Click on the Slack API card to view details
The Slack API card shows:
- Number of available endpoints
- Integration capabilities
- Quick description of functionality
Step 4: Create MCP Server
- Click the Create MCP Server button on the Slack API card
- You'll be redirected to the MCP Server creation wizard
Step 5: Configure API Endpoints
In the App Configuration step:
- Base URL is pre-filled:
https://slack.com/api
- Select API endpoints to expose to your MCP server based on your needs
- Click Next to proceed
Step 6: MCP Server Basic Setup
Configure your MCP server details:
-
MCP Server Name: Enter a descriptive name
- Example: "Slack Workspace Automation"
- This name will identify your server in the dashboard
-
Description (Optional): Add details about the server's purpose
- Example: "Automated Slack operations for team collaboration and support"
-
Production Mode: Toggle based on your needs
- ON for production environments
- OFF for development/testing
-
Click Next to continue
Step 7: Configure Authentication
This is where you'll use your Slack OAuth credentials:
-
Authentication Type: Select OAuth 2.0
-
Fill in the OAuth configuration:
- Authorization URL:
https://slack.com/oauth/v2/authorize
- Token URL:
https://slack.com/api/oauth.v2.access
- Client ID: Paste from Slack app settings
- Client Secret: Paste from Slack app settings
- Redirect URI:
https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
- Authorization URL:
-
Scopes: Select from the available Slack scopes (see next section)
Available Slack OAuth Scopes
Configure the appropriate scopes based on your application needs:
Channel Management
-
channels:read
- View basic information about public channels
- List channels in workspace
- See channel members and purpose
-
channels:write
- Create new channels
- Archive/unarchive channels
- Rename channels and set topics
Messaging
chat:write
- Send messages as the app
- Post to channels, DMs, and threads
- Update and delete messages
- Add reactions to messages
User Information
users:read
- Access user profile information
- View user presence status
- List workspace members
- See user email addresses (requires users:read.email)
File Management
-
files:read
- View files shared in channels
- Access file metadata
- Download file content
-
files:write
- Upload files to Slack
- Share files in conversations
- Delete and manage files
Recommended Scope Combinations
For Basic Messaging Bot:
channels:read
chat:write
users:read
For Full Workspace Management:
channels:read
channels:write
chat:write
users:read
files:read
files:write
For Read-Only Analytics:
channels:read
users:read
files:read
Step 8: Configure Security
Set up API protection features:
-
API Protection: Toggle ON to enable
- Protects against bot attacks, DDoS, and threats
- Monitors for suspicious activity
- Rate limiting and anomaly detection
-
Protection Features (when enabled):
- Auto-scaling protection
- Managed infrastructure
- Built-in monitoring
- Zero maintenance required
-
Click Next to continue
Step 9: Choose Deployment Method
Select your deployment preference:
Option A: Deploy to Cequence Cloud (Recommended)
- Fully managed deployment
- Automatic scaling and monitoring
- Built-in high availability
- Features included:
- Auto-scaling
- Managed infrastructure
- Built-in monitoring
- Zero maintenance
Option B: Deploy with Helm Chart
- Self-managed Kubernetes deployment
- Full control over infrastructure
- Requires:
- Kubernetes cluster
- Helm 3.x installed
- Container registry access
Click Next after selecting your deployment method.
Step 10: Review and Deploy
Review your MCP server configuration:
- MCP Server Name: Your chosen name
- Base URL:
https://slack.com/api
- Selected Endpoints: Number of endpoints selected
- Authentication: OAuth 2.0 (Configured)
- API Protection: Enabled/Disabled
- Deployment: Cequence Cloud or Helm
Click Create & Deploy to finalize the setup.
Step 11: Post-Deployment Setup
After successful deployment:
-
Note the MCP Server URL provided
-
Test the OAuth flow:
- Click "Test Connection"
- You'll be redirected to Slack authorization
- Select workspace and authorize permissions
- Confirm successful connection
-
Configure AI Agents:
- The MCP server is now available for AI agent connections
- Use the provided server URL in your AI agent configuration
Using Your Slack MCP Server
With Claude Desktop
-
Open Claude Desktop settings
-
Add your MCP server:
{
"servers": {
"slack": {
"url": "your-mcp-server-url",
"auth": {
"type": "oauth2",
"client_id": "your-client-id"
}
}
}
} -
Start using natural language commands:
- "Post 'Team meeting at 3pm' to #general"
- "Find all messages from Alice about the API redesign"
- "Create a channel called #project-phoenix"
- "Send the monthly report to #leadership with a summary"
- "List all channels I haven't visited in 30 days"
API Integration Example
// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2',
token: 'xoxb-your-bot-token'
}
});
// Post a message
await mcpClient.slack.chat.postMessage({
channel: '#general',
text: 'Hello from MCP Server!',
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: '*Automated Update*\nDeployment completed successfully '
}
}
]
});
// Search messages
const results = await mcpClient.slack.search.messages({
query: 'from:@john has:link',
sort: 'timestamp',
count: 20
});
// Create a channel
await mcpClient.slack.conversations.create({
name: 'project-apollo',
is_private: false,
description: 'Apollo project coordination'
});
// Upload a file
await mcpClient.slack.files.upload({
channels: '#reports',
filename: 'quarterly-report.pdf',
title: 'Q4 2024 Report'
});
Common Use Cases
Team Coordination
- Daily standup automation
- Meeting note distribution
- Project channel management
- Cross-team announcements
Customer Support
- Auto-route support requests
- FAQ bot responses
- Escalation workflows
- Support metrics tracking
DevOps & Engineering
- Deployment notifications
- Incident management
- Build status updates
- Code review reminders
HR & People Operations
- Onboarding workflows
- Birthday/anniversary messages
- Policy updates distribution
- Feedback collection
Security Best Practices
-
Scope Management:
- Only request necessary scopes
- Use bot tokens instead of user tokens when possible
- Regularly audit scope usage
-
Token Security:
- Never expose tokens in code
- Rotate tokens periodically
- Use environment variables
-
Channel Access:
- Limit bot access to necessary channels
- Implement channel allowlists
- Monitor bot activity
-
Message Content:
- Don't log sensitive information
- Implement data retention policies
- Use ephemeral messages for sensitive data
Troubleshooting
Common Issues
-
OAuth Authorization Failed
- Verify redirect URLs match exactly
- Check workspace installation status
- Ensure app isn't restricted by workspace settings
-
Missing Scopes Error
- Add required scopes in Slack app settings
- Reinstall app to workspace
- Update MCP server configuration
-
Rate Limiting
- Slack has tier-based rate limits
- Implement exponential backoff
- Use batch operations where available
-
Channel Access Denied
- Bot must be invited to private channels
- Check channel permissions
- Verify bot is member of workspace
Getting Help
- Documentation: AI Gateway Docs
- Support: support@cequence.ai
- Community: AI Gateway Forum
- Slack API Docs: api.slack.com