Newcontext-mode—Save 98% of your AI coding agent's context windowLearn more
MCP Directory
ServersClientsBlog

context-mode

Save 98% of your AI coding agent's context window. Works with Claude Code, Cursor, Copilot, Codex, and more.

Try context-mode
MCP Directory

Model Context Protocol Directory

MKSF LTD
Suite 8805 5 Brayford Square
London, E1 0SG

MCP Directory

  • About
  • Blog
  • Documentation
  • Contact

Menu

  • Servers
  • Clients

© 2026 model-context-protocol.com

The Model Context Protocol (MCP) is an open standard for AI model communication.
Powered by Mert KoseogluSoftware Forge
  1. Home
  2. Servers
  3. better-telegram-mcp

better-telegram-mcp

GitHub
Website

MCP server for Telegram (Bot API + MTProto) - composite tools optimized for AI agents

5
2

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.

<!-- Badge Row 1: Status -->

CI
codecov
PyPI
Docker
License: MIT

<!-- Badge Row 2: Tech -->

Python
Telegram
MCP
semantic-release
Renovate

<a href="https://glama.ai/mcp/servers/n24q02m/better-telegram-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/n24q02m/better-telegram-mcp/badge" alt="better-telegram-mcp MCP server" /> </a>

Features

  • Dual mode -- Bot API (httpx) for bots, MTProto (Telethon) for user accounts
  • 6 tools with action dispatch: message, chat, media, contact, config, help
  • Auto-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, openWorldHint
  • MCP Resources -- Documentation available as telegram://docs/* resources
  • Security hardened -- SSRF protection, path traversal prevention, error sanitization

Tools

ToolActionsDescription
messagesend, edit, delete, forward, pin, react, search, historySend, edit, delete, forward messages. Pin, react, search, browse history
chatlist, info, create, join, leave, members, admin, settings, topicsList and manage chats, groups, channels. Members, admin, forum topics
mediasend_photo, send_file, send_voice, send_video, downloadSend photos, files, voice notes, videos. Download media from messages
contactlist, search, add, blockList, search, add contacts. Block/unblock users (user mode only)
configstatus, set, cache_clear, setup_status, setup_start, setup_reset, setup_completeServer status, runtime settings, cache, credential setup (relay, status, reset, complete)
help--Full documentation for any topic

MCP Resources

URIContent
telegram://docs/messagesMessage operations reference
telegram://docs/chatsChat management reference
telegram://docs/mediaMedia send/download reference
telegram://docs/contactsContact management reference
telegram://statsAll 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-mcp

License

MIT -- See LICENSE.

Repository

N2
n24q02m

n24q02m/better-telegram-mcp

Created

March 14, 2026

Updated

April 13, 2026

Language

Python

Category

AI