nedasvi/slack-mcp-server-remote
If you are the rightful owner of slack-mcp-server-remote 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.
A Cloudflare Workers-based MCP server implementation for Slack API integration, designed to work with AI clients like Claude or Cursor.
Slack MCP Server Remote
A Cloudflare Workers-based MCP server implementation that provides Slack API tools for the Model Context Protocol, designed to integrate seamlessly with AI clients like Claude or Cursor.
All credits goes to https://github.com/vakharwalad23/google-mcp-remote and since it was taken as an example and Claude 4 Sonnet was prompted to make Remote MCP server for Slack based on it
⚠️ SECURITY WARNING: Do not use someone else's deployed instance of this server as it requires access to your Slack workspace and personal data. Always deploy your own instance to maintain control over your data and API access.
Features
-
Complete Slack API Integration:
- Send messages to channels and direct messages
- Reply to message threads
- Add emoji reactions to messages
- List and search channels, users, and conversations
- Read message history from channels and threads
- Manage direct messages and group conversations
- Get unread message summaries
- Search for users by username or real name
-
Advanced OAuth Flow:
- Secure Slack OAuth 2.0 authentication
- Workspace selection during authentication
- Persistent token storage in Cloudflare KV
- Support for both bot and user tokens
-
Cloudflare Workers Deployment:
- Serverless architecture for scalability
- Low latency global deployment
- Built-in security and monitoring
Available Tools
- slack_list_channels - List public or pre-defined channels in the workspace
- slack_post_message - Post a new message to a channel or send a direct message
- slack_reply_to_thread - Reply to a specific message thread
- slack_add_reaction - Add emoji reactions to messages
- slack_get_channel_history - Get recent messages from a channel
- slack_get_thread_replies - Get all replies in a message thread
- slack_get_users - Get list of workspace users with basic profile information
- slack_get_user_profile - Get detailed profile information for a specific user
- slack_search_users_by_username - Search for users by partial username or name
- slack_open_direct_message - Open a direct message conversation with a user
- slack_get_dm_channel_by_username - Find a user and get their DM channel ID
- slack_get_unread_channels_summary - Get summary of channels with unread messages
- slack_fetch_channel_unread_messages - Fetch recent messages from a channel
Deployment Instructions
Prerequisites
-
Slack App Setup:
- Visit the Slack Apps page
- Click "Create New App" → "From scratch"
- Name your app and select your workspace
- Configure OAuth & Permissions with User Token Scopes (this app uses user tokens only):
channels:history
- View messages in public channelschannels:read
- View basic channel informationchat:write
- Send messages as the userreactions:write
- Add emoji reactionsusers:read
- View users and basic informationusers.profile:read
- View detailed user profilesgroups:read
- View private channels and DMsgroups:history
- View messages in private channelsim:history
- View messages in DMsim:write
- Start DMs with usersim:read
- View DM informationmpim:read
- View group DM informationmpim:history
- View messages in group DMsidentify
- Basic user information
- Set redirect URI to:
https://your-project.your-username.workers.dev/callback
-
Cloudflare Account:
- Sign up for a Cloudflare account
- Install Wrangler CLI:
npm install -g wrangler
- Authenticate with Cloudflare:
wrangler login
Deployment Steps
-
Clone and setup:
git clone <repository-url> cd slack-mcp-server-remote npm install
-
Configure secrets: Set your Slack OAuth credentials as secrets in Cloudflare:
wrangler secret put SLACK_OAUTH_CLIENT_ID wrangler secret put SLACK_OAUTH_CLIENT_SECRET wrangler secret put COOKIE_ENCRYPTION_KEY
(For COOKIE_ENCRYPTION_KEY, generate a random string to secure cookies)
-
Create KV namespaces:
wrangler kv:namespace create OAUTH_KV wrangler kv:namespace create SLACK_TOKENS_KV
Update your
wrangler.jsonc
with the IDs from the output -
Deploy to Cloudflare Workers:
npm run deploy
-
Update Slack App: After deployment, update your Slack app's redirect URI with your actual Worker URL:
https://your-project.your-username.workers.dev/callback
Integration with Claude AI and Cursor
Once your MCP server is deployed and running on Cloudflare Workers, you need to integrate it with your AI client (Claude or Cursor) using the deployed URL: https://your-project.your-username.workers.dev/
Required Permissions
Before integration, ensure your AI client has the following permissions configured:
- Network Access: The AI client needs permission to make HTTP requests to your deployed Cloudflare Worker
- MCP Protocol Access: Permission to establish Server-Sent Events (SSE) connections
- Configuration File Access: Ability to read and execute commands from configuration files
- Process Execution: Permission to run
npx
commands for the MCP remote client - External Server Communication: Access to communicate with remote MCP servers over HTTPS
Integration Steps
- Deploy your server (complete steps 1-5 above)
- Note your deployed URL: After deployment, your server will be available at
https://your-project.your-username.workers.dev/
- Configure your AI client using the instructions below
- Test the connection by asking your AI client to perform a simple Slack task
⚠️ Important: Replace your-project.your-username.workers.dev
with your actual Cloudflare Workers domain in all configuration examples below.
Configure as Remote MCP Server
To add this as a remote MCP server in your MCP client configuration:
MCP Server URL: https://your-worker-domain.workers.dev/sse
Claude Desktop configuration:
{
"mcpServers": {
"notion-remote": {
"command": "mcp-client",
"args": ["--transport", "sse", "https://your-worker-domain.workers.dev/sse"]
}
}
}
Example Commands
You can now ask Claude to perform tasks using your Slack workspace:
Send a message to the #general channel saying "Hello from Claude!"
List all channels in the workspace and show me the recent messages from #random
Find user john.doe and send them a direct message saying "Meeting at 3pm"
Show me all unread channels and their message counts
Add a thumbs up reaction to the latest message in #general
Workspace Selection
During the OAuth flow, you can optionally select a specific workspace. The authentication dialog includes a workspace selector that allows you to:
- Let Slack automatically choose the workspace
- Pre-select a specific workspace if you have access to multiple
This is particularly useful for users who are members of multiple Slack workspaces.
Local Development
To run the server locally for testing:
# Create a .dev.vars file with your environment variables
echo "SLACK_OAUTH_CLIENT_ID=your-client-id" > .dev.vars
echo "SLACK_OAUTH_CLIENT_SECRET=your-client-secret" >> .dev.vars
echo "COOKIE_ENCRYPTION_KEY=your-random-key" >> .dev.vars
# Run local development server
npm run dev
OAuth Authorization Flow
The first time you use the server with an AI client after integration:
- Initial Connection: Your AI client (Claude/Cursor) will connect to your deployed MCP server at
https://your-project.your-username.workers.dev/
- Server Approval: The server will display an approval dialog for the MCP client access
- Approve Access: Click "Approve" to grant the MCP client access to your server
- Workspace Selection: Choose your Slack workspace (optional, if you have access to multiple)
- Slack OAuth: Follow the Slack OAuth flow to grant API access to your deployed app
- Authorization Complete: After successful authorization, you'll be redirected back and can start using Slack tools through your AI client
Note: This authorization flow only needs to be completed once per deployment. Your AI client will remember the authorization for future sessions.
Architecture
This project follows microservices principles with clear separation of concerns:
graph TD
A[AI Client] -->|MCP Protocol| B[Cloudflare Worker]
B --> C[OAuth Provider]
B --> D[Slack Handler]
B --> E[MCP Server]
C --> F[KV Store - OAuth]
D --> G[Slack API]
D --> H[KV Store - Tokens]
E --> I[Slack Tools]
I --> J[Slack Client]
J --> G
style A fill:#e1f5fe
style B fill:#f3e5f5
style G fill:#e8f5e8
Flow Description:
- Authentication Flow: AI client requests access → OAuth provider handles authentication → Slack OAuth → Token storage
- Tool Execution: AI client calls tool → MCP server validates → Slack client makes API call → Response returned
- State Management: OAuth tokens stored in KV, workspace preferences maintained
Troubleshooting
- OAuth Issues: Ensure your Slack app has the correct redirect URIs set
- API Permissions: Check that you've enabled all required scopes in your Slack app
- Token Expiration: If you encounter authentication errors, try clearing the KV storage and re-authenticating
- Workspace Access: Make sure your Slack app is installed in the workspace you're trying to access
Security Considerations
- All OAuth tokens are stored securely in Cloudflare KV
- The server uses HTTPS only for all communications
- Cookie encryption protects against CSRF attacks
- User approval is required before accessing any Slack data
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
MIT License - see LICENSE file for details
Note: This is a remote MCP server that requires deployment to Cloudflare Workers. For local development and testing, see the Local Development section above.