ask-a-human
v0.5.0
Published
MCP server that lets Claude Code pause and ask humans for input via Discord or Slack
Maintainers
Readme
ask-a-human
An MCP server that lets Claude Code pause and ask you a question on Discord or Slack. You reply in a thread, and Claude continues with your answer.
Roadmap
- Telegram Support (March 5, 2026) — Enable Claude to ask you questions via Telegram!
Why
This isn't a chat interface for Claude Code. It's an escape hatch for fully autonomous workflows.
When you let Claude Code run on its own refactoring a codebase, building a feature end-to-end, or debugging a complex issue it will occasionally hit a fork in the road: a trade-off you didn't anticipate, a design decision with no obvious right answer, or a critical juncture where moving forward without your input could mean wasted work. In those moments, Claude can choose to reach out to you on Discord or Slack, get your steer, and continue rather than guessing wrong or stopping entirely. It's meant for the agent to reach you if it really needs to, and not for every little thing.
The goal is to let you stay away from the terminal while Claude works, and only get pulled in when it genuinely matters.
How it works
- Claude Code calls the
ask_humantool with a question - The bot posts the question to your Discord channel or Slack channel and @mentions you
- A thread is created for the question
- Claude Code waits until you reply in the thread
- Your reply is returned to Claude (along with a
thread_id) and it continues working - If Claude needs to follow up, it calls
ask_humanagain with the samethread_idto continue the conversation in the same thread
Setup
Choose one platform per MCP server instance. The platform is auto-detected from environment variables.
Discord
1. Create a Discord bot
- Go to the Discord Developer Portal
- Click New Application and give it a name
- Go to Bot in the sidebar
- Click Reset Token and copy it — this is your
DISCORD_BOT_TOKEN - Enable Message Content Intent (scroll down on the Bot page)
- Go to OAuth2 > URL Generator
- Check the
botscope - Check these permissions: Send Messages, Send Messages in Threads, Create Public Threads, Read Message History, Embed Links
- Copy the generated URL and open it to invite the bot to your server
2. Get your Discord IDs
- Open Discord Settings > Advanced > enable Developer Mode
- Right-click the channel where you want questions posted > Copy Channel ID — this is your
DISCORD_CHANNEL_ID - Right-click your username > Copy User ID — this is your
DISCORD_USER_ID
3. Add to Claude Code
claude mcp add ask-a-human-discord \
-e DISCORD_BOT_TOKEN=your-bot-token \
-e DISCORD_CHANNEL_ID=your-channel-id \
-e DISCORD_USER_ID=your-user-id \
-- npx ask-a-humanSlack
1. Create a Slack app
- Go to Slack API: Your Apps
- Click Create New App > From scratch
- Name it (e.g. "Ask a Human") and select your workspace
2. Enable Socket Mode
- Go to Settings > Basic Information > App-Level Tokens
- Click Generate Token and Scopes
- Name it (e.g. "socket") and add the
connections:writescope - Click Generate and copy the token — this is your
SLACK_APP_TOKEN(starts withxapp-) - Go to Settings > Socket Mode and toggle it on
3. Configure bot permissions
- Go to OAuth & Permissions in the sidebar
- Under Bot Token Scopes, add:
chat:write— post messageschannels:history— read thread replies in public channelsgroups:history— read thread replies in private channels (if needed)
- Click Install to Workspace (or Reinstall if already installed)
- Copy the Bot User OAuth Token — this is your
SLACK_BOT_TOKEN(starts withxoxb-)
4. Subscribe to events
- Go to Event Subscriptions and toggle it on
- Under Subscribe to bot events, add:
message.channels— messages in public channelsmessage.groups— messages in private channels (if needed)
- Click Save Changes
5. Get your Slack IDs
- Open Slack, right-click the channel > View channel details > copy the Channel ID at the bottom — this is your
SLACK_CHANNEL_ID - Click your profile picture > Profile > click the ⋯ menu > Copy member ID — this is your
SLACK_USER_ID - Invite the bot to your channel: type
/invite @YourBotNamein the channel
6. Add to Claude Code
claude mcp add ask-a-human-slack \
-e SLACK_BOT_TOKEN=xoxb-your-bot-token \
-e SLACK_APP_TOKEN=xapp-your-app-token \
-e SLACK_CHANNEL_ID=your-channel-id \
-e SLACK_USER_ID=your-user-id \
-- npx ask-a-humanTool
ask_human
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| question | string | Yes | The question to ask |
| thread_id | string | No | Thread ID from a previous response to continue the conversation in the same thread |
The question is posted as a plain text message with an @mention and a thread is created for your reply. Important: You must reply in the thread, not in the channel — only thread replies are picked up by the bot.
Every successful response includes a thread_id at the end (e.g. [thread_id: 123456789]). Pass this back in a subsequent call to continue the conversation in the same thread instead of creating a new one.
New question:
{
"question": "Should I use PostgreSQL or SQLite for the local dev database?"
}Follow-up in the same thread:
{
"question": "Got it — PostgreSQL. Should I use Prisma or Drizzle as the ORM?",
"thread_id": "123456789"
}Configuration
| Environment Variable | Platform | Required | Default | Description |
|---------------------|----------|----------|---------|-------------|
| DISCORD_BOT_TOKEN | Discord | Yes | — | Your Discord bot token |
| DISCORD_CHANNEL_ID | Discord | Yes | — | Channel ID where questions are posted |
| DISCORD_USER_ID | Discord | No | — | Your user ID for @mentions |
| SLACK_BOT_TOKEN | Slack | Yes | — | Bot User OAuth Token (xoxb-) |
| SLACK_APP_TOKEN | Slack | Yes | — | App-Level Token (xapp-) with connections:write |
| SLACK_CHANNEL_ID | Slack | Yes | — | Channel ID where questions are posted |
| SLACK_USER_ID | Slack | No | — | Your member ID for @mentions |
| ASK_TIMEOUT_MS | Both | No | 18000000 | Timeout in milliseconds (default: 5 hours, 0 for no timeout) |
Edge cases
- Multiple replies: First thread reply wins; subsequent replies are ignored
- Empty messages: Returned as
(empty message) - Bot messages: Filtered out automatically
- Disconnections: Both Discord.js and Slack Bolt handle reconnection automatically; pending questions persist in memory
- Shutdown: Pending questions return an error; cleanup is graceful on SIGINT/SIGTERM
- Both platforms configured: Exits with a clear error — configure one platform per instance
- Neither platform configured: Exits with a clear error
Contributing
See CONTRIBUTING.md for development setup and testing instructions.
License
MIT
