slack-mcp-server


Nameslack-mcp-server JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol (MCP) server for Slack workspace integration using FastMCP with robust authentication and caching
upload_time2025-08-19 08:40:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords slack mcp model-context-protocol fastmcp http api authentication caching workspace
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Slack MCP Server

A Model Context Protocol (MCP) server for Slack workspace integration with comprehensive messaging, user management, and workspace analytics capabilities.

## Features

- **Conversation Management**: Message history, replies, search, and posting
- **User Operations**: Profile information, presence status, and bulk operations
- **Channel Management**: Channel info, member lists, topic/purpose settings
- **Workspace Analytics**: Workspace information, file management, and permissions
- **Caching System**: Intelligent caching for improved performance
- **Interactive Features**: Reactions, permalinks, and message threading
- **HTTP Transport**: RESTful API interface with Bearer token authentication
- **Stateless Architecture**: Each request is independent with no session management

## Quick Start

### Starting the Server

```bash
# Start HTTP server on port 30000 (default)
python slack_mcp_server_stateless.py

# Start on custom port
python slack_mcp_server_stateless.py --port 8080

# Start with debug logging
python slack_mcp_server_stateless.py --log-level DEBUG

# Install and run from PyPI
pip install slack-mcp-server
slack-mcp-server-stateless
```

The server provides these endpoints:
- **`POST /mcp`** - Main MCP endpoint for tool execution
- **`GET /health`** - Health check endpoint

### Authentication

All requests require a Slack Bot Token via Authorization header:

```bash
Authorization: Bearer xoxb-your-slack-bot-token
```

[Create a Slack App](https://api.slack.com/apps) and get a Bot User OAuth Token with appropriate scopes.

## Tools

The server provides 21 tools for comprehensive Slack API access. Each tool requires `Authorization: Bearer <token>` header.

### 1. conversations_history
Get message history from a channel or DM.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/call",
    "params": {
      "name": "conversations_history",
      "arguments": {
        "channel_id": "#general",
        "limit": "50",
        "include_user_details": true
      }
    }
  }'
```

### 2. users_list
Get list of users in the workspace.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "2",
    "method": "tools/call",
    "params": {
      "name": "users_list",
      "arguments": {
        "include_deleted": false,
        "include_bots": true,
        "use_cache": true
      }
    }
  }'
```

### 3. channel_info
Get detailed information about a specific channel.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "3",
    "method": "tools/call",
    "params": {
      "name": "channel_info",
      "arguments": {
        "channel_id": "#general",
        "include_locale": false
      }
    }
  }'
```

### 4. conversations_replies
Get replies to a specific message thread.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "4",
    "method": "tools/call",
    "params": {
      "name": "conversations_replies",
      "arguments": {
        "channel_id": "#general",
        "thread_ts": "1234567890.123456"
      }
    }
  }'
```

### 5. conversations_add_message
Post a message to a channel or DM.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "5",
    "method": "tools/call",
    "params": {
      "name": "conversations_add_message",
      "arguments": {
        "channel_id": "#general",
        "text": "Hello from Slack MCP Server!",
        "thread_ts": "1234567890.123456"
      }
    }
  }'
```

### 6. conversations_search_messages
Search for messages across the workspace.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "6",
    "method": "tools/call",
    "params": {
      "name": "conversations_search_messages",
      "arguments": {
        "query": "important project update",
        "count": 20,
        "sort": "timestamp"
      }
    }
  }'
```

### 7. bulk_conversations_history
Get message history from multiple channels efficiently.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "7",
    "method": "tools/call",
    "params": {
      "name": "bulk_conversations_history",
      "arguments": {
        "channel_ids": "#general,#random,#dev",
        "limit": "1d",
        "include_user_details": true
      }
    }
  }'
```

### 8. user_info
Get detailed information about users.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "8",
    "method": "tools/call",
    "params": {
      "name": "user_info",
      "arguments": {
        "user_ids": "@john,@jane,U123456789",
        "use_cache": true
      }
    }
  }'
```

### 9. user_presence
Get user presence status.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "9",
    "method": "tools/call",
    "params": {
      "name": "user_presence",
      "arguments": {
        "user_id": "@john"
      }
    }
  }'
```

### 10. channel_members
Get list of members in a channel.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "10",
    "method": "tools/call",
    "params": {
      "name": "channel_members",
      "arguments": {
        "channel_id": "#general"
      }
    }
  }'
```

### 11. channels_list
Get list of all channels.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "11",
    "method": "tools/call",
    "params": {
      "name": "channels_list",
      "arguments": {
        "exclude_archived": true,
        "types": "public_channel,private_channel"
      }
    }
  }'
```

### 12. channels_detailed
Get detailed information about multiple channels.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "12",
    "method": "tools/call",
    "params": {
      "name": "channels_detailed",
      "arguments": {
        "channel_ids": "#general,#random,#dev"
      }
    }
  }'
```

### 13. set_channel_topic
Set the topic for a channel.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "13",
    "method": "tools/call",
    "params": {
      "name": "set_channel_topic",
      "arguments": {
        "channel_id": "#general",
        "topic": "Welcome to our general discussion channel"
      }
    }
  }'
```

### 14. set_channel_purpose
Set the purpose for a channel.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "14",
    "method": "tools/call",
    "params": {
      "name": "set_channel_purpose",
      "arguments": {
        "channel_id": "#general",
        "purpose": "General team discussions and announcements"
      }
    }
  }'
```

### 15. workspace_info
Get workspace information and analytics.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "15",
    "method": "tools/call",
    "params": {
      "name": "workspace_info",
      "arguments": {}
    }
  }'
```

### 16. message_permalink
Get a permanent link to a message.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "16",
    "method": "tools/call",
    "params": {
      "name": "message_permalink",
      "arguments": {
        "channel_id": "#general",
        "message_ts": "1234567890.123456"
      }
    }
  }'
```

### 17. add_reaction
Add an emoji reaction to a message.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "17",
    "method": "tools/call",
    "params": {
      "name": "add_reaction",
      "arguments": {
        "channel_id": "#general",
        "timestamp": "1234567890.123456",
        "name": "thumbsup"
      }
    }
  }'
```

### 18. files_list
List files in the workspace.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "18",
    "method": "tools/call",
    "params": {
      "name": "files_list",
      "arguments": {
        "channel": "#general",
        "count": 20,
        "types": "images,pdfs,docs"
      }
    }
  }'
```

### 19. initialize_cache
Initialize the user and channel cache.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "19",
    "method": "tools/call",
    "params": {
      "name": "initialize_cache",
      "arguments": {
        "force_refresh": false
      }
    }
  }'
```

### 20. cache_info
Get information about the current cache status.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "20",
    "method": "tools/call",
    "params": {
      "name": "cache_info",
      "arguments": {}
    }
  }'
```

### 21. clear_cache
Clear the user and channel cache.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "21",
    "method": "tools/call",
    "params": {
      "name": "clear_cache",
      "arguments": {}
    }
  }'
```

### 22. check_permissions
Check bot permissions and scopes.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "22",
    "method": "tools/call",
    "params": {
      "name": "check_permissions",
      "arguments": {}
    }
  }'
```

### 23. analytics_summary
Get workspace analytics and usage summary.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "23",
    "method": "tools/call",
    "params": {
      "name": "analytics_summary",
      "arguments": {
        "limit": "30d"
      }
    }
  }'
```

## List Available Tools

Get the complete list of available tools:

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer xoxb-your-slack-bot-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "tools-list",
    "method": "tools/list",
    "params": {}
  }'
```

## Installation

### From PyPI
```bash
pip install slack-mcp-server
slack-mcp-server-stateless
```

### From Source
```bash
pip install -r requirements.txt
python slack_mcp_server_stateless.py
```

## Authentication Setup

1. **Create a Slack App:**
   - Go to [Slack API Apps](https://api.slack.com/apps)
   - Click "Create New App" → "From scratch"
   - Name your app and select your workspace

2. **Configure OAuth & Permissions:**
   - Go to "OAuth & Permissions" in your app settings
   - Add the following Bot Token Scopes:
     - `channels:history` - View messages in public channels
     - `channels:read` - View basic information about public channels
     - `chat:write` - Send messages as the app
     - `groups:history` - View messages in private channels
     - `groups:read` - View basic information about private channels
     - `im:history` - View messages in direct messages
     - `im:read` - View basic information about direct messages
     - `mpim:history` - View messages in group direct messages
     - `mpim:read` - View basic information about group direct messages
     - `reactions:write` - Add and remove emoji reactions
     - `users:read` - View people in the workspace
     - `files:read` - View files shared in channels and conversations

3. **Install App to Workspace:**
   - Click "Install to Workspace"
   - Copy the Bot User OAuth Token (starts with `xoxb-`)

4. **Configure Token:**
   - Set environment variable: `SLACK_BOT_TOKEN=xoxb-your-token`
   - Or pass via `Authorization: Bearer` header in requests

## Usage with Claude Desktop

Add the following to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "slack": {
      "command": "python",
      "args": ["/path/to/slack_mcp_server_stateless.py"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-slack-bot-token"
      }
    }
  }
}
```

## Configuration

### Environment Variables

```bash
# Required
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token

# Optional
SLACK_MCP_USERS_CACHE=~/slack-cache/users_cache.json
SLACK_MCP_CHANNELS_CACHE=~/slack-cache/channels_cache_v2.json
```

### Cache Configuration

The server uses intelligent caching to improve performance:
- **User Cache**: Stores user information to reduce API calls
- **Channel Cache**: Stores channel metadata for faster lookups
- **Auto-refresh**: Cache automatically refreshes when data is stale
- **Fallback**: Falls back to API calls when cache is unavailable

## Use Cases

### Team Communication Analysis
- Analyze message patterns and team engagement
- Track conversation threads and response times
- Monitor channel activity and participation

### Workspace Management
- Audit channel permissions and membership
- Manage channel topics and purposes
- Track file sharing and workspace usage

### Automation & Integrations
- Automate message posting and reactions
- Create custom notification systems
- Build workspace analytics dashboards

### Content Discovery
- Search across all workspace conversations
- Find important messages and decisions
- Track project-related discussions

## Error Handling

The server provides detailed error messages for common issues:
- **401**: Invalid or expired Slack token
- **403**: Insufficient permissions or missing scopes
- **404**: Channel, user, or message not found
- **429**: Rate limit exceeded
- **500**: Internal server errors

## Slack API Concepts

### Channel IDs
- Public channels: `#general` or `C1234567890`
- Private channels: `#private-team` or `G1234567890`
- Direct messages: `@username` or `D1234567890`

### User IDs
- Username format: `@john.doe`
- User ID format: `U1234567890`
- Display name: `@John Doe`

### Message Timestamps
- Format: Unix timestamp with microseconds (`1234567890.123456`)
- Used for message threading and permalinks

## Development

### Run in Development Mode
```bash
python slack_mcp_server_stateless.py --log-level DEBUG --port 8080
```

### Testing
```bash
python test_final.py
```

## License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "slack-mcp-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "slack, mcp, model-context-protocol, fastmcp, http, api, authentication, caching, workspace",
    "author": null,
    "author_email": "Your Name <your.email@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/5e/2e/8b5480b15ea67d0d975d8795fcc451a6bf500e2bca1c0934f0be68f90533/slack_mcp_server-0.2.1.tar.gz",
    "platform": null,
    "description": "# Slack MCP Server\n\nA Model Context Protocol (MCP) server for Slack workspace integration with comprehensive messaging, user management, and workspace analytics capabilities.\n\n## Features\n\n- **Conversation Management**: Message history, replies, search, and posting\n- **User Operations**: Profile information, presence status, and bulk operations\n- **Channel Management**: Channel info, member lists, topic/purpose settings\n- **Workspace Analytics**: Workspace information, file management, and permissions\n- **Caching System**: Intelligent caching for improved performance\n- **Interactive Features**: Reactions, permalinks, and message threading\n- **HTTP Transport**: RESTful API interface with Bearer token authentication\n- **Stateless Architecture**: Each request is independent with no session management\n\n## Quick Start\n\n### Starting the Server\n\n```bash\n# Start HTTP server on port 30000 (default)\npython slack_mcp_server_stateless.py\n\n# Start on custom port\npython slack_mcp_server_stateless.py --port 8080\n\n# Start with debug logging\npython slack_mcp_server_stateless.py --log-level DEBUG\n\n# Install and run from PyPI\npip install slack-mcp-server\nslack-mcp-server-stateless\n```\n\nThe server provides these endpoints:\n- **`POST /mcp`** - Main MCP endpoint for tool execution\n- **`GET /health`** - Health check endpoint\n\n### Authentication\n\nAll requests require a Slack Bot Token via Authorization header:\n\n```bash\nAuthorization: Bearer xoxb-your-slack-bot-token\n```\n\n[Create a Slack App](https://api.slack.com/apps) and get a Bot User OAuth Token with appropriate scopes.\n\n## Tools\n\nThe server provides 21 tools for comprehensive Slack API access. Each tool requires `Authorization: Bearer <token>` header.\n\n### 1. conversations_history\nGet message history from a channel or DM.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"1\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"conversations_history\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"limit\": \"50\",\n        \"include_user_details\": true\n      }\n    }\n  }'\n```\n\n### 2. users_list\nGet list of users in the workspace.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"2\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"users_list\",\n      \"arguments\": {\n        \"include_deleted\": false,\n        \"include_bots\": true,\n        \"use_cache\": true\n      }\n    }\n  }'\n```\n\n### 3. channel_info\nGet detailed information about a specific channel.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"3\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"channel_info\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"include_locale\": false\n      }\n    }\n  }'\n```\n\n### 4. conversations_replies\nGet replies to a specific message thread.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"4\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"conversations_replies\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"thread_ts\": \"1234567890.123456\"\n      }\n    }\n  }'\n```\n\n### 5. conversations_add_message\nPost a message to a channel or DM.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"5\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"conversations_add_message\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"text\": \"Hello from Slack MCP Server!\",\n        \"thread_ts\": \"1234567890.123456\"\n      }\n    }\n  }'\n```\n\n### 6. conversations_search_messages\nSearch for messages across the workspace.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"6\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"conversations_search_messages\",\n      \"arguments\": {\n        \"query\": \"important project update\",\n        \"count\": 20,\n        \"sort\": \"timestamp\"\n      }\n    }\n  }'\n```\n\n### 7. bulk_conversations_history\nGet message history from multiple channels efficiently.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"7\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"bulk_conversations_history\",\n      \"arguments\": {\n        \"channel_ids\": \"#general,#random,#dev\",\n        \"limit\": \"1d\",\n        \"include_user_details\": true\n      }\n    }\n  }'\n```\n\n### 8. user_info\nGet detailed information about users.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"8\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"user_info\",\n      \"arguments\": {\n        \"user_ids\": \"@john,@jane,U123456789\",\n        \"use_cache\": true\n      }\n    }\n  }'\n```\n\n### 9. user_presence\nGet user presence status.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"9\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"user_presence\",\n      \"arguments\": {\n        \"user_id\": \"@john\"\n      }\n    }\n  }'\n```\n\n### 10. channel_members\nGet list of members in a channel.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"10\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"channel_members\",\n      \"arguments\": {\n        \"channel_id\": \"#general\"\n      }\n    }\n  }'\n```\n\n### 11. channels_list\nGet list of all channels.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"11\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"channels_list\",\n      \"arguments\": {\n        \"exclude_archived\": true,\n        \"types\": \"public_channel,private_channel\"\n      }\n    }\n  }'\n```\n\n### 12. channels_detailed\nGet detailed information about multiple channels.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"12\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"channels_detailed\",\n      \"arguments\": {\n        \"channel_ids\": \"#general,#random,#dev\"\n      }\n    }\n  }'\n```\n\n### 13. set_channel_topic\nSet the topic for a channel.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"13\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"set_channel_topic\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"topic\": \"Welcome to our general discussion channel\"\n      }\n    }\n  }'\n```\n\n### 14. set_channel_purpose\nSet the purpose for a channel.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"14\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"set_channel_purpose\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"purpose\": \"General team discussions and announcements\"\n      }\n    }\n  }'\n```\n\n### 15. workspace_info\nGet workspace information and analytics.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"15\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"workspace_info\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n### 16. message_permalink\nGet a permanent link to a message.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"16\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"message_permalink\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"message_ts\": \"1234567890.123456\"\n      }\n    }\n  }'\n```\n\n### 17. add_reaction\nAdd an emoji reaction to a message.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"17\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"add_reaction\",\n      \"arguments\": {\n        \"channel_id\": \"#general\",\n        \"timestamp\": \"1234567890.123456\",\n        \"name\": \"thumbsup\"\n      }\n    }\n  }'\n```\n\n### 18. files_list\nList files in the workspace.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"18\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"files_list\",\n      \"arguments\": {\n        \"channel\": \"#general\",\n        \"count\": 20,\n        \"types\": \"images,pdfs,docs\"\n      }\n    }\n  }'\n```\n\n### 19. initialize_cache\nInitialize the user and channel cache.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"19\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"initialize_cache\",\n      \"arguments\": {\n        \"force_refresh\": false\n      }\n    }\n  }'\n```\n\n### 20. cache_info\nGet information about the current cache status.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"20\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"cache_info\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n### 21. clear_cache\nClear the user and channel cache.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"21\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"clear_cache\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n### 22. check_permissions\nCheck bot permissions and scopes.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"22\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"check_permissions\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n### 23. analytics_summary\nGet workspace analytics and usage summary.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"23\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"analytics_summary\",\n      \"arguments\": {\n        \"limit\": \"30d\"\n      }\n    }\n  }'\n```\n\n## List Available Tools\n\nGet the complete list of available tools:\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer xoxb-your-slack-bot-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"tools-list\",\n    \"method\": \"tools/list\",\n    \"params\": {}\n  }'\n```\n\n## Installation\n\n### From PyPI\n```bash\npip install slack-mcp-server\nslack-mcp-server-stateless\n```\n\n### From Source\n```bash\npip install -r requirements.txt\npython slack_mcp_server_stateless.py\n```\n\n## Authentication Setup\n\n1. **Create a Slack App:**\n   - Go to [Slack API Apps](https://api.slack.com/apps)\n   - Click \"Create New App\" \u2192 \"From scratch\"\n   - Name your app and select your workspace\n\n2. **Configure OAuth & Permissions:**\n   - Go to \"OAuth & Permissions\" in your app settings\n   - Add the following Bot Token Scopes:\n     - `channels:history` - View messages in public channels\n     - `channels:read` - View basic information about public channels\n     - `chat:write` - Send messages as the app\n     - `groups:history` - View messages in private channels\n     - `groups:read` - View basic information about private channels\n     - `im:history` - View messages in direct messages\n     - `im:read` - View basic information about direct messages\n     - `mpim:history` - View messages in group direct messages\n     - `mpim:read` - View basic information about group direct messages\n     - `reactions:write` - Add and remove emoji reactions\n     - `users:read` - View people in the workspace\n     - `files:read` - View files shared in channels and conversations\n\n3. **Install App to Workspace:**\n   - Click \"Install to Workspace\"\n   - Copy the Bot User OAuth Token (starts with `xoxb-`)\n\n4. **Configure Token:**\n   - Set environment variable: `SLACK_BOT_TOKEN=xoxb-your-token`\n   - Or pass via `Authorization: Bearer` header in requests\n\n## Usage with Claude Desktop\n\nAdd the following to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"slack\": {\n      \"command\": \"python\",\n      \"args\": [\"/path/to/slack_mcp_server_stateless.py\"],\n      \"env\": {\n        \"SLACK_BOT_TOKEN\": \"xoxb-your-slack-bot-token\"\n      }\n    }\n  }\n}\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\n# Required\nSLACK_BOT_TOKEN=xoxb-your-slack-bot-token\n\n# Optional\nSLACK_MCP_USERS_CACHE=~/slack-cache/users_cache.json\nSLACK_MCP_CHANNELS_CACHE=~/slack-cache/channels_cache_v2.json\n```\n\n### Cache Configuration\n\nThe server uses intelligent caching to improve performance:\n- **User Cache**: Stores user information to reduce API calls\n- **Channel Cache**: Stores channel metadata for faster lookups\n- **Auto-refresh**: Cache automatically refreshes when data is stale\n- **Fallback**: Falls back to API calls when cache is unavailable\n\n## Use Cases\n\n### Team Communication Analysis\n- Analyze message patterns and team engagement\n- Track conversation threads and response times\n- Monitor channel activity and participation\n\n### Workspace Management\n- Audit channel permissions and membership\n- Manage channel topics and purposes\n- Track file sharing and workspace usage\n\n### Automation & Integrations\n- Automate message posting and reactions\n- Create custom notification systems\n- Build workspace analytics dashboards\n\n### Content Discovery\n- Search across all workspace conversations\n- Find important messages and decisions\n- Track project-related discussions\n\n## Error Handling\n\nThe server provides detailed error messages for common issues:\n- **401**: Invalid or expired Slack token\n- **403**: Insufficient permissions or missing scopes\n- **404**: Channel, user, or message not found\n- **429**: Rate limit exceeded\n- **500**: Internal server errors\n\n## Slack API Concepts\n\n### Channel IDs\n- Public channels: `#general` or `C1234567890`\n- Private channels: `#private-team` or `G1234567890`\n- Direct messages: `@username` or `D1234567890`\n\n### User IDs\n- Username format: `@john.doe`\n- User ID format: `U1234567890`\n- Display name: `@John Doe`\n\n### Message Timestamps\n- Format: Unix timestamp with microseconds (`1234567890.123456`)\n- Used for message threading and permalinks\n\n## Development\n\n### Run in Development Mode\n```bash\npython slack_mcp_server_stateless.py --log-level DEBUG --port 8080\n```\n\n### Testing\n```bash\npython test_final.py\n```\n\n## License\n\nThis MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Model Context Protocol (MCP) server for Slack workspace integration using FastMCP with robust authentication and caching",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/slack-mcp-server",
        "Issues": "https://github.com/yourusername/slack-mcp-server/issues",
        "Repository": "https://github.com/yourusername/slack-mcp-server"
    },
    "split_keywords": [
        "slack",
        " mcp",
        " model-context-protocol",
        " fastmcp",
        " http",
        " api",
        " authentication",
        " caching",
        " workspace"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a8e2eca800ae0244167cd72e5e8373522c25a747472cd25e3af607e396d5dcfb",
                "md5": "829276477cdab7b2eaae1ec42819c762",
                "sha256": "f79d7734138ca76f41055dc335bfa173dd9a8a15e2739a86cb291ba61f9eb351"
            },
            "downloads": -1,
            "filename": "slack_mcp_server-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "829276477cdab7b2eaae1ec42819c762",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 33926,
            "upload_time": "2025-08-19T08:40:53",
            "upload_time_iso_8601": "2025-08-19T08:40:53.610218Z",
            "url": "https://files.pythonhosted.org/packages/a8/e2/eca800ae0244167cd72e5e8373522c25a747472cd25e3af607e396d5dcfb/slack_mcp_server-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5e2e8b5480b15ea67d0d975d8795fcc451a6bf500e2bca1c0934f0be68f90533",
                "md5": "519c6620ae910e43f83ab8e8519216ff",
                "sha256": "81681d7b3b4abc04db26c266961f35d1e8f897ccc6c4f7309da798ea20723823"
            },
            "downloads": -1,
            "filename": "slack_mcp_server-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "519c6620ae910e43f83ab8e8519216ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 33397,
            "upload_time": "2025-08-19T08:40:55",
            "upload_time_iso_8601": "2025-08-19T08:40:55.268697Z",
            "url": "https://files.pythonhosted.org/packages/5e/2e/8b5480b15ea67d0d975d8795fcc451a6bf500e2bca1c0934f0be68f90533/slack_mcp_server-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-19 08:40:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "slack-mcp-server",
    "github_not_found": true,
    "lcname": "slack-mcp-server"
}
        
Elapsed time: 0.97445s