Slack MCP Server
Provides tools for interacting with Slack, including listing channels, reading channel history, sending messages, fetching thread replies, retrieving user info, listing users, and searching messages.
Click 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 Serversearch for 'bug report' in all channels"
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
A production-ready Model Context Protocol server for the Slack API.
This template lets Claude Desktop, Cursor, Windsurf, and other MCP-compatible clients search Slack, list channels, read recent channel history, inspect users, fetch thread replies, and send messages through controlled Slack tools.
Built as a starter template for teams that want a secure baseline before adding company-specific Slack automation workflows.
Who this is for
This repository is useful for:
developers building AI assistants for Slack workspaces,
internal tools teams connecting Slack to AI agents,
platform engineers who need a clean TypeScript MCP server example,
agencies building Slack automation for clients,
teams that want controlled Slack read/write tools for Claude, Cursor, or other MCP clients.
Related MCP server: Slack MCP Server
Features
TypeScript + Express MCP server
Slack OAuth 2.0 installation flow
Optional static bot token bootstrap with
SLACK_BOT_TOKENBearer-token protection for
/mcpRate limiting for MCP requests
Health endpoint at
/healthStructured Pino logging
Zod-based environment validation
MCP tools for channels, messages, threads, users, and search
Jest + Supertest test setup
GitHub Actions CI workflow
Architecture
Claude Desktop / Cursor / Windsurf
│
│ HTTP POST /mcp
│ Authorization: Bearer <MCP_API_KEY>
▼
Express Server
│
├── Pino HTTP logger
├── Rate limiter
├── MCP API key middleware
│
▼
MCP SDK Handler
│
├── slack_list_channels ─┐
├── slack_get_channel_history ─┤
├── slack_send_message ─┤──► Slack Web API
├── slack_get_thread_replies ─┤
├── slack_get_user_info ─┤
├── slack_list_users ─┤
└── slack_search_messages ─┘
OAuth Flow
GET /auth/slack → Slack install screen
GET /auth/slack/callback → token exchange + token storage
GET /auth/status → installed workspace summary
GET /health → Slack API + token-store dependency statusSee the larger diagram in docs/architecture.md.
Source Code
The complete production-ready Slack MCP Server template is available on GitHub.
Repository:
https://github.com/kamolc4/slack-mcp-server
The repository includes:
Complete TypeScript source code
Slack OAuth implementation
MCP tools
GitHub Actions CI
Jest test suite
MIT License
Claude Desktop & Cursor configuration
Production deployment examples
Fork the repository or download it as a ZIP to start building immediately.
Available MCP tools
Tool | Purpose |
| List public and private channels in the connected Slack workspace. |
| Fetch recent messages from a Slack channel. |
| Post a message to a channel, optionally as a thread reply. |
| Fetch replies in a Slack message thread. |
| Get profile details for a Slack user by ID. |
| List workspace users. |
| Search Slack messages using Slack search syntax. |
Quick start
1. Install dependencies
# Clone repository
git clone https://github.com/kamolc4/slack-mcp-server.git
cd slack-mcp-server
# Install dependencies
npm ci2. Configure environment
cp .env.example .envEdit .env:
PORT=3000
NODE_ENV=development
LOG_LEVEL=info
BASE_URL=http://localhost:3000
MCP_API_KEY=replace-with-a-long-random-secret
SESSION_SECRET=replace-with-a-long-random-session-secret
SLACK_CLIENT_ID=your-slack-client-id
SLACK_CLIENT_SECRET=your-slack-client-secret
SLACK_SIGNING_SECRET=your-slack-signing-secret
SLACK_REDIRECT_URI=http://localhost:3000/auth/slack/callback
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=1003. Run locally
npm run dev4. Install the Slack app
Open this URL in your browser:
http://localhost:3000/auth/slackAfter successful installation, check status:
curl http://localhost:3000/auth/status5. Check health
curl http://localhost:3000/healthSlack OAuth setup
In the Slack API dashboard:
Create a new Slack app.
Add this redirect URL:
http://localhost:3000/auth/slack/callbackCopy the client ID, client secret, and signing secret into
.env.Add the OAuth scopes required by the tools you expose.
Recommended bot scopes for this starter template:
channels:read
channels:history
users:read
search:read
chat:writeFor production, set SLACK_REDIRECT_URI to your deployed callback URL, for example:
https://your-domain.com/auth/slack/callbackOptional static bot token mode
For local single-workspace testing, you can skip OAuth and use an existing bot token:
SLACK_BOT_TOKEN=xoxb-your-tokenThe server will call auth.test at startup and bootstrap the token if it is valid.
Connect to Claude Desktop
Build the server first:
npm run build
npm startThen add an MCP server entry in your Claude Desktop configuration:
{
"mcpServers": {
"slack": {
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer replace-with-your-mcp-api-key"
}
}
}
}Restart Claude Desktop after editing the configuration.
Connect to Cursor
In Cursor, add a new MCP server using the HTTP endpoint:
{
"name": "slack",
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer replace-with-your-mcp-api-key"
}
}Then restart Cursor or reload the MCP server list.
Security notes
This template is safer than a minimal demo, but you should harden it before production use.
Recommended production changes:
Replace the in-memory token store in
src/auth.tswith Redis, Postgres, or another encrypted durable store.Store Slack bot tokens encrypted at rest.
Store secrets in a managed secret manager, not in plain
.envfiles.Rotate
MCP_API_KEYregularly.Add per-user or per-workspace authorization if multiple users will access the server.
Restrict write tools such as
slack_send_messagebehind approvals.Add audit logs for every tool call.
Use HTTPS in production.
Review Slack scopes and remove anything your use case does not need.
Security Review
Verify this server with MCPForge:
https://www.mcpforge.tech/verify
MCPForge can help review:
exposed tools,
authentication behavior,
health checks,
compatibility with MCP clients,
risk level of write operations,
security posture before publishing or deployment.
After verification, you can link your public report from this README:
[](https://www.mcpforge.tech/verified/slack-mcp-server)Read the complete guide on MCPForge:
https://www.mcpforge.tech/blog/slack-mcp-server
Deployment
A common production setup:
Deploy this service to Railway, Render, Fly.io, AWS, GCP, Azure, or a private Kubernetes cluster.
Configure environment variables in the hosting provider.
Set
BASE_URLto your public HTTPS URL.Set
SLACK_REDIRECT_URItohttps://your-domain.com/auth/slack/callback.Add the same callback URL in the Slack app dashboard.
Run the Slack OAuth installation flow once to connect the workspace.
Verify
/healthand/mcpbefore connecting production AI clients.Run a public or private verification with MCPForge.
Local development commands
npm run lint
npm run typecheck
npm test
npm run buildAPI endpoints
Method | Path | Description |
|
| Health and Slack connectivity check. |
|
| Start Slack OAuth installation. |
|
| Slack OAuth callback. |
|
| Installed workspace status. |
|
| MCP endpoint protected by |
Contributing
Contributions are welcome.
To improve this Slack MCP Server template, please open an issue or submit a pull request.
Releases
Latest stable release:
v1.0.0
See the Releases page for the full changelog.
License
MIT — see LICENSE.
Related MCP Server Templates
Looking for other production-ready MCP Server templates?
GitHub MCP Server
Slack MCP Server
Stripe MCP Server
Notion MCP Server
Shopify MCP Server
HubSpot MCP Server
PostgreSQL MCP Server
Browse the complete collection:
Latest Blog Posts
- 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/kamolc4/slack-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server