Conversation
|
Hi @kinoh, may I ask you to elaborate a bit more on the root cause of the issue? From what I can see at a high level, MCP has been granted a token that provides permissions to fetch DMs and group DMs. With this PR, however, it looks like you are trying to strip out those capabilities. This doesn’t seem to align with the permissions granted by the connected token. Additionally, I feel the issue may only arise because search is being attempted in a multi-user context. If that’s the case, then in my opinion the problem should be addressed in a fundamentally different way. |
|
Thanks for the comment! Root Cause The issue is not a mismatch of Slack permissions but a visibility leakage problem. When the server runs as the token owner, search results seems to reflect user's visibility. Notably, in our testing, DM results appear in search even when the user token doesn't include Why Server-Side Filtering Slack's search.messages API requires a user token; bot tokens cannot use it. This means enabling search in a multi-user MCP setup requires sharing a personal token, which directly leads to the visibility leakage described above. Since we cannot avoid using a personal token for search, and token scopes don't reliably limit search visibility, server-side filtering is the only way to address this issue, I think. |
|
I've fixed conficts. |
Fix #119
Changes
SLACK_MCP_SAFE_SEARCHis set, exclude DMs from Slack API search results.filter_in_im_or_mpimas an error in safe search mode.Considerations
Tests