slack
Read-only MCP server for Slack workspace data
claude mcp add --transport stdio mynghn-slack-mcp-server node build/index.js \ --env SLACK_COOKIE_D="Your d cookie value (xoxd-...) if using User Token" \ --env SLACK_BOT_TOKEN="Your Bot User OAuth token (xoxb-...)" \ --env SLACK_WORKSPACE="Your Slack workspace name (required for auto-refresh with user token)" \ --env SLACK_USER_TOKEN="Your User token (xoxc-...) if enabling search"
How to use
This Slack MCP server exposes read-only MCP tools that let AI assistants query Slack workspace data. You can list public channels, fetch channel histories and thread replies, enumerate users, and retrieve user profiles. If you provide a user token, you can also enable the search capability to query messages across channels. The server supports cursor-based pagination for list and search operations and offers a dedicated refresh_credentials tool to manage Slack user credentials automatically. Start by configuring either a bot token (recommended) or a user token (required for search), then run the server and add it to Claude Code or your MCP client as a configured MCP endpoint. The tools you’ll access include: list_channels, get_channel_history, get_thread_replies, list_users, get_user_profile, search_messages (requires user token), and refresh_credentials (for auto-refresh of user credentials).
How to install
Prerequisites:
- Node.js 20+
- pnpm (or npm/yarn)
- A Slack workspace with appropriate access
Setup steps:
# Clone the repository
git clone https://github.com/your-username/slack-mcp-server.git
cd slack-mcp-server
# Install dependencies
pnpm install
# Build the project
pnpm run build
Configuration tips:
- Create and configure a Slack Bot and obtain a Bot Token (xoxb-...).
- Optionally configure a User Token (xoxc-...) and cookie value (xoxd-...) if you need search and auto-refresh capabilities.
- For Claude integration, you will typically register the MCP server endpoint and, if using user tokens, pass environment variables for SLACK_USER_TOKEN and SLACK_COOKIE_D.
Run the server:
# With bot token
SLACK_BOT_TOKEN=xoxb-your-token-here pnpm start
# With user token (enables search)
SLACK_USER_TOKEN=xoxc-your-token-here SLACK_COOKIE_D=xoxd-your-cookie-here pnpm start
Additional notes
Tips and considerations:
- The bot token is the recommended authentication method for read access. It is safer and more stable for automated access.
- The search_messages tool requires a user token; using it with a user token means you should enable and manage credentials carefully, as user tokens can expire.
- Auto-refresh (refresh_credentials) can automatically refresh user credentials at a configurable interval. Ensure SLACK_WORKSPACE is set when using auto-refresh.
- If you rely on auto-refresh, credentials are persisted with secure permissions (0600).
- When integrating with Claude, you can pass environment variables for tokens and credentials as part of the MCP add command.
- The disclaimer notes that user-token-based approaches are unofficial and may be subject to Slack’s Terms of Service. Prefer bot-token authentication where possible.
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
Matryoshka
MCP server for token-efficient large document analysis via the use of REPL state
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
Agentic -Skill
Agentic-MCP, Progressive MCP client with three-layer lazy loading. Validates AgentSkills.io pattern for efficient token usage. Use MCP without pre-install & wasting full-loading
mongo
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
vscode-context
MCP Server to Connect with VS Code IDE