Slack MCP Server

Slack MCP Server

An MCP server that enables searching for messages and listing channels within a Slack workspace. It provides tools to retrieve channel history and filter messages based on text matching and date ranges.

Category
访问服务器

README

Slack MCP Server

A Model Context Protocol (MCP) server for searching Slack channels and messages.

Features

  • list_channels - List available Slack channels in the workspace
  • search_messages - Search for messages across channels using text matching
  • get_channel_history - Get message history from a specific channel

Installation

Using npx (Recommended)

No installation required. Add directly to your config:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "github:nikhilchintawar/slack-mcp"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token-here"
      }
    }
  }
}

Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "github:nikhilchintawar/slack-mcp"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token-here"
      }
    }
  }
}

Manual Installation

# Clone the repository
git clone https://github.com/nikhilchintawar/slack-mcp.git
cd slack-mcp

# Install dependencies
npm install

# Build
npm run build

Then add to your config:

{
  "mcpServers": {
    "slack": {
      "command": "node",
      "args": ["/absolute/path/to/slack-mcp/build/index.js"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token-here"
      }
    }
  }
}

Configuration

Config File Locations

  • Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Claude Code: ~/.claude/settings.json

Environment Variables

Variable Required Description
SLACK_BOT_TOKEN Yes Slack Bot User OAuth Token
SLACK_CHANNELS No Comma-separated list of allowed channels (restricts searches)
SLACK_DEFAULT_CHANNEL No Default channel ID for operations

Channel Restrictions

Use SLACK_CHANNELS to restrict which channels can be searched. When configured:

  • Searches without a channel specified will search all allowed channels
  • Searches with a specific channel will validate it's in the allowed list
  • get_channel_history will only work with allowed channels
{
  "env": {
    "SLACK_BOT_TOKEN": "xoxb-your-token",
    "SLACK_CHANNELS": "general,engineering,support"
  }
}

Slack App Setup

  1. Create a Slack App at https://api.slack.com/apps
  2. Go to "OAuth & Permissions"
  3. Add the following Bot Token Scopes:
    • channels:read - List public channels
    • channels:history - Read messages from public channels
    • groups:read - List private channels (optional)
    • groups:history - Read messages from private channels (optional)
  4. Install the app to your workspace
  5. Copy the "Bot User OAuth Token" (starts with xoxb-)
  6. Important: Add the bot to each channel you want to search (right-click channel → "Open channel details" → "Integrations" → "Add apps")

Usage Examples

Once configured, you can use natural language to interact with Slack:

  • "List all channels in my Slack workspace"
  • "Search for messages about deployment in #engineering"
  • "Show me the last 50 messages from #general"
  • "Find messages from @john about the API"
  • "Search for error messages from last week"

Available Tools

list_channels

List available Slack channels in the workspace.

Parameter Required Description
includePrivate No Include private channels (default: false)
includeArchived No Include archived channels (default: false)
limit No Max results (default: 100, max: 1000)

search_messages

Search for messages across Slack channels using text matching. Fetches channel history and filters by query.

Parameter Required Description
query Yes Search text (case-insensitive). Use | for OR, spaces for AND
channel No Channel ID or name. If not set, searches all SLACK_CHANNELS
after No Search messages after date (YYYY-MM-DD or ISO 8601)
before No Search messages before date (YYYY-MM-DD or ISO 8601)
limit No Max results (default: 20, max: 100)

Query examples:

  • error - messages containing "error"
  • error warning - messages containing both "error" AND "warning"
  • error | warning - messages containing "error" OR "warning"

get_channel_history

Get message history from a specific Slack channel.

Parameter Required Description
channel No Channel ID (uses env var default)
oldest No Start time (Unix timestamp or ISO date)
latest No End time (Unix timestamp or ISO date)
limit No Max results (default: 100, max: 1000)
includeThreadReplies No Include thread replies (default: false)

Development

# Watch mode for development
npm run dev

# Build for production
npm run build

# Test with MCP Inspector
SLACK_BOT_TOKEN=xoxb-your-token \
  npx @modelcontextprotocol/inspector node build/index.js

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选