{"_id":"@benbroks/slack-mcp-server","_rev":"2-6f7b18f0b63bd7fe85b8dc95c9d638c7","name":"@benbroks/slack-mcp-server","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@benbroks/slack-mcp-server","version":"1.0.0","author":{"name":"benbroks"},"license":"MIT","_id":"@benbroks/slack-mcp-server@1.0.0","maintainers":[{"name":"ben_brooks","email":"benjamin.james.brooks@gmail.com"}],"homepage":"https://github.com/benbroks/slack-mcp-server","bugs":{"url":"https://github.com/benbroks/slack-mcp-server/issues"},"bin":{"slack-mcp":"dist/index.js"},"dist":{"shasum":"07e58cd97ba68f3eee304941859c61620c57007d","tarball":"https://registry.npmjs.org/@benbroks/slack-mcp-server/-/slack-mcp-server-1.0.0.tgz","fileCount":5,"integrity":"sha512-JpR4qJSvIGMA+ejk8YGivRMxQQlFQD9igg8wjRLntSL1TBOkg/IEfhR752FFTRG60TVE0KPa04/T9ijdEYOWxA==","signatures":[{"sig":"MEYCIQDHyai26s91ZEDJ2vfF1J57fKT+eae2O6GHXQetSyAxJwIhAPoXDs9LrZK3m10excXxa8pDgKUHJJ656QZgfqe7RWgP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61100},"type":"module","gitHead":"e17c56efd62e54448d46cffa456decfbe2fdba55","scripts":{"test":"node --experimental-vm-modules node_modules/.bin/jest","build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","test:watch":"node --experimental-vm-modules node_modules/.bin/jest --watch","test:coverage":"node --experimental-vm-modules node_modules/.bin/jest --coverage"},"_npmUser":{"name":"ben_brooks","email":"benjamin.james.brooks@gmail.com"},"repository":{"url":"git+https://github.com/benbroks/slack-mcp-server.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for interacting with Slack","directories":{},"_nodeVersion":"22.13.1","dependencies":{"zod":"^3.22.4","express":"^5.1.0","@modelcontextprotocol/sdk":"1.15.1"},"_hasShrinkwrap":false,"devDependencies":{"shx":"^0.4.0","jest":"^30.0.4","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/node":"^24","@jest/globals":"^30.0.4","@types/express":"^4.17.21"},"_npmOperationalInternal":{"tmp":"tmp/slack-mcp-server_1.0.0_1770738303710_0.7053618998431748","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@benbroks/slack-mcp-server","version":"1.0.1","description":"MCP server for interacting with Slack","license":"MIT","author":{"name":"benbroks"},"homepage":"https://github.com/benbroks/slack-mcp-server","repository":{"type":"git","url":"git+https://github.com/benbroks/slack-mcp-server.git"},"bugs":{"url":"https://github.com/benbroks/slack-mcp-server/issues"},"type":"module","bin":{"slack-mcp":"dist/index.js"},"scripts":{"build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","test":"node --experimental-vm-modules node_modules/.bin/jest","test:watch":"node --experimental-vm-modules node_modules/.bin/jest --watch","test:coverage":"node --experimental-vm-modules node_modules/.bin/jest --coverage"},"dependencies":{"@modelcontextprotocol/sdk":"1.15.1","express":"^5.1.0","zod":"^3.22.4"},"devDependencies":{"@jest/globals":"^30.0.4","@types/express":"^4.17.21","@types/jest":"^30.0.0","@types/node":"^24","jest":"^30.0.4","shx":"^0.4.0","ts-jest":"^29.4.0","typescript":"^5.8.3"},"_id":"@benbroks/slack-mcp-server@1.0.1","gitHead":"ed8ae60bdbc89ca5891f7d3557d01cde1cf31546","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Tqa0QM+c45zsfVWRBqZeUf262bxvhxSCGoO9+G5C09l+b1UPdpDttlqJgwFVvCqQS0BGBnUyvLWCnX0RH5G5mQ==","shasum":"7f964d41c851d33f9ea2147676afa83d125483ec","tarball":"https://registry.npmjs.org/@benbroks/slack-mcp-server/-/slack-mcp-server-1.0.1.tgz","fileCount":5,"unpackedSize":61058,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDn6fJfopUu8G6boDf4ppj7rc0twdFHJ7twtEQXsMeDCgIhAJgSxtBhV5YHjYBGHdSqCZENmu0ZDzcOevDAeyVwo7Jo"}]},"_npmUser":{"name":"ben_brooks","email":"benjamin.james.brooks@gmail.com"},"directories":{},"maintainers":[{"name":"ben_brooks","email":"benjamin.james.brooks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slack-mcp-server_1.0.1_1770738479632_0.5039681452356866"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-10T15:45:03.576Z","modified":"2026-02-10T15:47:59.914Z","1.0.0":"2026-02-10T15:45:03.869Z","1.0.1":"2026-02-10T15:47:59.783Z"},"bugs":{"url":"https://github.com/benbroks/slack-mcp-server/issues"},"author":{"name":"benbroks"},"license":"MIT","homepage":"https://github.com/benbroks/slack-mcp-server","repository":{"type":"git","url":"git+https://github.com/benbroks/slack-mcp-server.git"},"description":"MCP server for interacting with Slack","maintainers":[{"name":"ben_brooks","email":"benjamin.james.brooks@gmail.com"}],"readme":"# slack-mcp-server\n## Disclaimer\nThis project includes [code](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack) originally developed by Anthropic and released under the MIT License. Substantial modifications and new functionality have been added by For Good AI Inc. (dba Zencoder Inc.), and are licensed under the Apache License, Version 2.0.\n\n## Overview\nA Model Context Protocol (MCP) server for interacting with Slack workspaces. This server provides tools to search channels, post messages, reply to threads, add reactions, get channel history, and manage users.\n\n## Available Tools\n\n1. **slack_search_channels**\n   - Search for channels by name using the cached channel list\n   - Supports partial, case-insensitive matching\n   - Automatically strips # prefix from queries\n   - Required inputs:\n     - `query` (string): Channel name to search for (partial match, case-insensitive, # prefix optional)\n   - Returns: List of matching channels with their IDs and information\n\n2. **slack_post_message**\n   - Post a new message to a Slack channel or direct message to user\n   - Required inputs:\n     - `channel_id` (string): The ID of the channel to post to\n     - `text` (string): The message text to post\n   - Returns: Message posting confirmation and timestamp\n\n3. **slack_reply_to_thread**\n   - Reply to a specific message thread\n   - Required inputs:\n     - `channel_id` (string): The channel containing the thread\n     - `thread_ts` (string): Timestamp of the parent message in the format '1234567890.123456'. Timestamps without the period can be converted by adding the period such that 6 numbers come after it.\n     - `text` (string): The reply text\n   - Returns: Reply confirmation and timestamp\n\n4. **slack_add_reaction**\n   - Add an emoji reaction to a message\n   - Required inputs:\n     - `channel_id` (string): The channel containing the message\n     - `timestamp` (string): Message timestamp to react to\n     - `reaction` (string): Emoji name without colons\n   - Returns: Reaction confirmation\n\n5. **slack_get_channel_history**\n   - Get messages from a channel within a time range\n   - **Default behavior**: Retrieves last 24 hours of messages if no time range specified\n   - **Timestamp formats supported**: ISO date strings, Unix timestamps, or Slack timestamps\n   - **Messages matching exact timestamps are included** (inclusive behavior)\n   - Required inputs:\n     - `channel_id` (string): The channel ID\n   - Optional inputs:\n     - `oldest` (string | number): Start of time range. Accepts:\n       - ISO date string (e.g., `'2024-01-15T10:00:00Z'`)\n       - Unix timestamp (e.g., `1609459200`)\n       - Slack timestamp (e.g., `'1609459200.123456'`)\n       - Defaults to 24 hours ago if not provided\n     - `latest` (string | number): End of time range. Same formats as `oldest`. Defaults to now if not provided.\n   - Returns: List of messages (up to 200) within the time range with their content and metadata\n   - **Examples**:\n     ```javascript\n     // Get last 24 hours (default)\n     { channel_id: 'C123456' }\n\n     // Get specific time range with ISO dates\n     { channel_id: 'C123456', oldest: '2024-01-15T10:00:00Z', latest: '2024-01-15T18:00:00Z' }\n\n     // Get specific time range with Unix timestamps\n     { channel_id: 'C123456', oldest: 1609459200, latest: 1609545600 }\n\n     // Get everything since a specific time (latest defaults to now)\n     { channel_id: 'C123456', oldest: '2024-01-15T00:00:00Z' }\n     ```\n\n6. **slack_get_thread_replies**\n   - Get all replies in a message thread\n   - Required inputs:\n     - `channel_id` (string): The channel containing the thread\n     - `thread_ts` (string): Timestamp of the parent message in the format '1234567890.123456'. Timestamps without the period can be converted by adding the period such that 6 numbers come after it.\n   - Returns: List of replies with their content and metadata\n\n7. **slack_get_users**\n   - Get list of workspace users with basic profile information\n   - Optional inputs:\n     - `cursor` (string): Pagination cursor for next page\n     - `limit` (number, default: 100, max: 200): Maximum users to return\n   - Returns: List of users with their basic profiles\n\n8. **slack_get_user_profile**\n   - Get detailed profile information for a specific user\n   - Required inputs:\n     - `user_id` (string): The user's ID\n   - Returns: Detailed user profile information\n\n## How Channel Search Works\n\nThe server initializes a local cache of all workspace channels on startup. The `slack_search_channels` tool performs fast, client-side searches against this cache rather than making API calls for each search. This provides:\n- Faster search responses\n- Partial name matching (e.g., searching \"gen\" will find \"general\")\n- Case-insensitive matching\n- Automatic # prefix handling\n\nThe cache is built once during server initialization by fetching all channels via pagination.\n\n## Slack Bot Setup\n\nTo use this MCP server, you need to create a Slack app and configure it with the necessary permissions:\n\n### 1. Create a Slack App\n- Visit the [Slack Apps page](https://api.slack.com/apps)\n- Click \"Create New App\"\n- Choose \"From scratch\"\n- Name your app and select your workspace\n\n### 2. Configure Bot Token Scopes\nNavigate to \"OAuth & Permissions\" and add these scopes:\n\n**Required scopes:**\n- `channels:history` - View messages and other content in public channels\n- `channels:read` - View basic channel information\n- `chat:write` - Send messages as the app\n- `reactions:write` - Add emoji reactions to messages\n- `users:read` - View users and their basic information\n- `users.profile:read` - View detailed profiles about users\n\n**Additional scopes for private channel access:**\n- `groups:history` - View messages in private channels\n- `groups:read` - View basic private channel information\n\n### 3. Install App to Workspace\n- Click \"Install to Workspace\" and authorize the app\n- Save the \"Bot User OAuth Token\" that starts with `xoxb-`\n\n### 4. Get Your Team ID\nGet your Team ID (starts with a `T`) by following [this guidance](https://slack.com/help/articles/221769328-Locate-your-Slack-URL-or-ID#find-your-workspace-or-org-id)\n\n### 5. Add Bot to Channels (Optional)\nFor the bot to access private channels or to post messages, you may need to invite it to specific channels using `/invite @your-bot-name`\n\n## Features\n\n- **Multiple Transport Support**: Supports both stdio and Streamable HTTP transports\n- **Modern MCP SDK**: Updated to use the latest MCP SDK (v1.13.2) with modern APIs\n- **Comprehensive Slack Integration**: Full set of Slack operations including:\n  - Search channels (with caching for fast partial-match searches)\n  - Post messages\n  - Reply to threads\n  - Add reactions\n  - Get channel history\n  - Get thread replies\n  - List users\n  - Get user profiles\n\n## Installation\n\n### Local Development\n```bash\nnpm install\nnpm run build\n```\n\n### Global Installation (NPM)\n```bash\nnpm install -g @benbroks/slack-mcp-server\n```\n\n### Docker Installation\n```bash\n# Build the Docker image locally\ndocker build -t slack-mcp-server .\n\n# Or pull from Docker Hub\ndocker pull hynzk6uuwdrdd9na/slack-mcp:latest\n\n# Or pull a specific version\ndocker pull hynzk6uuwdrdd9na/slack-mcp:1.0.0\n```\n\n## Configuration\n\nSet the following environment variables:\n\n```bash\nexport SLACK_BOT_TOKEN=\"xoxb-your-bot-token\"\nexport SLACK_TEAM_ID=\"your-team-id\"\nexport SLACK_CHANNEL_IDS=\"channel1,channel2,channel3\"  # Optional: predefined channels\nexport AUTH_TOKEN=\"your-auth-token\"  # Optional: Bearer token for HTTP authorization (Streamable HTTP transport only)\n```\n\n## Usage\n\n### Command Line Options\n\n```bash\nslack-mcp [options]\n\nOptions:\n  --transport <type>     Transport type: 'stdio' or 'http' (default: stdio)\n  --port <number>        Port for HTTP server when using Streamable HTTP transport (default: 3000)\n  --token <token>        Bearer token for HTTP authorization (optional, can also use AUTH_TOKEN env var)\n  --help, -h             Show this help message\n```\n\n### Local Usage Examples\n\n#### Using the slack-mcp command (after global installation)\n```bash\n# Use stdio transport (default)\nslack-mcp\n\n# Use stdio transport explicitly\nslack-mcp --transport stdio\n\n# Use Streamable HTTP transport on default port 3000\nslack-mcp --transport http\n\n# Use Streamable HTTP transport on custom port\nslack-mcp --transport http --port 8080\n\n# Use Streamable HTTP transport with custom auth token\nslack-mcp --transport http --token mytoken\n\n# Use Streamable HTTP transport with auth token from environment variable\nAUTH_TOKEN=mytoken slack-mcp --transport http\n```\n\n#### Using node directly (for development)\n```bash\n# Use stdio transport (default)\nnode dist/index.js\n\n# Use stdio transport explicitly\nnode dist/index.js --transport stdio\n\n# Use Streamable HTTP transport on default port 3000\nnode dist/index.js --transport http\n\n# Use Streamable HTTP transport on custom port\nnode dist/index.js --transport http --port 8080\n\n# Use Streamable HTTP transport with custom auth token\nnode dist/index.js --transport http --token mytoken\n\n# Use Streamable HTTP transport with auth token from environment variable\nAUTH_TOKEN=mytoken node dist/index.js --transport http\n```\n\n### Docker Usage Examples\n\n#### Using Docker directly\n```bash\n# Run with stdio transport (default)\ndocker run --rm \\\n  -e SLACK_BOT_TOKEN=\"xoxb-your-bot-token\" \\\n  -e SLACK_TEAM_ID=\"your-team-id\" \\\n  hynzk6uuwdrdd9na/slack-mcp:latest\n\n# Run with HTTP transport on port 3000\ndocker run --rm -p 3000:3000 \\\n  -e SLACK_BOT_TOKEN=\"xoxb-your-bot-token\" \\\n  -e SLACK_TEAM_ID=\"your-team-id\" \\\n  hynzk6uuwdrdd9na/slack-mcp:latest --transport http\n\n# Run with HTTP transport on custom port\ndocker run --rm -p 8080:8080 \\\n  -e SLACK_BOT_TOKEN=\"xoxb-your-bot-token\" \\\n  -e SLACK_TEAM_ID=\"your-team-id\" \\\n  hynzk6uuwdrdd9na/slack-mcp:latest --transport http --port 8080\n\n# Run with custom auth token\ndocker run --rm -p 3000:3000 \\\n  -e SLACK_BOT_TOKEN=\"xoxb-your-bot-token\" \\\n  -e SLACK_TEAM_ID=\"your-team-id\" \\\n  -e AUTH_TOKEN=\"mytoken\" \\\n  hynzk6uuwdrdd9na/slack-mcp:latest --transport http\n```\n\n#### Using Docker Compose\nCreate a `docker-compose.yml` file:\n\n```yaml\nversion: '3.8'\n\nservices:\n  slack-mcp:\n    # Use published image:\n    image: hynzk6uuwdrdd9na/slack-mcp:latest\n    # Or build locally:\n    # build: .\n    environment:\n      - SLACK_BOT_TOKEN=xoxb-your-bot-token\n      - SLACK_TEAM_ID=your-team-id\n      - SLACK_CHANNEL_IDS=channel1,channel2,channel3  # Optional\n      - AUTH_TOKEN=your-auth-token  # Optional for HTTP transport\n    ports:\n      - \"3000:3000\"  # Only needed for HTTP transport\n    command: [\"--transport\", \"http\"]  # Optional: specify transport type\n    restart: unless-stopped\n```\n\nThen run:\n```bash\n# Start the service\ndocker compose up -d\n\n# View logs\ndocker compose logs -f slack-mcp\n\n# Stop the service\ndocker compose down\n```\n\n## Transport Types\n\n### Stdio Transport\n- **Use case**: Command-line tools and direct integrations\n- **Communication**: Standard input/output streams\n- **Default**: Yes\n\n### Streamable HTTP Transport\n- **Use case**: Remote servers and web-based integrations\n- **Communication**: HTTP POST requests with optional Server-Sent Events streams\n- **Features**: \n  - Session management\n  - Bidirectional communication\n  - Resumable connections\n  - RESTful API endpoints\n  - Bearer token authentication\n\n## Authentication (Streamable HTTP Transport Only)\n\nWhen using Streamable HTTP transport, the server supports Bearer token authentication:\n\n1. **Command Line**: Use `--token <token>` to specify a custom token\n2. **Environment Variable**: Set `AUTH_TOKEN=<token>` as a fallback\n3. **Auto-generated**: If neither is provided, a random token is generated\n\nThe command line option takes precedence over the environment variable. Include the token in HTTP requests using the `Authorization: Bearer <token>` header.\n\n## Troubleshooting\n\nIf you encounter permission errors, verify that:\n\n1. All required scopes are added to your Slack app\n2. The app is properly installed to your workspace\n3. The tokens and workspace ID are correctly copied to your configuration\n4. The app has been added to the channels it needs to access\n\n## Development\n\n### Build\n```bash\nnpm run build\n```\n\n### Watch Mode\n```bash\nnpm run watch\n```\n\n## API Endpoints (Streamable HTTP Transport)\n\nWhen using Streamable HTTP transport, the server exposes the following endpoints:\n\n- `POST /mcp` - Client-to-server communication\n- `GET /mcp` - Server-to-client notifications (Server-Sent Events streams)\n- `DELETE /mcp` - Session termination\n\n## Changes from Previous Version\n\n- **Updated MCP SDK**: Upgraded from v1.0.1 to v1.13.2\n- **Modern API**: Migrated from low-level Server class to high-level McpServer class\n- **Zod Validation**: Added proper schema validation using Zod\n- **Transport Flexibility**: Added support for Streamable HTTP transport\n- **Command Line Interface**: Added CLI arguments for transport selection\n- **Session Management**: Implemented proper session handling for HTTP transport\n- **Better Error Handling**: Improved error handling and logging\n","readmeFilename":"README.md"}