SlackMemory
/Documentation

MCP Integration

Cursor & Claude

Query your Slack history directly from Cursor, Claude Desktop, or any MCP-compatible client.

What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI assistants to connect to external data sources. With Slack Memory's MCP server, you can ask Cursor or Claude questions about your Slack history while you code.

Learn about MCP

Prerequisites

  • Cursor IDE or Claude Desktop app
  • Node.js 18+ installed
  • Slack Memory running locally with database access
  • OpenAI API key (for embeddings)

Available Tools

semanticSearchMessages

Search Slack messages using AI-powered semantic search

Parameters:

  • query - Natural language search query
  • workspaceId - Your workspace ID
  • userName - Filter by user (optional)
  • channelIds - Filter by channels (optional)
  • limit - Max results (optional)

listSlackChannels

List available channels in a workspace

Parameters:

  • workspaceId - Your workspace ID
  • search - Filter channels by name (optional)

getThreadContext

Get all messages in a Slack thread

Parameters:

  • workspaceId - Your workspace ID
  • channelId - Channel containing the thread
  • threadTs - Thread timestamp

getRecentActivity

Get recent messages from a channel

Parameters:

  • workspaceId - Your workspace ID
  • channelId - Channel ID
  • hours - Hours to look back (default: 24)

Cursor Setup

1

Clone and build Slack Memory

Clone the Slack Memory repository and build the MCP server:

git clone https://github.com/your-org/slackdb.git
cd slackdb/apps/slack-vector-app
npm install
npm run build
2

Configure environment variables

Create a .env file with your database and OpenAI credentials:

DATABASE_URL="postgresql://..."
OPENAI_API_KEY="sk-..."
3

Add to Cursor MCP settings

Add Slack Memory to your Cursor MCP configuration at .cursor/mcp.json:

{
  "mcpServers": {
    "slackdb": {
      "command": "node",
      "args": ["/path/to/slackdb/apps/slack-vector-app/mcp/index.js"],
      "env": {
        "DATABASE_URL": "postgresql://...",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}
4

Restart Cursor and test

Restart Cursor to load the MCP server. Then try asking questions like:

  • "Search my Slack for discussions about the API design"
  • "What did the team decide about authentication?"
  • "Show me recent messages in the #engineering channel"

Claude Desktop Setup

The setup for Claude Desktop is similar. Add Slack Memory to your Claude configuration at~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "slackdb": {
      "command": "node",
      "args": ["/path/to/slackdb/apps/slack-vector-app/mcp/index.js"],
      "env": {
        "DATABASE_URL": "postgresql://...",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Tips

Find your workspace ID

You can find your workspace ID in the Slack Memory dashboard or Settings page. The MCP tools require this ID to know which Slack workspace to search.

Use natural language

The semantic search understands meaning, not just keywords. Ask questions naturally like "What were the concerns about the new pricing model?"

Database connection

The MCP server connects directly to your Postgres database. Make sure yourDATABASE_URL is accessible from your local machine.