Labsco
AdeshAtole logo

Telegram Notifier (Botfather)

from AdeshAtole

Use botfather bot to notify yourself on Telegram.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Telegram Notifier MCP Server

An MCP server that lets an LLM send messages and files to a user via a Telegram bot, and read incoming messages. No external HTTP or Telegram libraries โ€” just the native fetch API and the official MCP SDK.

Tools

send_message

Send a text message to a Telegram chat.

ParameterTypeRequiredDescription
textstringYesThe message text to send
chatIdstringNoTarget chat ID (overrides TELEGRAM_CHAT_ID)
parseModestringNoMarkdown, MarkdownV2, or HTML
disableNotificationbooleanNoSend silently without notification sound

send_document

Send a file/document to a Telegram chat.

ParameterTypeRequiredDescription
filePathstringYesAbsolute path to the file
chatIdstringNoTarget chat ID (overrides TELEGRAM_CHAT_ID)
captionstringNoCaption for the document
parseModestringNoMarkdown, MarkdownV2, or HTML
disableNotificationbooleanNoSend silently without notification sound

send_photo

Send a photo/image to a Telegram chat.

ParameterTypeRequiredDescription
filePathstringYesAbsolute path to the image file
chatIdstringNoTarget chat ID (overrides TELEGRAM_CHAT_ID)
captionstringNoCaption for the photo
parseModestringNoMarkdown, MarkdownV2, or HTML
disableNotificationbooleanNoSend silently without notification sound

send_video

Send a video to a Telegram chat.

ParameterTypeRequiredDescription
filePathstringYesAbsolute path to the video file
chatIdstringNoTarget chat ID (overrides TELEGRAM_CHAT_ID)
captionstringNoCaption for the video
parseModestringNoMarkdown, MarkdownV2, or HTML
disableNotificationbooleanNoSend silently without notification sound

send_audio

Send an audio file to a Telegram chat.

ParameterTypeRequiredDescription
filePathstringYesAbsolute path to the audio file
chatIdstringNoTarget chat ID (overrides TELEGRAM_CHAT_ID)
captionstringNoCaption for the audio
parseModestringNoMarkdown, MarkdownV2, or HTML
disableNotificationbooleanNoSend silently without notification sound

get_updates

Check for new messages sent to the bot. Only returns messages received since the last check.

ParameterTypeRequiredDescription
limitnumberNoMax messages to retrieve (1-100, default 10)
timeoutnumberNoLong-polling timeout in seconds (0-30, default 0). Set >0 to wait for new messages.

File Downloads

When a message contains media (photo, document, video, audio, voice message, or sticker), the server automatically downloads the file to ~/.telegram-notifier-mcp/downloads/ and includes the local path in the output. This lets the LLM read or process the file directly.

  • Files are saved as <timestamp>-<original_filename> to avoid collisions
  • Photos are downloaded at the highest available resolution
  • Telegram Bot API limits downloads to 20 MB
  • If a download fails, the output falls back to just labeling the media type

Testing with the MCP Inspector

You can test the server interactively using the MCP Inspector:

TELEGRAM_BOT_TOKEN="your-token" TELEGRAM_CHAT_ID="your-chat-id" \
  npx @modelcontextprotocol/inspector npx telegram-notifier-mcp

This opens a browser UI where you can invoke each tool and see the results.

Error Handling

The server handles errors gracefully and returns descriptive messages:

ScenarioBehavior
Missing TELEGRAM_BOT_TOKENServer exits at startup with instructions
Missing chat ID (no env var, no parameter)Returns isError: true with message
File not foundReturns isError: true with the file path
File exceeds 50 MBReturns isError: true with file size
Telegram API errorReturns isError: true with Telegram's error description

All server logs go to stderr so they never interfere with the stdio MCP transport on stdout.

File Size Limits

Telegram enforces a 50 MB limit for file uploads via the Bot API. The server validates file size before uploading and returns an error if the limit is exceeded.

Development

git clone https://github.com/AdeshAtole/telegram-notifier-mcp
cd telegram-notifier-mcp
npm install
npm run build

# Watch mode โ€” rebuilds on file changes
npm run dev

Publishing

Releases are published to npm automatically via GitHub Actions when you create a GitHub release.

Setup:

  1. Add your npm token as a repository secret named NPM_TOKEN in GitHub Settings > Secrets and variables > Actions
  2. Bump the version in package.json
  3. Create a new GitHub release โ€” the workflow will build and publish to npm