slack-mcp-server
The slack-mcp-server is an MCP server designed for accessing the Slack API. It enables AI assistants to interact with the Slack API through a standardized interface. Supporting multiple transport methods, it offers a range of functionalities for efficient communication and automation within Slack.
GitHub Stars
97
User Rating
Not Rated
Favorites
0
Views
107
Forks
21
Issues
3
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上npm: 8.0.0以上Installation
Installation
Prerequisites
Please specify required software and versions:Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version
Installation Steps
1. Clone Repository
bash
git clone https://github.com/ubie-oss/slack-mcp-server
cd slack-mcp-server
2. Install Dependencies
bash
npm install
3. Configure Claude Desktop
Editclaude_desktop_config.json to add the MCP server:
json
{
"mcpServers": {
"slack-mcp-server": {
"command": "node",
"args": ["path/to/server.js"]
}
}
}
4. Start Server
bash
npm start
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.Configuration
Configuration
Basic Configuration
Claude Desktop Setup
Edit~/.config/claude-desktop/claude_desktop_config.json (macOS/Linux) or
%APPDATA%\Claude\claude_desktop_config.json (Windows):
json
{
"mcpServers": {
"slack-mcp-server": {
"command": "npx",
"args": ["-y", "@ubie-oss/slack-mcp-server"],
"env": {
"SLACK_BOT_TOKEN": "",
"SLACK_USER_TOKEN": ""
}
}
}
}
Environment Variables
Set the following environment variables as needed:bash
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_USER_TOKEN="xoxp-your-user-token"
Advanced Configuration
Security Settings
Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels
Performance Tuning
Configure timeout values
Limit concurrent executions
Set up caching
Configuration Examples
Basic Configuration
json
{
"mcpServers": {
"slack-mcp-server": {
"command": "npx",
"args": ["-y", "@ubie-oss/slack-mcp-server"],
"env": {
"SLACK_BOT_TOKEN": "",
"SLACK_USER_TOKEN": ""
}
}
}
}
Examples
Examples
Basic Usage
Here are basic usage examples for the MCP server:Using with Claude Desktop
1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands
Available tools from this MCP server:
- slack_list_channels: List public channels in the workspace
- slack_post_message: Post a message to a Slack channel
Programmatic Usage
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('slack_post_message', {
channel: 'general',
text: 'Hello, Slack!'
});
console.log(result);
Advanced Examples
Automation Script
bash
#!/bin/bash
Batch processing example
for file in *.txt; do
mcp-tool process "$file"
done
API Integration
python
Python example
import requests
import json
def call_mcp_tool(tool_name, params):
response = requests.post(
'http://localhost:3000/mcp/call',
json={
'tool': tool_name,
'parameters': params
}
)
return response.json()
Usage example
result = call_mcp_tool('slack_search_messages', {
'query': 'Hello',
'in_channel': 'general'
})
Use Cases
Creating a bot that automatically posts messages to Slack channels.
Developing an application that searches for messages from specific users and displays results.
Building a system that automatically replies to threads within Slack.
Creating a data analysis tool that retrieves and analyzes channel history.