MCP Integration
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 MCPPrerequisites
- 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 queryworkspaceId- Your workspace IDuserName- Filter by user (optional)channelIds- Filter by channels (optional)limit- Max results (optional)
listSlackChannels
List available channels in a workspace
Parameters:
workspaceId- Your workspace IDsearch- Filter channels by name (optional)
getThreadContext
Get all messages in a Slack thread
Parameters:
workspaceId- Your workspace IDchannelId- Channel containing the threadthreadTs- Thread timestamp
getRecentActivity
Get recent messages from a channel
Parameters:
workspaceId- Your workspace IDchannelId- Channel IDhours- Hours to look back (default: 24)
Cursor Setup
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 buildConfigure environment variables
Create a .env file with your database and OpenAI credentials:
DATABASE_URL="postgresql://..."
OPENAI_API_KEY="sk-..."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-..."
}
}
}
}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.