Slack MCP Server 275ae045

MCPAI代理

提供方 Sreenav14

AI代理 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaudeCursor
查看接入方式

Slack MCP服务器是一个基于FastAPI和PostgreSQL构建的服务,使AI助手(如Claude Desktop、Cursor)能够与Slack进行交互,实现频道列表、消息发送和历史记录获取等功能。

一句话选型结论

按资料字段整理

Slack MCP Server 275ae045 属于AI代理类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude、Cursor,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量3暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

Slack集成Python本地部署AI交互多租户服务安全认证MCP协议

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
pip install -r requirements.txt

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Slack MCP Server 275ae045当前 3 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Sreenav14上游标注的维护方 Sreenav14
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

11.4 KB
来自项目仓库与上游目录的原文,未做删改

Slack MCP Server

A Model Context Protocol (MCP) server that enables AI assistants (like Claude Desktop, Cursor) to interact with Slack. Built with FastAPI, MCP SDK, and PostgreSQL.

🎯 What This Does

Turns your Slack workspace into AI-accessible tools:

  • List channels: list_channels(limit=20, include_private=false)
  • Send messages: send_message(channel_id="C123", text="Hello!", thread_ts="...")
  • Fetch history: fetch_history(channel_id="C123", limit=10)

🏗️ Architecture```

┌─────────────────────────────────────────────────────────────────────────┐
│ COMPLETE MCP ECOSYSTEM │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ MCP Client │ │ MCP Server │ │
│ │ (Cursor/Claude)│ │ (FastAPI + MCP SDK) │ │
│ └─────────┬───────┘ └─────────┬───────────────┘ │
│ │ │ │
│ │ JSON-RPC over stdio │ HTTP/SSE │
│ │ (via mcp_bridge.py) │ │
│ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ MCP Bridge │ ──────────────────►│ /mcp/sse │ │
│ │ (Local) │ HTTP POST │ /mcp/messages │ │
│ └─────────────────┘ └─────────┬───────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Tool Execution │ ──────────────────►│ Slack API │ │
│ │ (server.py) │ REST API │ │ │
│ └─────────────────┘ └─────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Authentication │ │ Database │ │
│ │ JWT + OAuth │ │ PostgreSQL │ │
│ └─────────────────┘ └─────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘


## 📦 Features

- ✅ **Multi-tenant**: Each user connects their own Slack workspace
- ✅ **Secure**: JWT authentication + OAuth 2.0 for Slack
- ✅ **Modern MCP**: Uses official MCP SDK with SSE transport
- ✅ **Production ready**: FastAPI, PostgreSQL, proper error handling
- ✅ **Local bridge**: Connects local MCP clients to remote server

## 🚀 Quick Start

### 1. Clone & Install```bash
git clone <your-repo>
cd slack-mcp
pip install -r requirements.txt

2. Environment Setup

Create a .env file:```bash

Database

DATABASE_URL=postgresql://user:password@localhost:5432/slack_mcp

Slack OAuth (from https://api.slack.com/apps)

SLACK_CLIENT_ID=your_slack_client_id
SLACK_CLIENT_SECRET=your_slack_client_secret
SLACK_REDIRECT_URI=https://your-server.com/oauth/slack/callback

App Security

APP_SECRET_KEY=your_secure_random_secret_key_here
JWT_EXP_MINUTES=43200

Bridge Configuration (for local clients)

SLACK_MCP_TOKEN=your_session_token_here
SLACK_MCP_URL=https://your-server.com


### 3. Database Setup```bash
# Create tables
alembic upgrade head

4. Run Server```bash

uvicorn app.main:app --reload


Visit `http://localhost:8000/docs` for API documentation.

## 🔐 User Flow

### Step 1: Account Creation```bash
# Signup
curl -X POST http://localhost:8000/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password123"}'

# Response: {"user_id": 1, "session_token": "eyJ..."}

Step 2: Slack Connection```bash

Get OAuth URL

curl "http://localhost:8000/oauth/slack/start?session_token=your_token"

Visit the URL in browser → Authorize app → Redirect back


### Step 3: Use MCP Tools```bash
# Run bridge locally
python mcp_bridge.py

# Configure your MCP client (Cursor/Claude) to use:
# Command: python
# Arguments: ["path/to/mcp_bridge.py"]

🛠️ MCP Tools

list_channels

Lists Slack channels in the connected workspace.

Parameters:
- limit (number, optional): Max channels to return (default: 20)
- include_private (boolean, optional): Include private channels

Example:```json
{
"name": "list_channels",
"arguments": {"limit": 10, "include_private": true}
}


**Response:**```json
{
  "content": [
    {
      "type": "text",
      "text": "Found 3 channels:\n\n• #general (ID: C1234567890) - 25 members\n• #random (ID: C0987654321) - 15 members\n• #private (ID: C1111111111) - 5 members"
    }
  ]
}

send_message

Sends a message to a Slack channel.

Parameters:
- channel_id (string, required): Slack channel ID
- text (string, required): Message content
- thread_ts (string, optional): Reply to thread

Example:```json
{
"name": "send_message",
"arguments": {
"channel_id": "C1234567890",
"text": "Hello from AI!",
"thread_ts": "1234567890.123456"
}
}


**Response:**```json
{
  "content": [
    {
      "type": "text",
      "text": "✓ Message sent successfully to channel C1234567890"
    }
  ]
}

fetch_history

Fetches message history from a channel.

Parameters:
- channel_id (string, required): Slack channel ID
- limit (number, optional): Messages to fetch (default: 10, max: 100)

Example:```json
{
"name": "fetch_history",
"arguments": {
"channel_id": "C1234567890",
"limit": 5
}
}


**Response:**```json
{
  "content": [
    {
      "type": "text",
      "text": "Last 5 messages from C1234567890:\n\n[U123]: Hello team!\n[U456]: How's the project?\n[U123]: Going well!\n[U789]: Great to hear\n[U456]: Awesome!"
    }
  ]
}

📁 Project Structure```

slack-mcp/
├── alembic/ # Database migrations
├── app/
│ ├── auth/ # Authentication
│ │ ├── jwt.py # JWT token handling
│ │ ├── passwords.py # Password hashing
│ │ └── routes.py # /auth/signup, /auth/login
│ ├── mcp/ # MCP server
│ │ ├── init.py
│ │ └── server.py # MCP SDK implementation
│ ├── oauth/ # Slack OAuth
│ │ └── slack.py # OAuth flow
│ ├── slack/ # Slack API client
│ │ └── client.py # SlackClient wrapper
│ ├── config.py # Environment config
│ ├── db.py # Database connection
│ ├── main.py # FastAPI app + MCP endpoints
│ └── models.py # SQLAlchemy models
├── mcp_bridge.py # Local MCP bridge
├── requirements.txt # Python dependencies
└── README.md # This file


## 🔧 API Endpoints

### Authentication
- `POST /auth/signup` - Create account
- `POST /auth/login` - Login
- `GET /auth/me` - Get user info

### Slack OAuth
- `GET /oauth/slack/start` - Start OAuth flow
- `GET /oauth/slack/callback` - OAuth callback

### MCP (SSE Transport)
- `GET /mcp/sse` - SSE connection endpoint
- `POST /mcp/messages` - Send MCP requests

### Utility
- `GET /health` - Health check
- `GET /` - Server info
- `GET /docs` - Swagger UI

## 🔒 Security

- **JWT Authentication**: Session tokens expire in 30 days
- **OAuth 2.0**: Secure Slack workspace access
- **CSRF Protection**: State parameters prevent OAuth attacks
- **Password Hashing**: bcrypt for secure password storage
- **User Isolation**: Each user only accesses their own Slack data

## 🚀 Deployment

### Environment Variables```bash
# Production settings
DATABASE_URL=postgresql://prod:password@host:5432/db
SLACK_CLIENT_ID=your_prod_client_id
SLACK_CLIENT_SECRET=your_prod_client_secret
SLACK_REDIRECT_URI=https://yourdomain.com/oauth/slack/callback
APP_SECRET_KEY=your_prod_secret_key
JWT_EXP_MINUTES=43200

Docker (Optional)```dockerfile

FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
RUN alembic upgrade head

EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]


## 🧪 Testing

### Test the MCP Server```bash
# Start server
uvicorn app.main:app --reload

# Test health endpoint
curl http://localhost:8000/health

# Test MCP SSE connection (needs session_token)
curl "http://localhost:8000/mcp/sse?session_token=your_token"

Test the Bridge```bash

Set environment variables

export SLACK_MCP_TOKEN=your_token
export SLACK_MCP_URL=http://localhost:8000

Run bridge

python mcp_bridge.py
```

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

  • Anthropic MCP for the MCP specification
  • FastAPI for the web framework
  • SQLAlchemy for database ORM

🎯 How It All Works Together

  1. User signs up → Gets session_token
  2. User connects Slack → OAuth flow → Stores bot_access_token
  3. AI client connects → Via bridge → SSE transport → MCP server
  4. AI calls tools → MCP protocol → Your server → Slack API → Response

Result: AI assistants can now read/write Slack messages securely! 🚀

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Slack MCP Server 275ae045 怎么安装?

在客户端按下面的安装命令接入:pip install -r requirements.txt。装完在客户端配置里引用同一个包或端点。

Slack MCP Server 275ae045 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Slack MCP Server 275ae045 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Slack MCP Server 275ae045 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Slack MCP Server 275ae045 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Slack MCP Server 275ae045 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 Slack、安全认证、Python、Claude。具体工具清单以官方文档为准。

Slack MCP Server 275ae045 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

Slack MCP Server 275ae045 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。