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.
To install the Slack Search MCP server:
bun install
Set the Slack API token as an environment variable:
export SLACK_TOKEN=xoxb-your-token-here
Run the server:
bun run index.ts
Alternatively, use the compiled version:
./dist/slack_search_function_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"
}
}
}
}
Retrieves a list of users in the Slack workspace:
{
"name": "get_users",
"arguments": {
"limit": 10
}
}
Retrieves a list of channels in the Slack workspace:
{
"name": "get_channels",
"arguments": {
"limit": 10,
"exclude_archived": true
}
}
Retrieves messages from a specific channel:
{
"name": "get_channel_messages",
"arguments": {
"channel": "C01234ABCDE",
"limit": 10
}
}
Retrieves replies in a thread:
{
"name": "get_thread_replies",
"arguments": {
"channel": "C01234ABCDE",
"thread_ts": "1234567890.123456",
"limit": 10
}
}
Searches for messages in Slack:
{
"name": "search_messages",
"arguments": {
"query": "important announcement",
"sort": "timestamp",
"sort_dir": "desc",
"count": 10
}
}
The server also provides resource URLs for retrieving data:
allusers://
allchannels://
The server handles various error scenarios including:
The Slack API token is securely passed via environment variables and is never logged or exposed in responses.
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.
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"
]
}
}
}
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.
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.