slack_api_retrieval_agent
Interface for querying and fetching data entities, including user profiles, communication threads, and structured message logs, from a designated Slack workspace via its native search capabilities. This system streamlines the extraction of organizational knowledge and interaction history within the Slack domain.
Author

takuya0206
Quick Info
Actions
Tags
Slack Search Toolset Nexus
This Model Context Protocol (MCP) node furnishes mechanisms for accessing and leveraging Slack's internal information retrieval engine. It empowers Large Language Models (LLMs) with the capacity to execute targeted lookups for personnel listings, channel inventories, message content, and dialogue archives within any connected Slack environment.
Operational Functions
Exposed Endpoints
get_users- Enumerates the roster of active members within the Slack instance.get_channels- Provides a manifest of established communication conduits (channels).get_channel_messages- Retrieves the chronological record of communications within a specified channel ID.get_thread_replies- Fetches the sequential sub-dialogue associated with a particular message timestamp.search_messages- Executes arbitrary text-based queries across the message corpus of Slack.
Data Access Pointers
allusers://- A URI alias to retrieve the complete set of workspace participants.allchannels://- A URI alias to retrieve the complete inventory of public and private channels.
Prerequisites
- The Bun execution runtime environment.
- A valid Slack API credential granting necessary read permissions.
Setup Procedure
- Clone this repository source code.
- Install necessary project dependencies: bash bun install
Execution Instructions
-
Configure the Slack authorization key via environment variables: bash export SLACK_TOKEN=xoxb-your-token-here
-
Initiate the server process: bash bun run index.ts
Alternatively, utilize the pre-compiled binary: bash ./dist/slack_search_function_mcp
Compilation Workflow
To produce the standalone executable:
bash bun run build
This action generates the final runnable artifact within the dist directory.
MCP Integration Schema
To enable an MCP-aware LLM to utilize this service, incorporate the following structure into its configuration file:
{ "mcpServers": { "slack": { "command": "/path/to/dist/slack_search_function_mcp", "env": { "SLACK_TOKEN": "xoxb-your-token-here" } } } }
Example Invocations (Tool Calls)
User Listing Retrieval
{ "name": "get_users", "arguments": { "limit": 10 } }
Channel Catalog Request
{ "name": "get_channels", "arguments": { "limit": 10, "exclude_archived": true } }
Specific Channel History Fetch
{ "name": "get_channel_messages", "arguments": { "channel": "C01234ABCDE", "limit": 10 } }
Dialogue Branch Excavation
{ "name": "get_thread_replies", "arguments": { "channel": "C01234ABCDE", "thread_ts": "1234567890.123456", "limit": 10 } }
Textual Content Search
{ "name": "search_messages", "arguments": { "query": "important announcement", "sort": "timestamp", "sort_dir": "desc", "count": 10 } }
Example Invocations (Resource Access)
Full User Roster Access
allusers://
Comprehensive Channel Index Access
allchannels://
Failure Management
The underlying service implements robust exception handling for scenarios including: - Authentication credential deficits or invalidity. - Exceeding API response rate limitations. - Underlying network transport malfunctions. - Submitting malformed input parameters. - Authorization denial from the Slack platform.
Security Posture
- The sensitive Slack API credential is cryptographically shielded and never persisted in logs or returned in service outputs.
- Authentication context is securely managed via environment variable injection.
