You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,13 +173,14 @@ Fetches a CSV directory of all users in the workspace.
173
173
|`SLACK_MCP_SERVER_CA`| No |`nil`| Path to CA certificate |
174
174
|`SLACK_MCP_SERVER_CA_TOOLKIT`| No |`nil`| Inject HTTPToolkit CA certificate to root trust-store for MitM debugging |
175
175
|`SLACK_MCP_SERVER_CA_INSECURE`| No |`false`| Trust all insecure requests (NOT RECOMMENDED) |
176
-
|`SLACK_MCP_ADD_MESSAGE_TOOL`| No |`nil`| Enable message posting via `conversations_add_message`and emoji reactions via `reactions_add`/`reactions_remove`by setting it to true for all channels, a comma-separated list of channel IDs to whitelist specific channels, or use `!` before a channel ID to allow all except specified ones, while an empty value disables these tools by default. |
177
-
|`SLACK_MCP_ADD_MESSAGE_MARK`| No |`nil`| When the `conversations_add_message`tool is enabled, any new message sent will automatically be marked as read.|
176
+
|`SLACK_MCP_ADD_MESSAGE_TOOL`| No |`nil`| Enable message posting via `conversations_add_message` by setting it to `true` for all channels, a comma-separated list of channel IDs to whitelist specific channels, or use `!` before a channel ID to allow all except specified ones. If empty, the tool is only registered when explicitly listed in `SLACK_MCP_ENABLED_TOOLS`. |
177
+
|`SLACK_MCP_ADD_MESSAGE_MARK`| No |`nil`| When `conversations_add_message` is enabled (via `SLACK_MCP_ADD_MESSAGE_TOOL` or `SLACK_MCP_ENABLED_TOOLS`), setting this to `true` will automatically mark sent messages as read. |
178
178
|`SLACK_MCP_ADD_MESSAGE_UNFURLING`| No |`nil`| Enable to let Slack unfurl posted links or set comma-separated list of domains e.g. `github.com,slack.com` to whitelist unfurling only for them. If text contains whitelisted and unknown domain unfurling will be disabled for security reasons. |
179
179
|`SLACK_MCP_USERS_CACHE`| No |`~/Library/Caches/slack-mcp-server/users_cache.json` (macOS)<br>`~/.cache/slack-mcp-server/users_cache.json` (Linux)<br>`%LocalAppData%/slack-mcp-server/users_cache.json` (Windows) | Path to the users cache file. Used to cache Slack user information to avoid repeated API calls on startup. |
180
180
|`SLACK_MCP_CHANNELS_CACHE`| No |`~/Library/Caches/slack-mcp-server/channels_cache_v2.json` (macOS)<br>`~/.cache/slack-mcp-server/channels_cache_v2.json` (Linux)<br>`%LocalAppData%/slack-mcp-server/channels_cache_v2.json` (Windows) | Path to the channels cache file. Used to cache Slack channel information to avoid repeated API calls on startup. |
181
181
|`SLACK_MCP_LOG_LEVEL`| No |`info`| Log-level for stdout or stderr. Valid values are: `debug`, `info`, `warn`, `error`, `panic` and `fatal`|
182
182
|`SLACK_MCP_GOVSLACK`| No |`nil`| Set to `true` to enable [GovSlack](https://slack.com/solutions/govslack) mode. Routes API calls to `slack-gov.com` endpoints instead of `slack.com` for FedRAMP-compliant government workspaces. |
183
+
|`SLACK_MCP_ENABLED_TOOLS`| No |`nil`| Comma-separated list of tools to register. If empty, all read-only tools are registered; write tools (`conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`) require their specific env var OR must be explicitly listed here. When a write tool is listed here, it's enabled without channel restrictions. Available tools: `conversations_history`, `conversations_replies`, `conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`, `conversations_search_messages`, `channels_list`. |
183
184
184
185
*You need one of: `xoxp` (user), `xoxb` (bot), or both `xoxc`/`xoxd` tokens for authentication.
|`--transport` or `-t`| Yes | Select transport for the MCP Server, possible values are: `stdio`, `sse`|
264
+
|`--enabled-tools` or `-e`| No | Comma-separated list of tools to register. If not set, all tools are registered. Runtime permissions (e.g., `SLACK_MCP_ADD_MESSAGE_TOOL`) are still enforced. Available tools: `conversations_history`, `conversations_replies`, `conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`, `conversations_search_messages`, `channels_list`. |
264
265
265
266
### Environment Variables
266
267
@@ -278,9 +279,86 @@ docker-compose up -d
278
279
|`SLACK_MCP_SERVER_CA`| No |`nil`| Path to CA certificate |
279
280
|`SLACK_MCP_SERVER_CA_TOOLKIT`| No |`nil`| Inject HTTPToolkit CA certificate to root trust-store for MitM debugging |
280
281
|`SLACK_MCP_SERVER_CA_INSECURE`| No |`false`| Trust all insecure requests (NOT RECOMMENDED) |
281
-
|`SLACK_MCP_ADD_MESSAGE_TOOL`| No |`nil`| Enable message posting via `conversations_add_message` by setting it to true for all channels, a comma-separated list of channel IDs to whitelist specific channels, or use `!` before a channel ID to allow all except specified ones, while an empty value disables posting by default. |
282
-
|`SLACK_MCP_ADD_MESSAGE_MARK`| No |`nil`| When the `conversations_add_message`tool is enabled, any new message sent will automatically be marked as read.|
282
+
|`SLACK_MCP_ADD_MESSAGE_TOOL`| No |`nil`| Enable message posting via `conversations_add_message` by setting it to `true` for all channels, a comma-separated list of channel IDs to whitelist specific channels, or use `!` before a channel ID to allow all except specified ones. If empty, the tool is only registered when explicitly listed in `SLACK_MCP_ENABLED_TOOLS`. |
283
+
|`SLACK_MCP_ADD_MESSAGE_MARK`| No |`nil`| When `conversations_add_message` is enabled (via `SLACK_MCP_ADD_MESSAGE_TOOL` or `SLACK_MCP_ENABLED_TOOLS`), setting this to `true` will automatically mark sent messages as read. |
283
284
|`SLACK_MCP_ADD_MESSAGE_UNFURLING`| No |`nil`| Enable to let Slack unfurl posted links or set comma-separated list of domains e.g. `github.com,slack.com` to whitelist unfurling only for them. If text contains whitelisted and unknown domain unfurling will be disabled for security reasons. |
284
285
|`SLACK_MCP_USERS_CACHE`| No |`.users_cache.json`| Path to the users cache file. Used to cache Slack user information to avoid repeated API calls on startup. |
285
286
|`SLACK_MCP_CHANNELS_CACHE`| No |`.channels_cache_v2.json`| Path to the channels cache file. Used to cache Slack channel information to avoid repeated API calls on startup. |
286
287
|`SLACK_MCP_LOG_LEVEL`| No |`info`| Log-level for stdout or stderr. Valid values are: `debug`, `info`, `warn`, `error`, `panic` and `fatal`|
288
+
|`SLACK_MCP_ENABLED_TOOLS`| No |`nil`| Comma-separated list of tools to register. If empty, all read-only tools are registered; write tools (`conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`) require their specific env var to be set OR must be explicitly listed here. When a write tool is listed here, it's enabled without channel restrictions. Available tools: `conversations_history`, `conversations_replies`, `conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`, `conversations_search_messages`, `channels_list`. |
289
+
290
+
### Tool Registration and Permissions
291
+
292
+
#### Overview
293
+
294
+
Tools are controlled at two levels:
295
+
-**Registration** (`SLACK_MCP_ENABLED_TOOLS`) — determines which tools are visible to MCP clients
296
+
-**Runtime permissions** (tool-specific env vars like `SLACK_MCP_ADD_MESSAGE_TOOL`) — channel restrictions for write tools
297
+
298
+
Write tools (`conversations_add_message`, `reactions_add`, `reactions_remove`, `attachment_get_data`) are **not registered by default** to prevent accidental exposure. To enable them, you must either:
299
+
1. Set their specific environment variable (e.g., `SLACK_MCP_ADD_MESSAGE_TOOL`), or
300
+
2. Explicitly list them in `SLACK_MCP_ENABLED_TOOLS`
301
+
302
+
#### Examples
303
+
304
+
**Example 1: Read-only mode (default)**
305
+
306
+
By default, only read-only tools are available. No write tools are registered.
307
+
308
+
```json
309
+
{
310
+
"env": {
311
+
"SLACK_MCP_XOXP_TOKEN": "xoxp-..."
312
+
}
313
+
}
314
+
```
315
+
316
+
**Example 2: Enable messaging to specific channels**
317
+
318
+
Use `SLACK_MCP_ADD_MESSAGE_TOOL` to enable messaging with channel restrictions:
0 commit comments