Slack Search MCP server

Integrates with Slack workspaces to provide direct access to users, channels, messages, and search functionality through a TypeScript-based server that handles pagination and API errors automatically.
Back to servers
Provider
Takuya
Release date
Mar 14, 2025
Language
TypeScript
Stats
2 stars

The Slack Search MCP server provides tools and resources to access Slack's search functionality, allowing Language Learning Models (LLMs) to search and retrieve users, channels, messages, and more from a Slack workspace. It offers a structured way to interact with Slack data through the Model Context Protocol.

Requirements

  • Bun runtime
  • Slack API token with appropriate permissions

Installation

To install the Slack Search MCP server:

  1. Clone the repository
  2. Install dependencies:
    bun install
    

Setting Up

  1. Set the Slack API token as an environment variable:

    export SLACK_TOKEN=xoxb-your-token-here
    
  2. Run the server:

    bun run index.ts
    

    Alternatively, use the compiled version:

    ./dist/slack_search_function_mcp
    

Configuring with MCP

To use this server with an MCP-enabled LLM, add it to your MCP configuration:

{
  "mcpServers": {
    "slack": {
      "command": "/path/to/dist/slack_search_function_mcp",
      "env": {
        "SLACK_TOKEN": "xoxb-your-token-here"
      }
    }
  }
}

Available Tools

Get Users

Retrieves a list of users in the Slack workspace:

{
  "name": "get_users",
  "arguments": {
    "limit": 10
  }
}

Get Channels

Retrieves a list of channels in the Slack workspace:

{
  "name": "get_channels",
  "arguments": {
    "limit": 10,
    "exclude_archived": true
  }
}

Get Channel Messages

Retrieves messages from a specific channel:

{
  "name": "get_channel_messages",
  "arguments": {
    "channel": "C01234ABCDE",
    "limit": 10
  }
}

Get Thread Replies

Retrieves replies in a thread:

{
  "name": "get_thread_replies",
  "arguments": {
    "channel": "C01234ABCDE",
    "thread_ts": "1234567890.123456",
    "limit": 10
  }
}

Search Messages

Searches for messages in Slack:

{
  "name": "search_messages",
  "arguments": {
    "query": "important announcement",
    "sort": "timestamp",
    "sort_dir": "desc",
    "count": 10
  }
}

Available Resources

The server also provides resource URLs for retrieving data:

Get All Users

allusers://

Get All Channels

allchannels://

Error Handling

The server handles various error scenarios including:

  • Invalid or missing Slack API token
  • API rate limits
  • Network errors
  • Invalid parameters
  • Authentication failures

The Slack API token is securely passed via environment variables and is never logged or exposed in responses.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later