slack-integration-gateway
Facilitate direct communication and data retrieval from Slack environments, encompassing channel administration, message delivery, and user metadata acquisition via a unified protocol interface. This accelerates team synchronization processes and automates operational workflows within the designated Slack instance.
Author

Chandrakant0110
Quick Info
Actions
Tags
Slack Integration Gateway (Model Context Protocol Adapter)
This repository furnishes an implementation of a Slack Model Context Protocol (MCP) server, designed to expose various Slack Application Programming Interface (API) capabilities through a standardized access layer. It empowers artificial intelligence agents to seamlessly interface with Slack functionalities.
Core Capabilities
- Enumeration of publicly accessible conversation spaces
- Dispatching of textual content to designated channels
- Insertion of replies into ongoing discussion threads
- Application of emoji reactions to specific messages
- Retrieval of recent conversational records
- Fetching of subordinate replies within a thread structure
- Directory listing of workspace participants
- Extraction of comprehensive user profile details
Necessary Prerequisites
- Execution environment: Node.js, version 16 or newer
- Package management tool: npm or yarn
- Administrative credentials for a target Slack workspace
- A valid Slack OAuth Bot Token
- The unique identifier for your Slack Team
Setup Instructions
- Obtain a local copy of this source code repository.
- Install all required software packages:
bash npm install
Alternatively
yarn install
- Compile the TypeScript source files:
bash npm run build
Alternatively
yarn build
Configuration Procedure
- Edit the primary entry point file,
index.ts, and substitute the placeholder strings:
typescript public static readonly BOT_TOKEN = "substitute-bot-token-here"; public static readonly TEAM_ID = "substitute-team-id-here";
Replace these values with your actual Slack authorization token and team identifier.
Operational Guidance
Launching the Adapter Service
Once compilation is complete, initiate the server component:
bash node dist/index.js
Integration within Cursor IDE
To enable this MCP service for use within the Cursor development environment:
- Access the Cursor application settings interface.
- Locate and select the configuration area designated for the "Model Context Protocol".
- Introduce a novel tool entry utilizing the following specifications:
- Tool Identifier:
slack - Execution Command:
node /absolute/path/to/your/dist/index.js - Context Directory:
/absolute/path/to/your/project
Ensure that /absolute/path/to/your is replaced by the actual filesystem location of your project directory.
Exposed Functionalities (Tools)
slack_list_channels- Purpose: Retrieves a roster of public conversation channels within the workspace.
-
Optional Arguments:
limit(maximum count),cursor(for pagination) -
slack_post_message - Purpose: Dispatches a formulated message payload to a specified channel.
-
Required Arguments:
channel_id,text(message content) -
slack_reply_to_thread - Purpose: Inserts a response into an existing message thread.
-
Required Arguments:
channel_id,thread_ts(thread identifier),text -
slack_add_reaction - Purpose: Attaches an emoji annotation to a message object.
-
Required Arguments:
channel_id,timestamp(message identifier),reaction(emoji name) -
slack_get_channel_history - Purpose: Fetches the most recent communications within a channel.
- Required Arguments:
channel_id -
Optional Arguments:
limit -
slack_get_thread_replies - Purpose: Recovers every subordinate response associated with a thread.
-
Required Arguments:
channel_id,thread_ts -
slack_get_users - Purpose: Generates a comprehensive listing of all registered workspace members.
-
Optional Arguments:
limit,cursor -
slack_get_user_profile - Purpose: Obtains detailed attribute data pertaining to a specific user entity.
- Required Arguments:
user_id
Maintenance Guidelines
To institute modifications to the service logic:
- Implement desired changes within
index.ts. - Re-execute the compilation sequence: bash npm run build
Or alternatively
yarn build
Security Considerations
- Under no circumstances should sensitive credentials (Bot Token or Team ID) be committed to persistent version control systems.
- It is strongly recommended to leverage environment variables for credential management in deployment environments.
- Verify that the Slack Bot is provisioned with the requisite OAuth permissions (scopes) for all intended operations.
Community Involvement
Contributions via issue reports or code pull requests for enhancements are welcome.
