Skip to main content

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

  1. Navigate to api.slack.com/apps
  2. Click Create New App
  3. Choose From scratch
  4. Enter app details:
    • App Name: "AI Gateway MCP Integration"
    • Pick workspace for development

1.2 Configure OAuth & Permissions

  1. In your app settings, go to OAuth & Permissions

  2. Add OAuth Redirect URLs:

    https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
  3. Configure Bot Token Scopes (see Available Scopes section)

  4. Configure User Token Scopes if needed

1.3 Install App to Workspace

  1. Go to OAuth & Permissions
  2. Click Install to Workspace
  3. Review permissions and authorize
  4. Save the tokens:
    • Bot User OAuth Token (starts with xoxb-)
    • OAuth Access Token (starts with xoxp-)

1.4 Get Client Credentials

  1. Go to Basic Information
  2. Find App Credentials section
  3. Note down:
    • Client ID
    • Client Secret
    • Signing Secret (for webhook verification)

Step 2: Access AI Gateway Apps

  1. Log in to your Cequence AI Gateway dashboard
  2. Navigate to Apps in the left sidebar
  3. You'll see the list of available third-party applications

Step 3: Find and Select Slack API

  1. In the Apps section, browse through the Third-party category
  2. Look for Slack or use the search function
  3. 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

  1. Click the Create MCP Server button on the Slack API card
  2. You'll be redirected to the MCP Server creation wizard

Step 5: Configure API Endpoints

In the App Configuration step:

  1. Base URL is pre-filled: https://slack.com/api
  2. Select API endpoints to expose to your MCP server based on your needs
  3. Click Next to proceed

Step 6: MCP Server Basic Setup

Configure your MCP server details:

  1. MCP Server Name: Enter a descriptive name

    • Example: "Slack Workspace Automation"
    • This name will identify your server in the dashboard
  2. Description (Optional): Add details about the server's purpose

    • Example: "Automated Slack operations for team collaboration and support"
  3. Production Mode: Toggle based on your needs

    • ON for production environments
    • OFF for development/testing
  4. Click Next to continue

Step 7: Configure Authentication

This is where you'll use your Slack OAuth credentials:

  1. Authentication Type: Select OAuth 2.0

  2. 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
  3. 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

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:

  1. API Protection: Toggle ON to enable

    • Protects against bot attacks, DDoS, and threats
    • Monitors for suspicious activity
    • Rate limiting and anomaly detection
  2. Protection Features (when enabled):

    • Auto-scaling protection
    • Managed infrastructure
    • Built-in monitoring
    • Zero maintenance required
  3. Click Next to continue

Step 9: Choose Deployment Method

Select your deployment preference:

  • 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:

  1. Note the MCP Server URL provided

  2. Test the OAuth flow:

    • Click "Test Connection"
    • You'll be redirected to Slack authorization
    • Select workspace and authorize permissions
    • Confirm successful connection
  3. 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

  1. Open Claude Desktop settings

  2. Add your MCP server:

    {
    "servers": {
    "slack": {
    "url": "your-mcp-server-url",
    "auth": {
    "type": "oauth2",
    "client_id": "your-client-id"
    }
    }
    }
    }
  3. 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

  1. Scope Management:

    • Only request necessary scopes
    • Use bot tokens instead of user tokens when possible
    • Regularly audit scope usage
  2. Token Security:

    • Never expose tokens in code
    • Rotate tokens periodically
    • Use environment variables
  3. Channel Access:

    • Limit bot access to necessary channels
    • Implement channel allowlists
    • Monitor bot activity
  4. Message Content:

    • Don't log sensitive information
    • Implement data retention policies
    • Use ephemeral messages for sensitive data

Troubleshooting

Common Issues

  1. OAuth Authorization Failed

    • Verify redirect URLs match exactly
    • Check workspace installation status
    • Ensure app isn't restricted by workspace settings
  2. Missing Scopes Error

    • Add required scopes in Slack app settings
    • Reinstall app to workspace
    • Update MCP server configuration
  3. Rate Limiting

    • Slack has tier-based rate limits
    • Implement exponential backoff
    • Use batch operations where available
  4. Channel Access Denied

    • Bot must be invited to private channels
    • Check channel permissions
    • Verify bot is member of workspace

Getting Help