🚀 Model Context Protocol · Telegram MTProto

Full Telegram Access
for AI Agents

The Bot API can't read history. MTProto can. Give your AI agent complete access to your Telegram workspace — read any message, send to any topic, manage any group.

Get Started → Explore Tools
Bun TypeScript MCP GramJS MIT
7
MCP Tools
2
Transport Modes
5
Deploy Targets
bash — MTProto setup
# Clone and install
$ git clone https://github.com/sandikodev/telegram-mcp.git && cd telegram-mcp
$ bun install

# One-time authentication (saves session to ~/.config/telegram-mcp/session.txt)
$ bun run auth
API ID: ••••••••  |  API Hash: ••••••••••••••••
Phone: +62••••••••••  |  OTP: ••••••
✅ Session saved.

# mcp.json — full access: history, dialogs, topics, search
{
  "mcpServers": { "telegram": {
    "command": "bun", "args": ["run", "/path/to/telegram-mcp/src/index.ts"],
    "env": { "TELEGRAM_API_ID": "...", "TELEGRAM_API_HASH": "..." }
  }}
}

7 Powerful Tools

Everything your AI agent needs to work with Telegram — all inputs validated with Zod, 15s timeout on every call

📜
telegram_get_messages

Read Message History

Fetch up to 100 messages from any chat or forum topic. Includes sender, timestamp, and media info.

✉️
telegram_send_message

Send Messages

Send Markdown or HTML formatted messages to any chat or specific forum topic thread. Max 4096 chars.

📎
telegram_send_document

Send Files

Upload and send any file — PDFs, CSVs, images, logs — with an optional caption.

💬
telegram_get_dialogs

List All Chats

Get all your chats, groups, and channels with names, IDs, and unread counts.

🏷️
telegram_get_topics

List Forum Topics

Get all topics in a supergroup forum — perfect for organized team workspaces.

🔍
telegram_search_messages

Search Messages

Search messages by keyword within any chat. Returns up to 100 matching results with full context.

ℹ️
telegram_get_chat_info

Get Chat Info

Fetch metadata of any chat, group, or channel — title, username, type, member count, description.

Works with Any MCP Client

stdio transport (local/Docker) or HTTP transport (Cloudflare Workers)

Kiro CLI
Native MCP support
🤖
Claude Desktop
Anthropic
🔧
Cursor
AI code editor
🌊
Windsurf
Codeium
🐳
Docker
containerized stdio
☁️
CF Workers
HTTP transport

Why telegram-mcp?

Built for production. Simple by default, powerful when needed.

📜

Full History

Bot API only gets new messages. MTProto reads any message from any time.

👤

User Context

Acts as your account — access private groups, DMs, and channels you're in.

🏷️

Forum Topics

Read and write to specific topics in supergroups — Bot API support is limited.

Bun Native

~10ms startup. TypeScript first, no build step, no transpilation.

🛡️

Zod Validated

All tool inputs validated at runtime — no silent failures, clear error messages.

⏱️

Timeout Safe

Every API call has a 15s timeout — server never hangs, always responds.

🌍

Deploy Anywhere

Local, Docker, npx, or Cloudflare Workers — one codebase, five deployment targets.

🔒

Secrets Safe

Session stored locally or via env var — never hardcoded, never committed.

Ready to give your AI agent Telegram superpowers?

Open source, MIT licensed, contributions welcome.

★ Star on GitHub Contribute