Slack Mentions
The optional Slack interface answers @bot <question> from approved Index documentation and repository metadata. MCP and Slack call the same transport-neutral IndexService; Slack does not maintain a second document index.
The Node.js HTTP runtime exposes both POST /mcp and POST /slack/events. Use npm run mcp:http during development; prebuilt deployments use npm run runtime:start.
Defaults
- OAuth scopes are limited to
app_mentions:readandchat:write. - Event subscriptions contain only
app_mention. - Slack request signatures, timestamps, workspace restrictions, retries, and duplicate event IDs are checked.
- Search is denied unless the signed event's exact workspace and channel match
slack/access-policy.json. - Matching results are filtered by repository-relative path prefix and visibility before a reply is rendered.
- Replies are threaded, bounded in length, escaped for Slack markup, and disable link unfurling.
- Search is read-only.
Channel Access Policy
The policy starts with an empty rule list, so no Slack channel is approved until it is edited. Add one rule for each channel that may search the Index:
json
{
"teamId": "T0123456789",
"channelId": "C0123456789",
"allowPathPrefixes": ["docs/approved/", "repos/"],
"allowVisibilities": ["internal"]
}Directory prefixes end in /; a prefix without / matches one exact path. Repository results use repos/<repository-name>, while documents use repository-relative paths.
The runtime rejects unknown policy fields, unsafe paths, unsupported visibility values, duplicate workspace/channel rules, and any default action other than deny. Missing or invalid policy files produce a generic denial and do not run a search.
Verify
bash
npm run slack:policy:check
npm run mcp:check
npm run mcp:testStore SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET in the deployment platform, never in repository files. Set SLACK_ALLOWED_TEAM_ID when the app should accept events from only one workspace.