FlowTruxFlowTrux/Docs

Telegram MCP Server

Send messages, documents and formatted reports through a Telegram bot from workflows

The Telegram MCP server lets your workflows send text messages, documents and formatted reports through a Telegram bot. It provides 4 tools.

Setup

1. Create a Bot

  1. Open Telegram and search for @BotFather.
  2. Send /newbot and follow the prompts to name your bot.
  3. BotFather replies with a bot token (looks like 123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11).
  4. Copy this token.

2. Add the Bot to Your Chat

The bot must already be a member of the chat it writes to - bots cannot add themselves. Add it to the group or channel once through the chat's invite flow, or start a direct chat with it.

3. Find the Chat ID (optional)

You only need a chat ID if you want a default recipient; every tool also takes its own chat_id.

  1. Send any message to your bot (or in the group where it is a member).
  2. Open this URL in a browser, replacing YOUR_BOT_TOKEN with the token:
    https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
    
  3. Look for "chat":{"id": in the JSON response. That number is the chat ID.

Group and supergroup IDs are negative (-1001234567890); direct chats are positive. You can also run the get_updates tool once the server is added.

4. Add to FlowTrux

  1. Go to Resources > MCP Servers > Add Server (OWNER or ADMIN).
  2. Choose Telegram Bot.
  3. Give the configuration a Name and paste the Bot Token.
  4. Optionally enter a Default Chat ID - tools send there when a call does not pass chat_id.
  5. Under Available in workspaces, pick the workspaces that may use it, then click Add Server.

Tools

send_message

Send a text message to a Telegram chat.

ParameterTypeRequiredDescription
chat_idstringNoTelegram chat ID. Defaults to the server's Default Chat ID.
textstringYesMessage text (supports Markdown or HTML)
parse_modestringNoText parsing mode. One of: Markdown, MarkdownV2, HTML. Default: "HTML".
disable_notificationbooleanNoSend silently without notification. Default: false.

send_document

Send a document or file to a Telegram chat. Pass exactly one source: s3_key, file_base64 + filename, or document_url (see Sending files below). Maximum 50 MB.

ParameterTypeRequiredDescription
chat_idstringNoTelegram chat ID. Defaults to the server's Default Chat ID.
s3_keystringNoStorage key of a file in FlowTrux (the key returned by the files or pdf tools). Uploaded to Telegram as bytes.
file_base64stringNoBase64-encoded file content, uploaded as bytes. Requires filename. A data:…;base64,… prefix is accepted and stripped.
document_urlstringNoPublic URL of the document. Telegram fetches it from its own servers, so it must be reachable from the public internet.
captionstringNoShort text shown with the file, up to 1024 characters.
parse_modestringNoFormatting for caption. Leave it empty for plain text - with a mode set, Telegram rejects the whole send on stray markup characters. One of: Markdown, MarkdownV2, HTML.
filenamestringNoFile name shown in Telegram. Required with file_base64; defaults to the key's file name for s3_key; ignored for document_url.

send_formatted_report

Send a formatted report with metrics (pre-styled for analytics)

ParameterTypeRequiredDescription
chat_idstringNoTelegram chat ID. Defaults to the server's Default Chat ID.
titlestringYesReport title.
metricsobjectYesKey-value pairs of metrics to display.
summarystringNoOptional summary text.

get_updates

Get recent messages/updates (useful for testing bot connection)

ParameterTypeRequiredDescription
limitnumberNoMaximum number of updates to retrieve. Default: 10.

Limits to know

  • A text message is limited to about 4096 characters; send_formatted_report splits a long summary into several messages for you. If one part is refused, the tool says how many parts were sent.
  • A document caption is limited to 1024 characters. A longer caption is refused rather than cut - send long text with send_message.
  • A document can be up to 50 MB.
  • MarkdownV2 requires escaping many characters (_*[]()~`>#+-=|{}.!). Plain text or HTML avoids that.

Sending files

send_document takes exactly one source:

  • s3_key - the key returned by the Files or PDF Generator tools. Use this for anything your workflow created or stored in FlowTrux.
  • file_base64 + filename - bytes you already hold, for example from an HTTP request.
  • document_url - only for a file that is publicly reachable on the internet. Telegram downloads it from its own servers, so a private or temporary FlowTrux download link fails with "wrong HTTP URL specified".

Example Workflow

A monitoring alert:

  1. Trigger - Schedule (every 30 minutes).
  2. Action - HTTP request to a service health endpoint that answers JSON such as {"status": "ok"}.
  3. Logic - If-else: {{steps.health.output.data.status}} !== "ok".
  4. Action - MCP tool telegram:send_message with text "Service is down: {{steps.health.output.data.status}}".