lifeline-mcp
Posts human-in-the-loop questions to a configured Slack channel, optionally mentions users, waits for threaded replies, and returns the human response or a timeout message to the AI agent.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lifeline-mcp
Human-in-the-loop MCP server for Claude Code and other AI agents. Get human input via Slack when AI agents are stuck or facing critical decisions.
Quick Demo
Note: Make sure you've exported the required environment variables before running. See Configuration below.
claude \
--mcp-config '{"mcpServers":{"lifeline":{"command":"npx","args":["lifeline-mcp"]}}}' \
--allowedTools "mcp__lifeline__ask_human" \
-p "Bootstrap a simple MCP server that exposes a get_weather tool. \
If you encounter any dependency issues, use the ask_human tool to ask for help"What happens:
Claude scaffolds the project, installs the MCP SDK, and writes the tool with Zod validation
While testing, Claude discovers the tool's input schema isn't working — the MCP SDK expects Zod v3 but installed Zod v4
Claude calls
ask_human— a message appears in Slack:┌───────────────────────────────────────────────────────────────┐ │ AI Agent Needs Input │ ├───────────────────────────────────────────────────────────────┤ │ @you Question: │ │ Hit a Zod version compatibility issue. How should I proceed? │ │ │ │ Context: │ │ The MCP SDK's schema conversion expects Zod v3, but npm │ │ installed Zod v4. The tool's inputSchema is empty. │ │ │ │ Suggested options: │ │ 1. Import from "zod/v3" — quick fix, keeps v4 available │ │ 2. Write a compat layer — more flexible but more code │ │ 3. Use raw JSON Schema — works but loses type inference │ ├───────────────────────────────────────────────────────────────┤ │ Reply in a thread to respond to the agent. │ └───────────────────────────────────────────────────────────────┘You reply: "Just use v3, it's a proof of concept"
Claude fixes the import and the MCP server works
Related MCP server: Slack Note Capture MCP Server
How It Works
┌─────────────────┐ MCP Call ┌──────────────────┐
│ Claude Code │ ──────────────────▶│ lifeline-mcp │
│ │ │ (MCP Server) │
└─────────────────┘ └────────┬─────────┘
│
WebSocket (Socket Mode)
│
▼
┌──────────────────┐
│ Slack │
│ (post message, │
│ wait for reply) │
└──────────────────┘AI agent calls the
ask_humantool when stuck or needing inputMessage is posted to your configured Slack channel (with optional user mentions)
Human replies in a thread
Response is returned to the AI agent
Prerequisites
Slack App Setup
Go to api.slack.com/apps and create a new app
Under Socket Mode, enable it and create an App-Level Token with
connections:writescopeUnder OAuth & Permissions, add these Bot Token Scopes:
chat:write- Post messageschannels:history- Read thread replies in public channelschannels:read- View channel infogroups:history- Read thread replies in private channels (if needed)
Under Event Subscriptions, enable events and subscribe to these bot events:
message.channels- Messages in public channelsmessage.groups- Messages in private channels (if needed)
Install the app to your workspace
Copy the Bot User OAuth Token (
xoxb-...)Copy the App-Level Token (
xapp-...)Invite the bot to your target channel:
/invite @YourBotName
Installation
npm install -g lifeline-mcp
# or use with npx
npx lifeline-mcpConfiguration
Environment Variables
Variable | Required | Description |
| Yes | Bot User OAuth Token ( |
| Yes | App-Level Token for Socket Mode ( |
| Yes | Channel ID to post messages to (e.g., |
| No | Comma-separated Slack user IDs to mention (e.g., |
| No | Response timeout in ms (default: |
Claude Code Configuration
Add to your Claude Code MCP settings (~/.claude/claude_desktop_config.json or project .mcp.json):
{
"mcpServers": {
"lifeline": {
"command": "npx",
"args": ["lifeline-mcp"]
}
}
}Environment variables are read from the shell environment. Set them before running Claude Code:
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_APP_TOKEN="xapp-your-app-token"
export SLACK_CHANNEL_ID="C0123456789"
export SLACK_USER_IDS="U0123456789,U9876543210" # optional
export LIFELINE_TIMEOUT_MS="180000" # optional
# Then run Claude Code
claudeTool: ask_human
Request input from a human when the AI agent is stuck, uncertain, or facing a critical decision.
Parameters
Parameter | Type | Required | Description |
| string | Yes | The question or decision point |
| string | No | Additional context about the situation |
| string[] | No | Suggested options for the human to choose from |
| "low" | "normal" | "high" | No | Urgency level (default: "normal") |
Example Usage
// Simple question
ask_human({
question: "Should I refactor this function or leave it as is?"
})
// With context and options
ask_human({
question: "Which database should I use for this feature?",
context: "Building a real-time chat feature that needs low latency",
options: ["PostgreSQL", "MongoDB", "Redis"],
urgency: "normal"
})
// High urgency
ask_human({
question: "This will delete 500 records. Should I proceed?",
context: "Running database cleanup script",
urgency: "high"
})Response
When a human responds, you'll receive:
Human response (from user U0123456789): Use PostgreSQL for durabilityOn timeout:
No response received within 180 seconds. Please proceed with your best judgment.Finding Slack IDs
Channel ID: Open Slack, right-click channel name → "View channel details" → scroll to bottom for ID
User ID: View a profile → click "..." → "Copy member ID"
Development
# Install dependencies
bun install
# Run in development
bun run dev
# Run tests
bun run test
# Build
bun run buildLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Give any AI agent a way to ask a person — for approval, a decision, an answer or a review.
Human-in-the-loop for AI coding agents — ask questions, get approvals via Slack.
Chat with your AI agents from Slack: each gets a thread in your DM, and your replies there wake it.
Let AI agents ask a real person for a decision on their phone and wait for the answer.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Human-in-the-Loop MCP server that enables AI assistants to request information or clarification from humans via Slack. It uses real-time, thread-based conversations with socket mode integration to bridge the gap between AI systems and human experts.6MIT
- FlicenseAqualityNot gradedmaintenanceEnables two-way communication between Claude and Slack for posting messages, managing threads, and handling files. It specifically supports asynchronous workflows by allowing Claude to poll for remote user replies and send task notifications.9-
- AlicenseNot gradedqualityDmaintenancePauses AI agent execution and routes approval requests to humans via Slack or email, with cryptographically signed proof of the human's decision.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to request information and clarification from humans via Slack, supporting multiple roles and transport modes.-