Skip to main content

Overview

The Slack integration allows Nectr to pull relevant team messages during PR reviews. When reviewing a PR, Nectr can query Slack for:
  • Discussions about the feature being implemented
  • Design decisions made in team channels
  • Questions or concerns raised by team members
  • Context about why certain changes are needed
This helps ground PR reviews in the actual team conversation, ensuring the implementation aligns with what was discussed.
This is an inbound MCP integration — Nectr acts as an MCP client connecting to a Slack MCP server.

How It Works

1

PR references feature or discussion

Developer submits a PR with title: “Add rate limiting as discussed in #eng-infra”
2

Nectr extracts search keywords

During PR review, Nectr parses PR title, description, and changed files to identify relevant search terms
3

MCP query to Slack

Nectr calls the Slack MCP server to search for messages:
4

Context included in review

Slack messages are injected into the AI review prompt:
5

AI review validates against team decisions

Claude can now verify:
  • Does the PR implement what the team discussed?
  • Are there gaps between the Slack discussion and implementation?
  • Should the PR address additional points raised in Slack?

Setup

1. Create Slack App

1

Go to Slack API portal

Navigate to api.slack.com/apps
2

Create new app

Click “Create New App” → “From scratch”
  • App Name: “Nectr MCP”
  • Workspace: Select your workspace
3

Add OAuth scopes

Go to OAuth & PermissionsBot Token ScopesRequired scopes:
  • channels:history - Read public channel messages
  • channels:read - View basic channel information
  • search:read - Search workspace messages
  • users:read - View user information (for @mentions)
4

Install app to workspace

Click Install to Workspace and authorize
5

Copy Bot User OAuth Token

Copy the token starting with xoxb-

2. Deploy Slack MCP Server

You need a Slack MCP server running separately from Nectr. Build your own Slack MCP server:

3. Configure Nectr

Set environment variables in your Nectr backend:
Unlike Linear and Sentry integrations, the Slack bot token is stored in the MCP server itself, not passed from Nectr. This simplifies configuration since the bot token has workspace-level access.

API Reference

MCPClientManager (Slack Support)

The MCPClientManager doesn’t have a dedicated get_slack_messages() method yet. Use the generic query_mcp_server() method: Source: app/mcp/client.py:118 Usage:
Returns:
Returns empty list [] if:
  • SLACK_MCP_URL is not configured
  • Slack MCP server is unreachable
  • MCP call times out (10-second timeout)
  • No messages match the query
  • Channel not found

Adding a Dedicated Method

For consistency with other integrations, add a dedicated method:

Usage in PR Review Flow

Here’s how Slack context can be pulled during a review:

Example Review with Slack Context

Here’s how Slack context appears in an AI-generated review:

Channel Auto-Detection

Automatically determine which channels to search based on PR metadata:

Best Practices

Limit search scope

Only search 1-2 most relevant channels to avoid noise and rate limits

Use focused queries

Extract specific keywords from PR title/body rather than searching entire PR text

Cache results

Cache Slack search results for 10-15 minutes to avoid duplicate queries

Link to threads

Always include permalink so reviewers can read full thread context

Troubleshooting

No Slack context appearing in reviews

1

Check environment variable

Must be set and non-empty.
2

Test Slack MCP server directly

Should return JSON with messages.
3

Verify bot has channel access

Slack bot must be invited to the channel:
Or make the bot token have workspace-level search permissions.
4

Check channel name format

Use channel name without #: "eng-infra" not "#eng-infra"

Bot permissions errors

Ensure your Slack app has these OAuth scopes:
  • channels:history
  • channels:read
  • search:read
  • users:read
If you added scopes after installing, reinstall the app:
  1. Go to Slack API portal → Your App → Install App
  2. Click Reinstall to Workspace

Rate limiting

Slack has rate limits:
  • Tier 2 methods (conversations.history): 50 requests/min
  • Tier 3 methods (search.messages): 20 requests/min
Implement caching and limit queries:

Privacy Considerations

Slack messages often contain private team discussions. Consider:
  1. Only search public channels - Never search DMs or private channels
  2. Limit retention - Don’t store Slack messages long-term
  3. Redact sensitive info - Filter out tokens, passwords, emails
  4. Get team consent - Inform team that Slack may be used for PR context

Redacting Sensitive Information

Linear Integration

Pull linked issues and task context

Sentry Integration

Surface production errors for changed files
  • app/mcp/client.py:118 - Generic query_mcp_server() method
  • app/services/pr_review_service.py - How external context is used in reviews
  • app/core/config.py:70 - SLACK_MCP_URL setting