Slack MCP Server AI Agent Template
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Slack MCP Server AI Agent TemplateSend a message to #general welcoming the team"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Slack MCP Server AI Agent Template (Bolt for JavaScript)
⚠️ Beta Notice: This template demonstrates MCP functionality that is currently in beta and not yet widely available to all developers. The functionality shown here is being tested and may change before general availability.
This Bolt for JavaScript template demonstrates how to build AI Apps in Slack that leverage the Slack MCP server.
Models from OpenAI are used and can be customized for prompts of all kinds.
Setup
Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and create one.
Developer Program
Join the Slack Developer Program for exclusive access to sandbox environments for building and testing your apps, tooling, and resources created to help you build and grow.
Related MCP server: Slack Max API MCP
Installation
Create a Slack App
Open https://api.slack.com/apps/new and choose "From an app manifest"
Choose the workspace you want to install the application to
Copy the contents of manifest.json into the text box that says
*Paste your manifest code here*(within the JSON tab) and click NextReview the configuration and click Create
Clone the project
# Clone this project onto your machine
git clone https://github.com/slack-samples/bolt-js-slack-mcp-server.gitEnvironment Variables
Before you can run the app, you'll need to store some environment variables.
Rename
.env.sampleto.env.Open your apps setting page from this list, click Basic Information in the left hand menu, then copy the following values into your
.envfile:
SLACK_CLIENT_ID=YOUR_APP_CLIENT_ID
SLACK_CLIENT_SECRET=YOUR_APP_CLIENT_SECRET
SLACK_SIGNING_SECRET=YOUR_APP_SIGNING_SECRET
SLACK_STATE_SECRET='your-state-secret'
SLACK_INSTALL_URL='https://<APP_INSTALLATION_URL>/slack/install'Note: the SLACK_INSTALL_URL is where users initiate the installation of the app into their workspace. For more information about this URL, please see the OAuth section.
Unlock the OpenAI models from your OpenAI account dashboard by clicking create a new secret key, then save your OpenAI key into the
.envfile asOPENAI_API_KEYlike so:
OPENAI_API_KEY=YOUR_OPEN_API_KEYLocal Project
# Change into the project directory
cd bolt-js-slack-mcp-server
# Install dependencies
npm install
# Run Bolt server
npm startLinting
# Run lint for code formatting and linting
npm run lintOAuth
This sample relies on the usage of user tokens, and therefore requires individual user installations to function as intended.
Reminder: the Bolt app must be running and the following endpoints made available for the below URLs to be accessible when updating them in the app configuration.
When using OAuth, Slack requires a public URL where it can send requests. In this template app, we've used ngrok. Checkout this guide for setting it up.
Start ngrok to access the app on an external network and create a redirect URL for OAuth.
ngrok http 3000This output should include a forwarding address for http and https (we'll use https). It should look something like the following:
Forwarding https://3cb89939.ngrok.io -> http://localhost:3000Navigate to OAuth & Permissions in your app configuration and update the Redirect URL. The redirect URL should be set to your ngrok forwarding address with the slack/oauth_redirect path appended. For example:
https://3cb89939.ngrok.io/slack/oauth_redirectNavigate to Event Subscriptions in your app configuration and update the Request URL. The request URL should be set to your ngrok forwarding address with the slack/events path appended. For example:
https://3cb89939.ngrok.io/slack/eventsThe value set for the SLACK_INSTALL_URL in .env corresponds to the public URL where users initiate the installation of the app into their workspace. The install URL should be set to your ngrok forwarding address with the slack/install path appended. For example:
https://3cb89939.ngrok.io/slack/installUsage
After installing the app into a workspace using the OAuth installtion flow, create a new chat (via DM) with the chatbot.
Upon creation of the new chat, the user is prompted with two static options that demonstrate either sending a message to #general, or creating a new canvas – both as and on behalf of the user.
Project Structure
manifest.json
manifest.json is a configuration for Slack apps. With a manifest, you can create an app with a pre-defined configuration, or adjust the configuration of an existing app.
app.js
app.js is the entry point for the application and is the file you'll run to start the server. This project aims to keep this file as thin as possible, primarily using it as a way to route inbound requests.
/listeners/assistant
Configures the new Slack Assistant features, providing a dedicated side panel UI for users to interact with the AI chatbot. This module includes:
The
assistant-thread-started.jsfile, which responds to new app threads with a list of suggested prompts.The
assistant-thread-context-changed.jsfile, which updates the context to include information about where the conversation with the chatbot is occurring (i.e., in a DM or within a channel).The
user-message.jsfile, which responds to user messages sent to app threads or from the Chat and History tab with an LLM generated response.
/llm
The openai.js file handles the OpenAI API initialization and configuration.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceA Model Context Protocol server implementation that enables AI assistants to interact with Slack workspaces, allowing them to browse channels, send messages, reply to threads, add reactions, and retrieve user information.Last updated9162Apache 2.0
- AlicenseBqualityDmaintenanceAn MCP server that provides comprehensive access to the Slack Web API, enabling AI agents to search messages, manage channels, and create canvases. It features 13 core tools and over 300 dynamic methods for complete automation of Slack workspace operations.Last updated2188ISC
- Alicense-qualityCmaintenanceA Model Context Protocol (MCP) server for Slack workspace integration. This server allows AI assistants to interact directly with your Slack workspace, providing tools to manage channels, send messages, list users, and upload files.Last updated43,1791MIT
- Flicense-qualityDmaintenanceA Slack MCP server that gives AI assistants tools to read, search, and interact with Slack workspaces.Last updated
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/slack-samples/bolt-js-slack-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server