bitengineers/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 with Canvas Support is an enhanced server for the Slack API, designed to facilitate AI assistants like Claude in interacting with Slack workspaces, including comprehensive Canvas functionality and dynamic channel support.
slack_list_channels
Fetches all channels dynamically.
slack_post_message
Post messages to any channel.
slack_canvas_create
Create standalone canvases.
slack_files_upload
Upload files to Slack.
slack_search_messages
Search messages across workspace.
Slack MCP Server with Canvas Support
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.
โจ Key Features
๐ 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
๐จ Complete Canvas API Support
- 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
๐ ๏ธ Original Slack Features
All original Slack MCP server functionality is preserved and enhanced.
๐ Available Tools
Messaging & Communication
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
Canvas Management (NEW)
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
File Management (NEW)
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
Search (NEW)
slack_search_messages
- Search messages across workspaceslack_search_files
- Search files in workspace
Reminders (NEW)
slack_reminders_add
- Create remindersslack_reminders_list
- List active remindersslack_reminders_delete
- Delete reminders
Channel Management (NEW)
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
Pins (NEW)
slack_pins_add
- Pin messages or files to channelsslack_pins_remove
- Unpin items from channelsslack_pins_list
- List all pinned items in a channel
Extended Reactions (NEW)
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
Views/Modals (NEW)
slack_views_open
- Open modal dialogsslack_views_update
- Update existing modalsslack_views_push
- Push new views onto the modal stack
๐ Quick Start
1. Installation
cd slack_mcp_server
npm install
npm run build
2. Slack App Configuration
- 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
)
3. Claude Desktop Configuration
{
"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_IDS
is no longer needed! The server now dynamically discovers all channels.SLACK_USER_TOKEN
is required for file uploads, reminders, search operations, and some Canvas operations.
๐ฏ Canvas API Examples
Create a Project Status Canvas
{
"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"
}
Edit Canvas with Multiple Operations
{
"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 Markdown Features
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)
๐ File Management Examples
Upload a File
{
"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"]
}
Search Files
{
"query": "type:pdf from:U123456",
"sort": "timestamp",
"sort_dir": "desc"
}
๐ Search Examples
Search Messages with Operators
{
"query": "from:@alice in:#general has:link during:today",
"sort": "timestamp",
"highlight": true
}
Search Query Syntax
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
โฐ Reminder Examples
Create a Reminder
{
"text": "Review pull requests",
"time": "tomorrow at 9am"
}
Create Reminder for Another User
{
"text": "Submit timesheet",
"time": "Friday at 5pm",
"user": "U789012"
}
Time Formats Supported
- 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"
Common Issues with Reminders
- 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_TOKEN
withreminders:write
scope - Format errors: Avoid ambiguous times like "soon" or "later"
๐ข Channel Management Examples
Create a Channel
{
"name": "project-alpha",
"is_private": false
}
Invite Users to Channel
{
"channel": "C123456789",
"users": "U123456,U789012,U345678"
}
Set Channel Topic and Purpose
// Set topic
{
"channel": "C123456789",
"topic": "Q1 2024 Product Launch ๐"
}
// Set purpose
{
"channel": "C123456789",
"purpose": "Coordinate all activities for the Q1 product launch"
}
๐ Pins Examples
Pin a Message
{
"channel": "C123456789",
"timestamp": "1234567890.123456"
}
List Pinned Items
{
"channel": "C123456789"
}
// Returns both pinned messages and files
๐ Reactions Examples
Get All Reactions for a Message
{
"channel": "C123456789",
"timestamp": "1234567890.123456",
"full": true // Get all reactions, not just first 25
}
Remove a Reaction
{
"channel": "C123456789",
"timestamp": "1234567890.123456",
"name": "thumbsup"
}
๐ช Views/Modals Examples
Open a Modal Dialog
{
"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"
}
}
}
Update Modal Content
{
"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!"
}
}
]
}
}
๐งช Testing
Run Tests
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
Test Structure
test/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
Coverage Goals
- 80%+ coverage across all metrics
- Comprehensive error scenarios tested
- Performance tests for large operations
- End-to-end workflows validated
๐ง Development
Project Structure
/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
Build Commands
npm run build # Compile TypeScript
npm run watch # Watch mode compilation
npm run test # Run test suite
npm run prepare # Build for distribution
๐จ Important Changes from Original
โ What's New
- 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
โ ๏ธ Breaking Changes
- Environment variable removed:
SLACK_CHANNEL_IDS
is no longer used - New permissions required: Multiple new scopes needed:
canvases:read
andcanvases:write
for Canvas featuresfiles:read
andfiles:write
for File managementsearch:read
for Search functionalityreminders:read
andreminders:write
for Reminderschannels:manage
for Channel creation and managementgroups:read
andgroups:write
for Private channel managementpins:read
andpins:write
for Pins functionalityreactions:read
for Extended reactions features
- User token required: Some features (files, reminders) need
SLACK_USER_TOKEN
- Paid workspace requirement: Canvas features require paid Slack workspace
๐ Backward Compatibility
- 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
๐ Troubleshooting
Common Issues
-
Canvas operations fail
- Ensure workspace is on a paid Slack plan
- Verify
canvases:read
andcanvases:write
scopes are added - Check that app is installed to workspace
-
Channel list is empty
- Verify
SLACK_TEAM_ID
is correct - Ensure bot has access to channels (invite bot to private channels)
- Check
channels:read
scope is enabled
- Verify
-
Permission errors
- Confirm all required scopes are added to Slack app
- Reinstall app to workspace after adding scopes
- Verify
SLACK_BOT_TOKEN
starts withxoxb-
-
Search operations fail with "not_allowed_token_type"
- Ensure
SLACK_USER_TOKEN
is set (starts withxoxp-
) - Search APIs require user tokens, not bot tokens
- User token must have
search:read
scope
- Ensure
๐ Logging and Debugging
The server includes comprehensive logging to help debug issues with API calls.
Environment Variables
SLACK_MCP_LOG_LEVEL
: Control logging verbositydebug
- All logs including debug informationinfo
(default) - Information, warnings, and errorswarn
- Only warnings and errorserror
- Only errors
Example Debug Configuration
{
"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"
}
}
}
}
Log Output Features
- 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
Common Debug Scenarios
-
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
๐ License
MIT License - Copyright (c) 2024 jfcamel
This project extends the original Model Context Protocol Servers Slack implementation. See NOTICES file for attribution.
๐ค Contributing
- 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! ๐จโจ