Better Telegram MCP
Provides comprehensive access to Telegram via both the Bot API and MTProto (user accounts). Enables managing messages, chats, media, and contacts, including capabilities like searching message history, managing group memberships, and interacting with the Telegram network as either a bot or a full user account.
Better Telegram MCP
mcp-name: io.github.n24q02m/better-telegram-mcp
MCP server for Telegram with dual-mode support: Bot API (httpx) for quick bot integrations and MTProto (Telethon) for full user-account access.
Features
Dual mode -- Bot API (httpx) for bots, MTProto (Telethon) for user accounts
6 tools with action dispatch:
message,chat,media,contact,config,helpAuto-detect mode -- Set bot token for bot mode, or API credentials for user mode
Web-based OTP auth -- Browser-based authentication with remote relay support for headless environments
Tool annotations -- Each tool declares
readOnlyHint,destructiveHint,idempotentHint,openWorldHintMCP Resources -- Documentation available as
telegram://docs/*resourcesSecurity hardened -- SSRF protection, path traversal prevention, error sanitization
Setup
With AI Agent -- copy and send this to your AI agent:
Please set up better-telegram-mcp for me. Follow this guide: https://raw.githubusercontent.com/n24q02m/better-telegram-mcp/main/docs/setup-with-agent.md
Manual Setup -- follow docs/setup-manual.md
Tools
Tool | Actions | Description |
|
| Send, edit, delete, forward messages. Pin, react, search, browse history |
|
| List and manage chats, groups, channels. Members, admin, forum topics |
|
| Send photos, files, voice notes, videos. Download media from messages |
|
| List, search, add contacts. Block/unblock users (user mode only) |
|
| Server status, runtime settings, cache, credential setup (relay, status, reset, complete) |
| -- | Full documentation for any topic |
MCP Resources
URI | Content |
| Message operations reference |
| Chat management reference |
| Media send/download reference |
| Contact management reference |
| All documentation combined |
Security
SSRF Protection -- All URLs validated against internal/private IP ranges, DNS rebinding blocked
Path Traversal Prevention -- File paths validated, sensitive directories blocked
Session File Security -- 600 permissions, 2FA via web UI only (never stored in env vars)
Error Sanitization -- Credentials never leaked in error messages
Build from Source
git clone https://github.com/n24q02m/better-telegram-mcp.git
cd better-telegram-mcp
uv sync
uv run better-telegram-mcpLicense
MIT -- See LICENSE.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/n24q02m/better-telegram-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server