slack-notifier-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # e.g., v0.1.0
7
+ workflow_dispatch: # Allow manual trigger
8
+
9
+ jobs:
10
+ build:
11
+ name: Build distribution
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install build dependencies
23
+ run: python -m pip install --upgrade pip build
24
+
25
+ - name: Build package
26
+ run: python -m build
27
+
28
+ - name: Upload distribution artifacts
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: python-package-distributions
32
+ path: dist/
33
+
34
+ publish-to-pypi:
35
+ name: Publish to PyPI
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment:
39
+ name: pypi
40
+ url: https://pypi.org/p/slack-notifier-mcp
41
+ permissions:
42
+ id-token: write # Required for trusted publishing
43
+
44
+ steps:
45
+ - name: Download distribution artifacts
46
+ uses: actions/download-artifact@v4
47
+ with:
48
+ name: python-package-distributions
49
+ path: dist/
50
+
51
+ - name: Publish to PyPI
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+ # No API token needed - uses trusted publishing (OIDC)
54
+
55
+ create-github-release:
56
+ name: Create GitHub Release
57
+ needs: [build, publish-to-pypi]
58
+ runs-on: ubuntu-latest
59
+ permissions:
60
+ contents: write
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+
64
+ - name: Download distribution artifacts
65
+ uses: actions/download-artifact@v4
66
+ with:
67
+ name: python-package-distributions
68
+ path: dist/
69
+
70
+ - name: Extract changelog for this version
71
+ id: changelog
72
+ run: |
73
+ VERSION=${GITHUB_REF#refs/tags/v}
74
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
75
+ # Extract section for this version from CHANGELOG.md
76
+ awk "/^## \[$VERSION\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md > release_notes.md
77
+ # If empty, provide a default message
78
+ if [ ! -s release_notes.md ]; then
79
+ echo "Release $VERSION" > release_notes.md
80
+ fi
81
+
82
+ - name: Create GitHub Release
83
+ uses: softprops/action-gh-release@v2
84
+ with:
85
+ body_path: release_notes.md
86
+ files: dist/*
87
+ fail_on_unmatched_files: false
88
+
89
+ publish-to-testpypi:
90
+ name: Publish to TestPyPI
91
+ needs: build
92
+ runs-on: ubuntu-latest
93
+ if: github.event_name == 'workflow_dispatch' # Only on manual trigger
94
+ environment:
95
+ name: testpypi
96
+ url: https://test.pypi.org/p/slack-notifier-mcp
97
+ permissions:
98
+ id-token: write
99
+
100
+ steps:
101
+ - name: Download distribution artifacts
102
+ uses: actions/download-artifact@v4
103
+ with:
104
+ name: python-package-distributions
105
+ path: dist/
106
+
107
+ - name: Publish to TestPyPI
108
+ uses: pypa/gh-action-pypi-publish@release/v1
109
+ with:
110
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,58 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ name: Test
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ version: "latest"
25
+
26
+ - name: Set up Python
27
+ run: uv python install 3.12
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --extra dev
31
+
32
+ - name: Run tests
33
+ run: uv run pytest tests/ -v --tb=short
34
+
35
+ lint:
36
+ name: Lint
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - name: Install uv
42
+ uses: astral-sh/setup-uv@v4
43
+ with:
44
+ version: "latest"
45
+
46
+ - name: Set up Python
47
+ run: uv python install 3.12
48
+
49
+ - name: Install dependencies
50
+ run: uv sync --extra dev
51
+
52
+ - name: Check formatting with black
53
+ run: uv run python -m black --check slack_mcp tests
54
+ continue-on-error: true
55
+
56
+ - name: Check linting with ruff
57
+ run: uv run python -m ruff check slack_mcp tests
58
+ continue-on-error: true
@@ -0,0 +1,59 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .env
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+
30
+ # UV
31
+ .uv/
32
+ uv.lock
33
+
34
+ # IDE
35
+ .idea/
36
+ .vscode/
37
+ *.swp
38
+ *.swo
39
+ *~
40
+
41
+ # Testing
42
+ .pytest_cache/
43
+ .ruff_cache/
44
+ .coverage
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+
49
+ # mypy
50
+ .mypy_cache/
51
+ .dmypy.json
52
+ dmypy.json
53
+
54
+ # OS
55
+ .DS_Store
56
+ Thumbs.db
57
+
58
+ # Project specific
59
+ *.log
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-01-17
11
+
12
+ ### Added
13
+ - Initial release of slack-notifier-mcp server
14
+ - `notify` tool for sending notifications with urgency levels (normal, important, critical)
15
+ - `ask_user` tool for bidirectional communication - ask questions and wait for Slack replies
16
+ - `send_message` tool for lower-level message sending and thread replies
17
+ - `get_thread_replies` tool for checking thread responses
18
+ - User mention support via `SLACK_USER_ID` environment variable
19
+ - Slack mrkdwn formatting support in all messages
20
+ - Comprehensive README with setup instructions for Claude Code, VS Code, Cursor, and other MCP clients
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Oded Falik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.4
2
+ Name: slack-notifier-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Slack notifications with bidirectional communication
5
+ Project-URL: Homepage, https://github.com/strand-ai/slack-notifier-mcp
6
+ Project-URL: Repository, https://github.com/strand-ai/slack-notifier-mcp
7
+ Project-URL: Issues, https://github.com/strand-ai/slack-notifier-mcp/issues
8
+ Project-URL: Changelog, https://github.com/strand-ai/slack-notifier-mcp/blob/main/CHANGELOG.md
9
+ Author: Oded Falik
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: claude,mcp,notifications,slack
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: mcp[cli]>=1.0.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: slack-sdk>=3.27.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: black>=24.0.0; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.3.0; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Slack Notifier MCP
33
+
34
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
35
+ [![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io/)
36
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
38
+
39
+ MCP server for **bidirectional Slack communication** with Claude Code. Get notified when tasks complete, and respond to Claude's questions directly from Slack.
40
+
41
+ ## Quick Start
42
+
43
+ ```bash
44
+ # Add to Claude Code (one command)
45
+ claude mcp add slack-notifier -s user \
46
+ -e SLACK_BOT_TOKEN=xoxb-your-token \
47
+ -e SLACK_DEFAULT_CHANNEL=C1234567890 \
48
+ -- uvx slack-notifier-mcp
49
+ ```
50
+
51
+ ## Features
52
+
53
+ - **Notify** - Send notifications when tasks complete, errors occur, or when stepping away
54
+ - **Ask & Wait** - Ask questions and wait for replies via Slack threads
55
+ - **Bidirectional** - Reply to Claude from Slack, get responses back in your terminal
56
+ - **Urgency Levels** - Normal, important, and critical notifications with appropriate formatting
57
+
58
+ ## Slack App Setup
59
+
60
+ Before using this server, you need to create a Slack app:
61
+
62
+ 1. Go to [api.slack.com/apps](https://api.slack.com/apps) and click **Create New App**
63
+ 2. Choose **From scratch**, name it (e.g., "Claude Code"), and select your workspace
64
+ 3. Go to **OAuth & Permissions** in the sidebar
65
+ 4. Under **Scopes > Bot Token Scopes**, add:
66
+ - `chat:write` - Send messages
67
+ - `channels:history` - Read public channel messages
68
+ - `groups:history` - Read private channel messages
69
+ - `im:history` - Read DM messages
70
+ - `users:read` - Get user display names
71
+ 5. Click **Install to Workspace** at the top
72
+ 6. Copy the **Bot User OAuth Token** (starts with `xoxb-`)
73
+
74
+ To get your default channel ID:
75
+ - Open Slack, right-click the channel, and select **View channel details**
76
+ - At the bottom, copy the **Channel ID** (starts with `C`)
77
+
78
+ ## Installation
79
+
80
+ ### Claude Code (Recommended)
81
+
82
+ ```bash
83
+ claude mcp add slack-notifier -s user \
84
+ -e SLACK_BOT_TOKEN=xoxb-your-token \
85
+ -e SLACK_DEFAULT_CHANNEL=C1234567890 \
86
+ -- uvx slack-notifier-mcp
87
+ ```
88
+
89
+ ### VS Code
90
+
91
+ ```bash
92
+ code --add-mcp '{"name":"slack-notifier","command":"uvx","args":["slack-notifier-mcp"],"env":{"SLACK_BOT_TOKEN":"xoxb-your-token","SLACK_DEFAULT_CHANNEL":"C1234567890"}}'
93
+ ```
94
+
95
+ ### Other MCP Clients
96
+
97
+ <details>
98
+ <summary><strong>Claude Desktop</strong></summary>
99
+
100
+ Add to your Claude Desktop config:
101
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
102
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
103
+ - **Linux**: `~/.config/Claude/claude_desktop_config.json`
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "slack-notifier": {
109
+ "command": "uvx",
110
+ "args": ["slack-notifier-mcp"],
111
+ "env": {
112
+ "SLACK_BOT_TOKEN": "xoxb-your-token",
113
+ "SLACK_DEFAULT_CHANNEL": "C1234567890"
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ </details>
121
+
122
+ <details>
123
+ <summary><strong>Cursor</strong></summary>
124
+
125
+ 1. Go to **Settings → MCP → Add new MCP Server**
126
+ 2. Select `command` type
127
+ 3. Enter command: `uvx slack-notifier-mcp`
128
+ 4. Add environment variables for `SLACK_BOT_TOKEN` and `SLACK_DEFAULT_CHANNEL`
129
+
130
+ Or add to `~/.cursor/mcp.json`:
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "slack-notifier": {
135
+ "command": "uvx",
136
+ "args": ["slack-notifier-mcp"],
137
+ "env": {
138
+ "SLACK_BOT_TOKEN": "xoxb-your-token",
139
+ "SLACK_DEFAULT_CHANNEL": "C1234567890"
140
+ }
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ </details>
147
+
148
+ <details>
149
+ <summary><strong>Windsurf / Other MCP Clients</strong></summary>
150
+
151
+ Any MCP-compatible client can use slack-notifier:
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "slack-notifier": {
157
+ "command": "uvx",
158
+ "args": ["slack-notifier-mcp"],
159
+ "env": {
160
+ "SLACK_BOT_TOKEN": "xoxb-your-token",
161
+ "SLACK_DEFAULT_CHANNEL": "C1234567890"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ </details>
169
+
170
+ ### Local Development
171
+
172
+ ```bash
173
+ git clone https://github.com/strand-ai/slack-notifier-mcp.git
174
+ cd slack-notifier-mcp
175
+ uv sync
176
+ uv run slack-notifier-mcp
177
+ ```
178
+
179
+ ## MCP Tools
180
+
181
+ ### `notify`
182
+
183
+ Send a notification to Slack.
184
+
185
+ ```python
186
+ notify(
187
+ message="GPU instance is ready! SSH: ubuntu@192.168.1.100",
188
+ urgency="important" # or "normal", "critical"
189
+ )
190
+ ```
191
+
192
+ **Parameters:**
193
+ - `message` (required): Notification text (supports Slack mrkdwn)
194
+ - `channel` (optional): Channel ID or name (uses default if not set)
195
+ - `urgency` (optional): `normal`, `important`, or `critical`
196
+
197
+ ### `ask_user`
198
+
199
+ Send a question and wait for the user's reply.
200
+
201
+ ```python
202
+ ask_user(
203
+ question="Should I use PostgreSQL or SQLite for the database?",
204
+ context="Setting up the backend for the new API",
205
+ timeout_minutes=10
206
+ )
207
+ # Returns: {"success": True, "reply": "Use PostgreSQL", ...}
208
+ ```
209
+
210
+ **Parameters:**
211
+ - `question` (required): The question to ask
212
+ - `channel` (optional): Channel ID or name
213
+ - `context` (optional): Additional context about what you're working on
214
+ - `timeout_minutes` (optional): How long to wait (default 5, max 30)
215
+
216
+ ### `send_message`
217
+
218
+ Lower-level message sending for conversational use.
219
+
220
+ ```python
221
+ send_message(
222
+ message="Done with the first step, moving on...",
223
+ thread_ts="1234567890.123456" # Reply in thread
224
+ )
225
+ ```
226
+
227
+ ### `get_thread_replies`
228
+
229
+ Check for new replies in a thread.
230
+
231
+ ```python
232
+ get_thread_replies(
233
+ channel="C1234567890",
234
+ thread_ts="1234567890.123456",
235
+ since_ts="1234567891.000000" # Only newer messages
236
+ )
237
+ ```
238
+
239
+ ## Environment Variables
240
+
241
+ | Variable | Required | Description |
242
+ |----------|----------|-------------|
243
+ | `SLACK_BOT_TOKEN` | Yes | Bot token from Slack app (xoxb-...) |
244
+ | `SLACK_DEFAULT_CHANNEL` | No | Default channel for notifications |
245
+
246
+ ## Example Usage
247
+
248
+ Tell Claude Code:
249
+
250
+ > "Notify me on Slack when the tests finish running"
251
+
252
+ > "Ask me on Slack whether to proceed with the database migration"
253
+
254
+ > "Send a Slack notification if any errors occur while I'm away"
255
+
256
+ ## Debugging
257
+
258
+ Run the MCP inspector to test tools:
259
+
260
+ ```bash
261
+ npx @anthropics/mcp-inspector uvx slack-notifier-mcp
262
+ ```
263
+
264
+ Check if your token works:
265
+
266
+ ```bash
267
+ curl -H "Authorization: Bearer xoxb-your-token" \
268
+ https://slack.com/api/auth.test
269
+ ```
270
+
271
+ ## Development
272
+
273
+ ```bash
274
+ # Install with dev dependencies
275
+ uv sync --extra dev
276
+
277
+ # Run tests
278
+ uv run pytest
279
+
280
+ # Format code
281
+ uv run black slack_mcp
282
+ uv run ruff check slack_mcp --fix
283
+ ```
284
+
285
+ ## License
286
+
287
+ MIT