im-relay-mcp
Sends reports, blocking questions, and files to Slack channels or direct messages via a Slack bot; questions are marked #needs_reply and answered by replying in the thread.
Sends reports, blocking questions, and files to Telegram chats via a bot; questions are marked #needs_reply and answered by replying to the message.
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.
im-relay-mcp
English | δΈζ
An MCP server that lets coding agents (Claude Code and the like) reach a human over instant messaging: report progress, send files, and ask a question and block until the human replies. Telegram and Slack are supported; each project picks where its messages go.
Design principles
Minimal features. Only the few features that are needed and used often; more features would make it harder to use, not easier.
Minimal interruption. An agent can handle most things on its own most of the time; human intervention is kept to a minimum.
The agent need not know how. Which platform or channel a message goes through is invisible to the agent. All it knows is that what it sends this way reaches Your Majesty.
One interface. Different IMs may implement the same feature in different ways underneath, but the interface is the same for all of them. This follows from principle 3.
Related MCP server: Telegram MCP Server
Typical use
You have many repos (projects). Which IM and which channel a project's messages
go to rarely changes, but differs from project to project. Most of the time the
traffic is one-way, agent to user (reports, report_to_majesty); now and then
the agent needs the user to reply (waiting for the user's decision,
petition_majesty). Hence each project sets its destination in its own
.mcp.json (see Using it in a project).
What the agent sees
Server instructions:
Human-in-the-loop bridge to a real person over an instant-messaging chat.
Tools:
report_to_majesty: Report a message to Your Majesty (you will not receive a reply from Your Majesty)message(required): The message to report to Your Majesty (max 400 characters)Result:
Notification sent successfully. This is a one-way channel β you will NOT receive a reply from Your Majesty through this tool. If you need a response, use petition_majesty instead.
petition_majesty: Petition Your Majesty with a question and wait for the imperial reply (blocks you until Your Majesty replies)question(required): The question to petition Your Majesty with (max 400 characters)Result: the reply text, verbatim.
send_file: Send a file to Your Majesty (max 50 MB)filePath(required): The path to the file to sendcaption: Optional caption shown under the file (max 100 characters)Result:
File sent successfully
A call over a limit sends nothing and returns an error such as:
"message" is 450 characters, over the limit of 400
too many messages: 5 in the last minute, limit 5What the user sees
A report is an ordinary message.
A question starts with #needs_reply. Only a reply to that message answers
it: Telegram's Reply, or a reply in the message's thread on Slack.
Anyone in the chat may answer, so others can handle questions while the user
is away. Other messages are ignored. Once the agent has the user's reply, that
reply gets a π.
Setup
git clone https://github.com/WhymustIhaveaname/im-relay-mcp.git
cd im-relay-mcp
npm install
npm run build
cp .env.example .env # then fill it in; keep it chmod 600All bot credentials live in this one .env. Projects only say where to send.
Telegram
Create a bot with @BotFather and put its token in
TELEGRAM_TOKEN. To find a chat id, message the bot and run npm run ids.
Slack
Create an app at https://api.slack.com/apps β Create an App β Paste a manifest, with:
display_information:
name: IM Relay
features:
app_home:
messages_tab_enabled: true
messages_tab_read_only_enabled: false
bot_user:
display_name: IM Relay
always_online: true
oauth_config:
scopes:
bot:
- chat:write
- files:write
- reactions:write
- im:history
- im:read
- im:write
- channels:history
- groups:history
- users:read
settings:
event_subscriptions:
bot_events:
- message.im
- message.channels
- message.groups
socket_mode_enabled: trueThen:
Install App β install to the workspace; copy the Bot User OAuth Token (
xoxb-β¦) intoSLACK_BOT_TOKEN.Basic Information β App-Level Tokens β generate one with the
connections:writescope; copy it (xapp-β¦) intoSLACK_APP_TOKEN.Run
npm run idsto list destinations: the bot's direct message with each member, and every channel the bot was invited to (/invite @IM Relay).
Socket Mode needs no public URL.
Using it in a project
In the project's .mcp.json:
{
"mcpServers": {
"im-relay": {
"type": "stdio",
"command": "/path/to/im-relay-mcp/bin/im-relay",
"args": ["--to", "slack:D0123456789"]
}
}
}--to is telegram:<chat_id> or slack:<channel_id>. Without it the project
uses DEFAULT_TO from .env.
How it runs
Each agent session starts its own bin/im-relay, which forwards to one shared
daemon per install, starting it on first use. Only the daemon talks to the bots:
Telegram allows one poller per bot token, and Slack spreads events across all
open Socket Mode connections, so per-session connections would lose replies.
Sessions reach the daemon through
run/daemon.sock;run/is accessible to its owner only.Log:
daemon.login the install directory.Editing
.envstops the daemon; the next request starts it with the new settings. Unanswered petitions are lost when it stops.bin/im-relay stopstops it by hand, e.g. afternpm run build.
Credits
Started from qpd-v/mcp-communicator-telegram (ISC).
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
Human-in-the-loop for AI coding agents β ask questions, get approvals via Slack.
The communications layer for AI agents: posts, DMs, team rooms, and file exchange.
Hosted channels and direct chats so coding agents can message each other.
Messaging for AI agents: DMs, groups, presence, contacts and files between agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send messages to human users via chat platforms (currently Discord) and optionally wait for human responses, facilitating human-in-the-loop interactions.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with users via Telegram to request decisions, approvals, or specific input through text and clickable buttons. This facilitates a human-in-the-loop workflow where the AI can pause for feedback or send status notifications during long-running tasks.4-
- AlicenseAqualityCmaintenanceEnables bidirectional communication between AI coding assistants and Telegram, allowing interactive confirmations via inline buttons, media and screenshot ingestion, and on-demand message polling without a background daemon.6MIT
- AlicenseAqualityCmaintenanceEnables AI agents to notify users via Telegram or Discord when tasks complete, then wait for and receive the user's reply as the next instruction within the same session.21Apache 2.0