Enhanced MCP Server for the Slack API, enabling AI assistants like Claude to interact with Slack workspaces including comprehensive Canvas functionality with dynamic channel support.
- No static configuration required: Automatically discovers all public and private channels via API
- Real-time channel access: Always up-to-date with your workspace's channel structure
- Pagination support: Handles workspaces with hundreds of channels efficiently
- Canvas Creation: Create standalone and channel-specific canvases
- Advanced Editing: 6 different edit operations with full flexibility
- Access Control: Granular permissions for users and channels
- Content Management: Full lifecycle management from creation to deletion
All original Slack MCP server functionality is preserved and enhanced.
slack_list_channels- ENHANCED: Now fetches all channels dynamicallyslack_post_message- Post messages to any channelslack_reply_to_thread- Reply to message threadsslack_add_reaction- Add emoji reactionsslack_get_channel_history- Retrieve message historyslack_get_thread_replies- Get thread conversationsslack_get_users- List workspace usersslack_get_user_profile- Get detailed user information
slack_canvas_create- Create standalone canvasesslack_canvas_edit- Edit existing canvasesslack_channel_canvas_create- Create channel-specific canvasesslack_canvas_get- Retrieve canvas contentslack_canvas_delete- Delete canvasesslack_canvas_access_set- Manage canvas permissions
slack_files_upload- Upload files to Slackslack_files_list- List files with filtering optionsslack_files_info- Get detailed file informationslack_files_delete- Delete files from workspace
slack_search_messages- Search messages across workspaceslack_search_files- Search files in workspace
slack_reminders_add- Create remindersslack_reminders_list- List active remindersslack_reminders_delete- Delete reminders
slack_conversation_create- Create new channels (public or private)slack_conversation_archive- Archive channelsslack_conversation_unarchive- Unarchive channelsslack_conversation_invite- Invite users to channelsslack_conversation_kick- Remove users from channelsslack_conversation_rename- Rename channelsslack_conversation_set_purpose- Set channel purposeslack_conversation_set_topic- Set channel topicslack_conversation_join- Join a channelslack_conversation_leave- Leave a channel
slack_pins_add- Pin messages or files to channelsslack_pins_remove- Unpin items from channelsslack_pins_list- List all pinned items in a channel
slack_reactions_remove- Remove reactions from messagesslack_reactions_get- Get all reactions for a specific messageslack_reactions_list- List items the user has reacted to
slack_views_open- Open modal dialogsslack_views_update- Update existing modalsslack_views_push- Push new views onto the modal stack
cd slack_mcp_server
npm install
npm run build- Create Slack App: Visit Slack Apps
- Configure Bot Token Scopes:
channels:history # View messages in public channels channels:read # View basic channel information channels:manage # Create, archive, rename channels chat:write # Send messages reactions:read # View reactions reactions:write # Add and remove reactions users:read # View users and their basic information users.profile:read # View detailed user profiles canvases:read # Access canvas contents canvases:write # Create, edit and remove canvases files:read # View files in workspace files:write # Upload and delete files search:read # Search messages and files reminders:read # View reminders reminders:write # Create and delete reminders pins:read # View pinned items pins:write # Pin and unpin items groups:read # View private channels groups:write # Manage private channels - Install to Workspace and copy the Bot Token (
xoxb-...) - Get Team ID (starts with
T)
{
"mcpServers": {
"slack": {
"command": "node",
"args": ["slack_mcp_server/dist/index.js"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-actual-token-here",
"SLACK_USER_TOKEN": "xoxp-your-user-token-here",
"SLACK_TEAM_ID": "T1234567890",
"SLACK_MCP_LOG_LEVEL": "info"
}
}
}
}Notes:
SLACK_CHANNEL_IDSis no longer needed! The server now dynamically discovers all channels.SLACK_USER_TOKENis required for file uploads, reminders, search operations, and some Canvas operations.
{
"title": "Q1 Project Status",
"document_content": {
"type": "markdown",
"markdown": "# Q1 Project Status\n\n## π― Goals\n- [ ] Launch Feature A\n- [ ] Improve Performance\n\n## π Progress\n75% complete\n\n## π₯ Team\n- @U123456 (Lead)\n- @U789012 (Dev)"
},
"channel_id": "C123456789"
}{
"canvas_id": "F1234567890",
"changes": [
{
"operation": "insert_at_end",
"document_content": {
"type": "markdown",
"markdown": "\n\n## π Next Steps\n1. Code review\n2. QA testing\n3. Production deployment"
}
},
{
"operation": "insert_at_end",
"document_content": {
"type": "markdown",
"markdown": "\n\n## π
Timeline\n- **Week 1**: Development\n- **Week 2**: Testing\n- **Week 3**: Launch"
}
}
]
}Canvas supports rich markdown with Slack-specific elements:
# Project Dashboard
## π₯ Team Members
- @U123456 (displays as user card)
- @U789012 (project lead)
## π’ Channels
-  - Project Channel (displays as channel link)
-  - General Discussion
## π Status
:large_green_circle: On Track
:warning: Needs Attention
:red_circle: Blocked
## π Tasks
- [x] Setup repository
- [ ] Implement auth
- [ ] Deploy to staging
## π» Code
\`\`\`javascript
const config = {
apiUrl: 'https://api.example.com'
};
\`\`\`
## π Resources
[Design Doc](https://example.com/design){
"content": "# Project Report\n\n## Summary\nQ1 performance exceeded expectations...",
"filename": "q1-report.md",
"title": "Q1 2024 Report",
"initial_comment": "Here's the Q1 report for review",
"channels": ["C123456789"]
}{
"query": "type:pdf from:U123456",
"sort": "timestamp",
"sort_dir": "desc"
}{
"query": "from:@alice in:#general has:link during:today",
"sort": "timestamp",
"highlight": true
}from:@username- Messages from specific userin:#channel- Messages in specific channelhas:link- Messages containing linkshas:star- Starred messagesduring:today- Time-based filters"exact phrase"- Exact phrase matching
{
"text": "Review pull requests",
"time": "tomorrow at 9am"
}{
"text": "Submit timesheet",
"time": "Friday at 5pm",
"user": "U789012"
}- Unix timestamp:
1234567890(seconds since epoch, must be in the future) - Natural language:
"in 2 hours","next Monday","tomorrow at 3pm" - Specific times:
"3:00pm","15:30","9am tomorrow" - Relative times:
"in 30 minutes","2 hours from now"
- Time zone: Natural language times use the user's Slack timezone
- Past times: Cannot create reminders for times in the past
- User token required: Must have
SLACK_USER_TOKENwithreminders:writescope - Format errors: Avoid ambiguous times like "soon" or "later"
{
"name": "project-alpha",
"is_private": false
}{
"channel": "C123456789",
"users": "U123456,U789012,U345678"
}// Set topic
{
"channel": "C123456789",
"topic": "Q1 2024 Product Launch π"
}
// Set purpose
{
"channel": "C123456789",
"purpose": "Coordinate all activities for the Q1 product launch"
}{
"channel": "C123456789",
"timestamp": "1234567890.123456"
}{
"channel": "C123456789"
}
// Returns both pinned messages and files{
"channel": "C123456789",
"timestamp": "1234567890.123456",
"full": true // Get all reactions, not just first 25
}{
"channel": "C123456789",
"timestamp": "1234567890.123456",
"name": "thumbsup"
}{
"trigger_id": "12345.98765.abcd",
"view": {
"type": "modal",
"title": {
"type": "plain_text",
"text": "Feedback Form"
},
"blocks": [
{
"type": "input",
"block_id": "feedback_input",
"element": {
"type": "plain_text_input",
"multiline": true,
"action_id": "feedback"
},
"label": {
"type": "plain_text",
"text": "Share your feedback"
}
}
],
"submit": {
"type": "plain_text",
"text": "Submit"
}
}
}{
"view_id": "V123456",
"view": {
"type": "modal",
"title": {
"type": "plain_text",
"text": "Success!"
},
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "β
Your feedback has been submitted successfully!"
}
}
]
}
}# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coveragetest/slackClient.test.ts: SlackClient class unit teststest/mcpServer.test.ts: MCP server integration teststest/canvasFeatures.test.ts: Canvas API functionality teststest/filesApi.test.ts: Files API functionality teststest/searchApi.test.ts: Search API functionality teststest/reminderApi.test.ts: Reminder API functionality teststest/conversationApi.test.ts: Channel management API teststest/pinsApi.test.ts: Pins API functionality teststest/reactionsApi.test.ts: Extended reactions API teststest/viewsApi.test.ts: Views/Modals API teststest/e2e.test.ts: End-to-end workflow tests
- 80%+ coverage across all metrics
- Comprehensive error scenarios tested
- Performance tests for large operations
- End-to-end workflows validated
/slack_mcp_server/
βββ src/
β βββ index.ts # Main server implementation
βββ test/
β βββ setup.ts # Test configuration and mocks
β βββ slackClient.test.ts
β βββ mcpServer.test.ts
β βββ canvasFeatures.test.ts
β βββ e2e.test.ts
βββ package.json
βββ tsconfig.json
βββ jest.config.js
βββ README.md
npm run build # Compile TypeScript
npm run watch # Watch mode compilation
npm run test # Run test suite
npm run prepare # Build for distribution- Dynamic channel discovery: No more static channel configuration
- Complete Canvas API: Full create, read, update, delete operations
- File Management API: Upload, list, view, and delete files
- Search API: Search messages and files with advanced query syntax
- Reminder API: Create and manage reminders with natural language
- Channel Management: Create, archive, rename, and manage channels
- Pins API: Pin and unpin messages or files to channels
- Extended Reactions: Remove reactions and get detailed reaction data
- Views/Modals API: Create interactive modal dialogs
- Enhanced permissions: Comprehensive access control
- Comprehensive logging: Debug mode with detailed API tracking
- Comprehensive testing: 80%+ test coverage with 87 tests
- Better error handling: Graceful failure recovery with detailed error logs
- Environment variable removed:
SLACK_CHANNEL_IDSis no longer used - New permissions required: Multiple new scopes needed:
canvases:readandcanvases:writefor Canvas featuresfiles:readandfiles:writefor File managementsearch:readfor Search functionalityreminders:readandreminders:writefor Reminderschannels:managefor Channel creation and managementgroups:readandgroups:writefor Private channel managementpins:readandpins:writefor Pins functionalityreactions:readfor Extended reactions features
- User token required: Some features (files, reminders) need
SLACK_USER_TOKEN - Paid workspace requirement: Canvas features require paid Slack workspace
- All original MCP tools continue to work exactly as before
- Existing Claude Desktop configurations work (just remove
SLACK_CHANNEL_IDS) - No changes to existing tool interfaces
-
Canvas operations fail
- Ensure workspace is on a paid Slack plan
- Verify
canvases:readandcanvases:writescopes are added - Check that app is installed to workspace
-
Channel list is empty
- Verify
SLACK_TEAM_IDis correct - Ensure bot has access to channels (invite bot to private channels)
- Check
channels:readscope is enabled
- Verify
-
Permission errors
- Confirm all required scopes are added to Slack app
- Reinstall app to workspace after adding scopes
- Verify
SLACK_BOT_TOKENstarts withxoxb-
-
Search operations fail with "not_allowed_token_type"
- Ensure
SLACK_USER_TOKENis set (starts withxoxp-) - Search APIs require user tokens, not bot tokens
- User token must have
search:readscope
- Ensure
The server includes comprehensive logging to help debug issues with API calls.
SLACK_MCP_LOG_LEVEL: Control logging verbositydebug- All logs including debug informationinfo(default) - Information, warnings, and errorswarn- Only warnings and errorserror- Only errors
{
"mcpServers": {
"slack": {
"command": "node",
"args": ["slack_mcp_server/dist/index.js"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-...",
"SLACK_USER_TOKEN": "xoxp-...",
"SLACK_TEAM_ID": "T...",
"SLACK_MCP_LOG_LEVEL": "debug"
}
}
}
}- Color-coded output for easy reading
- Timestamps for all log entries
- API request/response details in debug mode
- Error stack traces for troubleshooting
- Slack API error details including missing scopes
-
API Permission Errors
[ERROR] Slack API error: missing_scope needed: channels:manage provided: channels:read,chat:write -
Network Issues
[ERROR] Network error for POST https://slack.com/api/chat.postMessage -
Tool Execution
[INFO] Tool called: slack_post_message [DEBUG] API Request: POST https://slack.com/api/chat.postMessage [SUCCESS] Tool slack_post_message completed successfully
MIT License - Copyright (c) 2024 jfcamel
This project extends the original Model Context Protocol Servers Slack implementation. See NOTICES file for attribution.
- Follow existing code patterns
- Add tests for new features
- Ensure 80%+ test coverage
- Update documentation
- Test with real Slack workspace
Ready to transform your Slack workspace management with MCP! π¨β¨