Overview
The Slack integration pulls channel messages into PR reviews. When Nectr reviews a PR, it queries the Slack MCP server for messages related to the PR’s topic or linked channels. This helps reviewers understand team discussions and decisions that influenced the code changes. Example: A PR titled “Migrate to Redis Cluster” triggers a search for Slack messages containing “Redis” or “caching”. Nectr includes relevant discussions in the review context.Status: The Slack integration is partially implemented. The MCP client method exists (
get_slack_messages), but it’s not yet called during the review workflow.How It Works
Slack integration uses the Model Context Protocol (MCP) — Nectr acts as an MCP client and calls a Slack MCP server to fetch messages.Graceful Degradation
IfSLACK_MCP_URL is not set or the Slack MCP server is offline:
- Nectr logs an info message:
"SLACK_MCP_URL not configured — skipping Slack message fetch" - Returns an empty list
[] - Review continues without Slack context
Prerequisites
- Slack Workspace (free or paid plan)
- Slack Bot Token with required scopes (see below)
- Slack MCP Server (self-hosted or cloud-deployed)
Setup Guide
1. Create a Slack App
Navigate to Slack API
Go to api.slack.com/apps → Create New App → From scratch
Configure Bot Scopes
Under OAuth & Permissions → Bot Token Scopes, add:
channels:history— Read public channel messageschannels:read— List public channelssearch:read— Search messages
2. Deploy a Slack MCP Server
You need an external MCP server that implements thesearch_messages tool. This server bridges Slack’s Web API and the MCP protocol.
- Docker (Recommended)
- Self-Hosted Python
- Hosted Service
3. Set Environment Variables
Add the following to Nectr’s.env:
.env
4. Restart Nectr
Usage
Automatic Message Fetching (Roadmap)
Status: This feature is planned but not yet implemented. The
get_slack_messages method exists in app/mcp/client.py, but it’s not called during the review workflow.- Extract keywords from the PR title and description
- Call Slack MCP server with
search_messages(channel, query) - Include message context in the AI prompt
Manual Testing
Test the Slack MCP server directly:Implementation Details
MCPClientManager (Placeholder)
File:app/mcp/client.py (not yet implemented)
The method signature exists but is not called during reviews:
MCP Request Format
Configuration Reference
Base URL of the Slack MCP server (e.g.,
http://slack-mcp-server:8003)Slack bot token for direct notifications (posting messages to Slack).Note: This is separate from the MCP integration. The MCP server handles authentication internally.
Slack signing secret for verifying webhook requests.Note: Used for Slack bot features (commands, interactivity), not MCP integration.
Troubleshooting
No messages returned
No messages returned
Cause: Slack MCP server is not running or
SLACK_MCP_URL is incorrect.Fix:- Test the MCP server directly:
curl http://slack-mcp-server:8003/ - Check logs:
docker logs slack-mcp-server - Verify
SLACK_MCP_URLis set in Nectr’s.env
Error: HTTP 401 Unauthorized
Error: HTTP 401 Unauthorized
Error: missing_scope
Error: missing_scope
Cause: Slack bot lacks required scopes (
channels:history, channels:read, search:read).Fix:- Add scopes at api.slack.com/apps → Your App → OAuth & Permissions → Scopes
- Reinstall the app to your workspace
Messages not relevant to PR
Messages not relevant to PR
Cause: Search query is too broad or channel is wrong.Fix:
- Filter messages by date range (last 7 days only)
- Use channel-specific queries (e.g.,
#eng-backendfor backend PRs)
Next Steps
MCP Protocol
Understand how MCP connects Nectr with Slack
Linear Integration
Pull linked issues into PR reviews
Environment Variables
Full configuration reference