MCP Telegram MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "TELEGRAM_API_ID=${TELEGRAM_API_ID}" -e "TELEGRAM_API_HASH=${TELEGRAM_API_HASH}" mcp-telegram -- npx -y @overpod/mcp-telegram
Required:TELEGRAM_API_IDTELEGRAM_API_HASH+ 1 optional
README.md

Connect AI assistants like Claude to Telegram via the MTProto protocol

MCP Telegram

Hosted version available! Don't want to self-host? Use mcp-telegram.com -- connect Telegram to Claude.ai or ChatGPT in 30 seconds with QR code. No API keys needed.

An MCP (Model Context Protocol) server that connects AI assistants like Claude to Telegram via the MTProto protocol. Unlike bots, this runs as a userbot -- it operates under your personal Telegram account using GramJS, giving full access to your chats, contacts, and message history.

Features

  • MTProto protocol -- direct Telegram API access, not the limited Bot API
  • Userbot -- operates as your personal account, not a bot
  • Full-featured -- messaging, reactions, polls, scheduled messages, media, contacts, and more
  • Forum Topics -- list topics, read per-topic messages, send to specific topics, per-topic unread counts
  • QR code login -- authenticate by scanning a QR code in the Telegram app
  • Session persistence -- login once, stay connected across restarts
  • Human-readable output -- sender names are resolved, not just numeric IDs
  • Works with any MCP client -- Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code, Mastra, etc.

Prerequisites

  • Node.js 18 or later
  • Telegram API credentials -- API_ID and API_HASH from my.telegram.org

Quick Start

1. Get Telegram API credentials

  1. Go to my.telegram.org and log in with your phone number.
  2. Navigate to API development tools.
  3. Create a new application (any name and platform).
  4. Copy the App api_id and App api_hash.

2. Login

TELEGRAM_API_ID=YOUR_ID TELEGRAM_API_HASH=YOUR_HASH npx @overpod/mcp-telegram login

A QR code will appear in the terminal. Open Telegram on your phone, go to Settings > Devices > Link Desktop Device, and scan the code. The session is saved to ~/.mcp-telegram/session and reused automatically.

Custom session path: set TELEGRAM_SESSION_PATH=/path/to/session to store the session file elsewhere.

3. Add to Claude

claude mcp add telegram -s user \
  -e TELEGRAM_API_ID=YOUR_ID \
  -e TELEGRAM_API_HASH=YOUR_HASH \
  -- npx @overpod/mcp-telegram

That's it! Ask Claude to run telegram-status to verify.

Multiple Accounts

Use TELEGRAM_SESSION_PATH to run separate Telegram accounts side by side:

# Login each account with a unique session path
TELEGRAM_API_ID=ID1 TELEGRAM_API_HASH=HASH1 TELEGRAM_SESSION_PATH=~/.mcp-telegram/session-work npx @overpod/mcp-telegram login
TELEGRAM_API_ID=ID2 TELEGRAM_API_HASH=HASH2 TELEGRAM_SESSION_PATH=~/.mcp-telegram/session-personal npx @overpod/mcp-telegram login

Then add each as a separate MCP server:

claude mcp add telegram-work -s user \
  -e TELEGRAM_API_ID=ID1 \
  -e TELEGRAM_API_HASH=HASH1 \
  -e TELEGRAM_SESSION_PATH=~/.mcp-telegram/session-work \
  -- npx @overpod/mcp-telegram

claude mcp add telegram-personal -s user \
  -e TELEGRAM_API_ID=ID2 \
  -e TELEGRAM_API_HASH=HASH2 \
  -e TELEGRAM_SESSION_PATH=~/.mcp-telegram/session-personal \
  -- npx @overpod/mcp-telegram

Each account gets its own session file — no conflicts.

Installation Options

npx (recommended, zero install)

No need to clone or install anything. Just use npx @overpod/mcp-telegram.

Global install

npm install -g @overpod/mcp-telegram
mcp-telegram          # run server
mcp-telegram login    # QR login

From source

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

Usage with MCP Clients

Claude Code (CLI)

claude mcp add telegram -s user \
  -e TELEGRAM_API_ID=YOUR_ID \
  -e TELEGRAM_API_HASH=YOUR_HASH \
  -- npx @overpod/mcp-telegram

Claude Desktop

  1. Open your config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the

Tools (1)

telegram-statusVerify the connection status of the Telegram MCP server.

Environment Variables

TELEGRAM_API_IDrequiredApp api_id from my.telegram.org
TELEGRAM_API_HASHrequiredApp api_hash from my.telegram.org
TELEGRAM_SESSION_PATHCustom path to store the session file

Configuration

claude_desktop_config.json
{"mcpServers": {"telegram": {"command": "npx", "args": ["-y", "@overpod/mcp-telegram"], "env": {"TELEGRAM_API_ID": "YOUR_ID", "TELEGRAM_API_HASH": "YOUR_HASH"}}}}

Try it

Check my current Telegram connection status.
List my recent Telegram chats and summarize the latest messages.
Send a message to my 'Work' Telegram group.
Read the unread messages from my specific forum topics.

Frequently Asked Questions

What are the key features of MCP Telegram?

Direct MTProto protocol access for full Telegram functionality. Operates as a userbot under your personal account. Supports forum topics, reactions, polls, and scheduled messages. QR code authentication with session persistence. Human-readable output with resolved sender names.

What can I use MCP Telegram for?

Summarizing long Telegram chat histories using Claude. Automating responses to messages in personal Telegram groups. Managing multiple Telegram accounts side-by-side via separate session paths. Interacting with Telegram forum topics directly from the Claude interface.

How do I install MCP Telegram?

Install MCP Telegram by running: npx @overpod/mcp-telegram

What MCP clients work with MCP Telegram?

MCP Telegram works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Telegram docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare