A Model Context Protocol (MCP) server that enables Claude Code to send questions and notifications via Telegram.
- Ask Questions: Claude can send questions to you via Telegram when it needs clarification
- Send Notifications: Claude can notify you of important events, task completions, or status updates
- Get Responses: Claude can check for your replies to previous questions
- A Telegram bot (create one via @BotFather)
- Your Telegram chat ID (get it from @userinfobot)
- Node.js 18+
git clone https://github.com/Stig-Johnny/telegram-mcp-server.git
cd telegram-mcp-server
npm installCreate a file at ~/.claude/telegram-secrets.json (or any secure location):
{
"bot_token": "YOUR_BOT_TOKEN_FROM_BOTFATHER",
"chat_id": "YOUR_TELEGRAM_CHAT_ID"
}Security: This file contains secrets and should NOT be committed to git.
Add to your ~/.claude/config.json:
{
"mcpServers": {
"telegram-notifications": {
"command": "node",
"args": ["/path/to/telegram-mcp-server/index.js"],
"env": {
"TELEGRAM_CONFIG_FILE": "/Users/yourusername/.claude/telegram-secrets.json"
}
}
}
}The MCP server will be available in your next Claude Code session.
Send a question to the user via Telegram.
Parameters:
question(required): The question to askcontext(optional): Additional context about what you're working on
Example:
Claude uses ask_user_telegram with question: "Should I use JWT or session-based authentication?"
Send a notification to the user via Telegram.
Parameters:
message(required): The notification messageurgency(optional):"low","normal", or"high"
Example:
Claude uses notify_user_telegram with message: "Build completed successfully!" urgency: "normal"
Check for the user's response to a previous question (text or button click).
Parameters:
limit(optional): Number of recent messages to check (default: 10)
Ask a yes/no question with clickable buttons.
Parameters:
question(required): The yes/no question to askcontext(optional): Additional context about what you're working on
Example:
Claude uses ask_yes_no_telegram with question: "Should I proceed with the refactoring?"
Ask a multiple choice question with 2-4 clickable buttons.
Parameters:
question(required): The question to askoptions(required): Array of 2-4 optionscontext(optional): Additional context about what you're working on
Example:
Claude uses ask_choice_telegram with question: "Which database should we use?" options: ["PostgreSQL", "MySQL", "SQLite"]
Instead of a config file, you can use environment variables:
{
"mcpServers": {
"telegram-notifications": {
"command": "node",
"args": ["/path/to/telegram-mcp-server/index.js"],
"env": {
"TELEGRAM_BOT_TOKEN": "your-bot-token",
"TELEGRAM_CHAT_ID": "your-chat-id"
}
}
}
}- Open Telegram and search for @BotFather
- Send
/newbot - Follow the prompts to name your bot
- Copy the API token provided
- Open Telegram and search for @userinfobot
- Send
/start - The bot will reply with your user ID - this is your chat ID
Before Claude can send you messages, you must start a conversation with your bot:
- Search for your bot by username in Telegram
- Send
/startor any message to the bot
MIT