trackmcp
Back to directory
AdeshAtole

telegram-notifier-mcp

View on GitHub

MCP server for sending notifications via Telegram Bot API

0 stars JavaScriptOthers Updated Feb 14, 2026

Documentation

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.

Quick Start

No cloning or building required — just add the config to your MCP client.

1. Create a Telegram Bot

1. Open Telegram and message @BotFather

2. Send `/newbot` and follow the prompts to name your bot

3. Copy the bot token you receive (e.g., `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11`)

2. Find Your Chat ID

1. Send any message to your new bot on Telegram

2. Open the following URL in your browser, replacing `YOUR_BOT_TOKEN` with your actual token:

code
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates

3. In the JSON response, find `"chat":{"id": 123456789}` — that number is your chat ID

> Tip: For group chats, add the bot to the group, send a message, and check the same URL. Group chat IDs are negative numbers (e.g., `-1001234567890`).

3. Add to Your MCP Client

Claude Desktop

Add this to your Claude Desktop config file:

  • macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
  • Windows: `%APPDATA%\Claude\claude_desktop_config.json`
json
{
  "mcpServers": {
    "telegram-notifier": {
      "command": "npx",
      "args": ["telegram-notifier-mcp"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your-bot-token-here",
        "TELEGRAM_CHAT_ID": "your-chat-id-here"
      }
    }
  }
}

Claude Code

Add to your project's `.mcp.json` or `~/.claude.json`:

json
{
  "mcpServers": {
    "telegram-notifier": {
      "command": "npx",
      "args": ["telegram-notifier-mcp"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your-bot-token-here",
        "TELEGRAM_CHAT_ID": "your-chat-id-here"
      }
    }
  }
}

Codex CLI

You can configure Codex CLI in either of these ways:

Option A: Add it manually in `~/.codex/config.toml`

toml
[mcp_servers.telegram-notifier]
command = "npx"
args = ["telegram-notifier-mcp"]

[mcp_servers.telegram-notifier.env]
TELEGRAM_BOT_TOKEN = "your-bot-token-here"
TELEGRAM_CHAT_ID = "your-chat-id-here"

Option B: Add it with a CLI command

bash
codex mcp add telegram-notifier \
  --env TELEGRAM_BOT_TOKEN=your-bot-token-here \
  --env TELEGRAM_CHAT_ID=your-chat-id-here \
  -- npx telegram-notifier-mcp

That's it — your LLM can now send you Telegram notifications.

Configuration

The server uses two environment variables:

VariableRequiredDescription
`TELEGRAM_BOT_TOKEN`YesBot token from @BotFather
`TELEGRAM_CHAT_ID`NoDefault chat ID. Can be overridden per-tool call via the `chatId` parameter.

The server will exit with an error if `TELEGRAM_BOT_TOKEN` is not set. If `TELEGRAM_CHAT_ID` is not set, you must pass `chatId` to every tool call.

Tools

`send_message`

Send a text message to a Telegram chat.

ParameterTypeRequiredDescription
`text`stringYesThe message text to send
`chatId`stringNoTarget chat ID (overrides `TELEGRAM_CHAT_ID`)
`parseMode`stringNo`Markdown`, `MarkdownV2`, or `HTML`
`disableNotification`booleanNoSend silently without notification sound

`send_document`

Send a file/document to a Telegram chat.

ParameterTypeRequiredDescription
`filePath`stringYesAbsolute path to the file
`chatId`stringNoTarget chat ID (overrides `TELEGRAM_CHAT_ID`)
`caption`stringNoCaption for the document
`parseMode`stringNo`Markdown`, `MarkdownV2`, or `HTML`
`disableNotification`booleanNoSend silently without notification sound

`send_photo`

Send a photo/image to a Telegram chat.

ParameterTypeRequiredDescription
`filePath`stringYesAbsolute path to the image file
`chatId`stringNoTarget chat ID (overrides `TELEGRAM_CHAT_ID`)
`caption`stringNoCaption for the photo
`parseMode`stringNo`Markdown`, `MarkdownV2`, or `HTML`
`disableNotification`booleanNoSend silently without notification sound

`send_video`

Send a video to a Telegram chat.

ParameterTypeRequiredDescription
`filePath`stringYesAbsolute path to the video file
`chatId`stringNoTarget chat ID (overrides `TELEGRAM_CHAT_ID`)
`caption`stringNoCaption for the video
`parseMode`stringNo`Markdown`, `MarkdownV2`, or `HTML`
`disableNotification`booleanNoSend silently without notification sound

`send_audio`

Send an audio file to a Telegram chat.

ParameterTypeRequiredDescription
`filePath`stringYesAbsolute path to the audio file
`chatId`stringNoTarget chat ID (overrides `TELEGRAM_CHAT_ID`)
`caption`stringNoCaption for the audio
`parseMode`stringNo`Markdown`, `MarkdownV2`, or `HTML`
`disableNotification`booleanNoSend silently without notification sound

`get_updates`

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

ParameterTypeRequiredDescription
`limit`numberNoMax messages to retrieve (1-100, default 10)
`timeout`numberNoLong-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 `-` 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:

bash
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_TOKEN`Server 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

bash
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

License

MIT

Frequently asked questions

What is telegram-notifier-mcp?

telegram-notifier-mcp is MCP server for sending notifications via Telegram Bot API

How do I install telegram-notifier-mcp?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is telegram-notifier-mcp open source?

Yes — it is hosted on GitHub at https://github.com/AdeshAtole/telegram-notifier-mcp.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP