Skip to main content

Telegram MCP Server — lets AI agents send/receive Telegram messages via a Bot Token

Project description

agent-telegram-mcp

A robust Model Context Protocol (MCP) server that enables AI agents to seamlessly interact with Telegram using a standard Bot Token. It provides a comprehensive suite of tools for bidirectional communication, including sending and receiving text messages, multimedia, documents, and managing chats.

Installation

Install using pip or uv:

pip install agent-telegram-mcp

or

uv tool install agent-telegram-mcp

Configuration

This MCP server requires a Telegram Bot Token. You can create a new bot and obtain your token by talking to the BotFather on Telegram.

To use this server with MCP-compatible clients (like Claude Desktop, Agent_head, etc.), add it to your server configuration and pass the token as an environment variable:

Example mcp_config.json

{
  "mcpServers": {
    "agent-telegram-mcp": {
      "command": "agent-telegram-mcp",
      "env": {
        "TELEGRAM_BOT_TOKEN": "123456789:ABCdefGHIjklMNOpqrSTUvwxYZ"
      }
    }
  }
}

Available Tools

The server exposes the following tools to the LLM agent:

✉️ Messaging

  • telegram_send_message: Send text messages (supports Markdown, HTML, silent messages, and replies).
  • telegram_forward_message: Forward existing messages between chats.
  • telegram_delete_message: Delete a message from a chat (requires bot admin permissions).
  • telegram_pin_message: Pin a message in a group/channel.

🖼️ Media & Files

  • telegram_send_photo: Send images via a local file path, public HTTP URL, or Telegram file ID.
  • telegram_send_video: Send video files.
  • telegram_send_audio: Send audio tracks (renders as a Telegram music player).
  • telegram_send_voice: Send voice notes (.ogg files).
  • telegram_send_document: Send arbitrary files (PDFs, ZIPs, code snippets, etc.).
  • telegram_send_sticker: Send .webp stickers.
  • telegram_send_location: Send a geographic map pin via latitude and longitude.

📥 Retrieval & Info

  • telegram_get_updates: Retrieve recent messages, commands, and callback queries sent to the bot (supports pagination with offset and limit).
  • telegram_get_chat_info: Fetch detailed information about a user, group, or channel.
  • telegram_get_chat_member_count: Check how many users are in a chat.
  • telegram_get_file_info: Retrieve metadata and the download path for a file hosted on Telegram servers.
  • telegram_download_file: Download a file to a specific local path or return its contents as a Base64 string.
  • telegram_get_bot_info: Fetch the current bot's profile information to verify the token connection.

Development & Testing

You can run the server directly via standard I/O (stdio) transport:

export TELEGRAM_BOT_TOKEN="your-token"
# On Windows: set TELEGRAM_BOT_TOKEN=your-token

agent-telegram-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_telegram_mcp-0.1.1.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_telegram_mcp-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file agent_telegram_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: agent_telegram_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_telegram_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9734f111c571430a9209584200617c23a16a1c5ef9b558362142d44afe0ebe67
MD5 8c42f42a97d77ce2260a15f16e385ca9
BLAKE2b-256 f2c378116a49198759c88621e13d4d15d474617dffa7322432293c409670d1c1

See more details on using hashes here.

File details

Details for the file agent_telegram_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agent_telegram_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_telegram_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3a33c37ce61579eddd35372477e09381fcf6ab375090b20d10b5f0ff9825fab
MD5 4b1eb727eb951118643d184b59fea64f
BLAKE2b-256 1ebdbf517e3ea3200403a6638e73d76d1748f709702296280d74ec92fbe898bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page