Human-in-the-Loop Slack MCP Server

by trtd56

Not rated
GitHub

About

Allows AI assistants to request information and receive responses from humans via Slack.

Details

Author
trtd56
Categories
Communication, Other, Automation

Setup

Install Human-in-the-Loop Slack MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/trtd56/AskOnSlackMCP

Follow the installation instructions in the repository README, then restart your MCP client.

Allows AI assistants to request information and receive responses from humans via Slack.

A Model Context Protocol (MCP) server that enables AI assistants to request information from humans via Slack. This server acts as a bridge between AI systems and human experts, allowing AI to ask questions and receive responses through Slack when it needs human knowledge or clarification.

Run directly from GitHub without installation:

npx github:trtd56/AskOnSlackMCP \ --slack-bot-token "xoxb-your-bot-token" \ --slack-app-token "xapp-your-app-token" \ --slack-channel-id "C1234567890" \ --slack-user-id "U1234567890"

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{ "mcpServers": { "slack-human": { "command": "npx", "args": [ "github:trtd56/AskOnSlackMCP", "--slack-bot-token", "xoxb-your-actual-token", "--slack-app-token", "xapp-your-actual-token", "--slack-channel-id", "C1234567890", "--slack-user-id", "U1234567890" ] } } }

- πŸ€– MCP-compliant server for AI assistant integration
- πŸ’¬ Real-time Slack integration via Socket Mode WebSocket connection
- 🧡 Thread-based conversations for maintaining context
- ⏱️ 60-second timeout for human responses
- πŸ“’ User mentions (@username) for notifications
- πŸ” Comprehensive debugging and logging capabilities
- πŸ” Secure token handling
- πŸš€ Dynamic handler initialization for faster startup
- ⚑ Optimized for instant response detection with event-driven architecture

- Create a new Slack app athttps://api.slack.com/apps
- Enable Socket Mode in your app settings
- Generate an App-Level Token withconnections:writescope
- Install the app to your workspace

- chat:write- Send messages
- channels:read- Access channel information
- users:read- Access user information

- Enable Socket Mode in your app settings
- This is required for the app to receive events in real-time

If you want to install locally instead of using npx:

git clone https://github.com/trtd56/AskOnSlackMCP.git cd AskOnSlackMCP

All configuration is passed via command-line arguments:

- --slack-bot-token- Bot User OAuth Token (xoxb-...)
- --slack-app-token- App-Level Token for Socket Mode (xapp-...)
- --slack-channel-id- Channel ID where the bot will operate
- --slack-user-id- User ID to mention when asking questions
- --log-level- (Optional) Logging level (default: INFO)

Configure your MCP client to use this server directly from GitHub:

{ "mcpServers": { "human-in-the-loop-slack": { "command": "npx", "args": [ "github:trtd56/AskOnSlackMCP", "--slack-bot-token", "xoxb-your-token", "--slack-app-token", "xapp-your-token", "--slack-channel-id", "C1234567890", "--slack-user-id", "U1234567890" ] } } }
{ "mcpServers": { "human-in-the-loop-slack": { "command": "node", "args": [ "/path/to/AskOnSlackMCP/dist/index.js", "--slack-bot-token", "xoxb-your-token", "--slack-app-token", "xapp-your-token", "--slack-channel-id", "C1234567890", "--slack-user-id", "U1234567890" ] } } }

Main tool for asking questions to humans via Slack.

- question(string): The question to ask the human. Be specific and provide context.

{ "tool": "ask_on_slack", "arguments": { "question": "What is the API endpoint for the production server?" } }

- The bot will mention the specified user in the Slack channel
- The human has 60 seconds to respond in a thread
- The tool will return the human's response or timeout after 60 seconds

- npm run build- Compile TypeScript
- npm run dev- Run with hot-reloading
- npm start- Run compiled code
- npm test- Run tests with Vitest
- npm run test:ci- Run tests with coverage
- npm run lint- Run ESLint
- npm run format- Format code with Prettier
- npm run clean- Clean build artifacts

src/ β”œβ”€β”€ index.ts # Main MCP server implementation β”œβ”€β”€ bin.ts # Binary entry point for npx execution β”œβ”€β”€ human.ts # Abstract Human interface β”œβ”€β”€ slack-client.ts # Socket Mode Slack implementation └── types.ts # TypeScript type definitions tests/ β”œβ”€β”€ human.test.ts # Human abstract class tests β”œβ”€β”€ index.test.ts # CLI argument parsing tests β”œβ”€β”€ slack-client.test.ts # Slack client tests └── types.test.ts # Type definition tests

The project uses Vitest for testing. Tests are located in thetests/directory.

npm test # Run tests in watch mode npm run test:ci # Run tests once with coverage

The project uses GitHub Actions for continuous integration and deployment.

-

CI Workflow(ci.yml): Runs on every push and pull request

- Tests on Node.js 18.x, 20.x, and 22.x
- Runs linting and type checking
- Generates code coverage reports
- Builds the project

Release Workflow(release.yml): Runs on version tags

- Builds and tests the project
- Creates GitHub releases
- Publishes to npm (requires NPM_TOKEN secret)

- Verify all tokens are correct
- Check that the bot is invited to the channel
- Ensure Socket Mode is enabled in your Slack app

- Verify the user ID is correct (format: U1234567890)
- Ensure the user responds in the message thread, not the main channel
- Check that the bot has permission to read messages in the channel

- Bot token should start withxoxb-
- App token should start withxapp-
- Regenerate tokens if needed
- Verify bot has required scopes:chat:write,channels:read,users:read

- The server uses event-driven architecture for instant response detection
- WebSocket connection ensures real-time message delivery
- Detailed timing logs available with[TIMING]prefix for debugging

Slack for AI agents - a local service where agents can join projects, message each other, and share resources in a structured workspace

A GitHub Action that functions as a Slack MCP server, enabling secure image downloads and integrations with Slack.

A lightweight notification service that sends webhooks for completed MCP tasks to providers like Discord, Slack, and Teams.

An MCP server for interacting with the Slack API, allowing for sending messages, managing channels, and other workspace actions.

Interact with Slack workspaces, enabling message sending, channel management, and user interactions.

An MCP server for interacting with Slack workspaces using user tokens, without requiring bots or special permissions.

A server for integrating with Slack, enabling communication and automation within your workspace.

Interact with Slack workspaces as a user via the Slack API.

Post messages to Slack channels using incoming webhooks.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.