The Slack MCP (Model Context Protocol) server enables AI assistants to interact with Slack API through a standardized interface. It provides a set of tools that allow access to various Slack functionalities like posting messages, retrieving channel history, and searching messages.
To install the Slack MCP server, run the following command:
npm install @ubie-oss/slack-mcp-server
Note that this package is hosted in GitHub Registry, so you'll need a Personal Access Token (PAT) to install it.
Before using the server, you need to set up the following environment variables:
SLACK_BOT_TOKEN
: Your Slack Bot User OAuth TokenSLACK_USER_TOKEN
: Your Slack User OAuth Token (required for certain features like message search)You can set these variables in a .env
file:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_USER_TOKEN=xoxp-your-user-token
You can start the MCP server in two ways:
npx @ubie-oss/slack-mcp-server
node node_modules/.bin/slack-mcp-server
To configure your client to use the Slack MCP server, create an MCP configuration JSON file:
{
"slack": {
"command": "npx",
"args": [
"-y",
"@ubie-oss/slack-mcp-server"
],
"env": {
"NPM_CONFIG_//npm.pkg.github.com/:_authToken": "<your-github-pat>",
"SLACK_BOT_TOKEN": "<your-bot-token>",
"SLACK_USER_TOKEN": "<your-user-token>"
}
}
}
The Slack MCP server provides the following tools:
Each tool follows a consistent implementation pattern:
For example, the slack_list_channels
tool validates the incoming request against a schema, calls the Slack API's conversations.list
method, and returns a filtered response containing only the essential channel information.
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.