Skip to main content

Telegram Bot API integration via MCP

Project description


title: telegram-mcp emoji: 🤖 colorFrom: blue colorTo: purple sdk: docker pinned: false

telegram-mcp

MCP server that exposes the Telegram Bot API as tools for Claude Code (or any MCP client).

Features

  • 20 tools covering messages, chat management, files/photos, and bot info
  • Auto-discovery: add a file to tools/ and your tool is registered automatically
  • Runs over stdio (local) or SSE (remote / Docker)

Requirements

  • Python >= 3.12
  • uv
  • Telegram Bot Token (create via @BotFather)

Installation

Get your bot token from @BotFather on Telegram first.

Option 1: From PyPI (recommended)

claude mcp add telegram-mcp \
  -e TELEGRAM_BOT_TOKEN=your-bot-token-here \
  -- uvx telegram-mcp-server
Manual MCP config
{
  "mcpServers": {
    "telegram-mcp": {
      "command": "uvx",
      "args": ["telegram-mcp-server"],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your-bot-token-here"
      }
    }
  }
}

Option 2: From GitHub

claude mcp add telegram-mcp \
  -e TELEGRAM_BOT_TOKEN=your-bot-token-here \
  -- uvx --from "git+https://github.com/QuocTang/telegram-bot.git#subdirectory=telegram-mcp" telegram-mcp
Manual MCP config
{
  "mcpServers": {
    "telegram-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/QuocTang/telegram-bot.git#subdirectory=telegram-mcp",
        "telegram-mcp"
      ],
      "env": {
        "TELEGRAM_BOT_TOKEN": "your-bot-token-here"
      }
    }
  }
}

Option 3: From source

git clone https://github.com/QuocTang/telegram-bot.git
cd telegram-bot/telegram-mcp
cp .env.example .env   # add your TELEGRAM_BOT_TOKEN
uv sync
claude mcp add telegram-mcp \
  -- uv run --directory /absolute/path/to/telegram-mcp telegram-mcp
Manual MCP config
{
  "mcpServers": {
    "telegram-mcp": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/telegram-mcp",
        "telegram-mcp"
      ]
    }
  }
}

With this option, TELEGRAM_BOT_TOKEN is read from the .env file inside the project directory.

Option 4: Remote SSE (Hugging Face Spaces)

Deploy your own instance on HF Spaces — no local installation required.

  1. Duplicate the Space
  2. In your Space, go to Settings > Variables and add TELEGRAM_BOT_TOKEN
  3. Connect to your Space:
claude mcp add telegram-mcp --transport sse \
  https://your-username-telegram-mcp.hf.space/sse
Manual MCP config
{
  "mcpServers": {
    "telegram-mcp": {
      "type": "sse",
      "url": "https://your-username-telegram-mcp.hf.space/sse"
    }
  }
}

Run /mcp inside Claude Code to verify the server is connected.

Tools

Messages

Tool Description
send_message Send a text message (Markdown/HTML)
edit_message Edit an existing message
delete_message Delete a message
forward_message Forward a message between chats

Updates

Tool Description
get_updates Fetch recent messages/updates the bot received

Chat management

Tool Description
get_chat_info Get chat metadata (name, type, description)
get_chat_member_count Count members
get_chat_admins List administrators
ban_member Ban a user
unban_member Unban a user
set_chat_title Change group/channel title
set_chat_description Change group/channel description
pin_message Pin a message
unpin_message Unpin a message

Files & photos

Tool Description
send_photo Send a photo by URL or file_id
send_photo_file Send a local photo file
send_document Send a document by URL or file_id
send_document_file Send a local file as document
get_file_info Get file metadata + download link

Bot

Tool Description
get_bot_info Get bot name, username, etc.

Environment variables

Variable Required Description
TELEGRAM_BOT_TOKEN Yes Token from BotFather
MCP_TRANSPORT No stdio (default) or sse
MCP_HOST No Bind host (default 127.0.0.1)
MCP_PORT No Bind port (default 8000)
HTTP_TIMEOUT No Telegram API timeout in seconds (default 30)

Development

uv sync                        # install all deps (including dev)
uv run pytest -v               # run tests
uv run ruff check src/ tests/  # lint

See CONTRIBUTING.md for how to add new tools.

License

MIT

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

telegram_mcp_kit-0.1.0.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

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

telegram_mcp_kit-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file telegram_mcp_kit-0.1.0.tar.gz.

File metadata

  • Download URL: telegram_mcp_kit-0.1.0.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for telegram_mcp_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 caaf172143ee60bcf031bf20b3d93b6bd83683b497eca999e64977d41f32ec75
MD5 e36b9462aeb41c809533a13b711778be
BLAKE2b-256 c4405650d355eaef90a5964f8dfe8bf1960a1edcc2de7e20a14c15451971a9f9

See more details on using hashes here.

File details

Details for the file telegram_mcp_kit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: telegram_mcp_kit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for telegram_mcp_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b2103c39869b80bd2b249fe77492a93a8d68abbf8194d3952a110f0e233c649
MD5 dcd8ddd94fbde391760a56dfe8de463a
BLAKE2b-256 3d1b987fe23ec7f82947a76ff38b81a7536a68dcd515fd1b10bbf7e19aa03ba7

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