telegram-mcp
Provides tools to fetch the latest image from a specified Telegram group and to wait for new images posted to that group, returning the image along with metadata such as message id, timestamp, sender, and caption.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@telegram-mcpwhat's the most recent image in the group?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
telegram-mcp
Hands Claude the newest image from one Telegram group.
The screenshots are posted by a bot, and the Telegram Bot API never returns a bot's own messages — so this reads the group with a user account over MTProto (Telethon). That is the only way to see those photos.
Setup (once)
Get an api id and hash from https://my.telegram.org → API development tools.
cp .env.example .envand fill inTELEGRAM_API_ID,TELEGRAM_API_HASH, andTELEGRAM_CHAT_ID(the group's numeric id, negative).Create the environment:
python -m venv .venv .venv\Scripts\pip install -e .[dev]Sign in — in a terminal, not through Claude:
.venv\Scripts\telegram-mcp-loginIt asks for your phone number, the code Telegram sends, and your two-factor password if you have one, then writes
session/telegram.session.It also lists your dialogs once and prints the group's name back at you. The listing is what lets the session resolve a supergroup later -- Telegram turns a group into one as soon as a bot joins it -- and the name is your confirmation that
TELEGRAM_CHAT_IDpoints where you think it does. If it cannot find the group, it says so and exits non-zero.
Related MCP server: telegram-user-mcp
Install into Claude
claude mcp add --scope user telegram -- <abs path>\.venv\Scripts\python -m telegram_mcp.serverUser scope, so every project gets it.
Tools
get_latest_image()— the most recent photo in the group, looking back 200 messages.wait_for_next_image(timeout_seconds=120)— blocks until a photo newer than the moment of the call arrives. Waiting costs no tokens; the process idles on a socket. Clamped to 1–240 s to stay inside the MCP client's tool timeout.
Both return the image (JPEG, long edge ≤1568 px) plus a line of text: the path to the untouched original first, then the message id, timestamp, sender, and the caption, quoted. Crop that original when the downscale loses fine print.
Only one process can hold the session at a time. A second Claude Code session calling a tool while the first is mid-call is told to try again in a moment, rather than being handed a SQLite error.
Tests
.venv\Scripts\python -m pytestNo network, no Telegram account needed — Telethon is faked throughout.
Security
session/telegram.session is a full login to your Telegram account. It is
gitignored and never leaves this machine. Anyone holding that file can read
your messages; delete it and re-run the login if you suspect it has been
copied. Credentials live only in .env — never in docs, prompts, or tickets.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityBmaintenanceEnables interaction with Telegram groups via MTProto, including message retrieval, sending, and semantic search with RAG support.12
- AlicenseNot gradedqualityBmaintenanceIntegrates Telegram user account with MCP, exposing operations like reading and sending messages, managing chats, and more via stdio or SSE transport.Apache 2.0
- AlicenseAqualityBmaintenanceEnables reading chats, messages, and media and sending messages/files via a Telegram user account (MTProto/Telethon), supporting group history and media that bots cannot access.8MIT
- AlicenseNot gradedqualityCmaintenancePersonal read-only Telegram MCP server exposing chat, message, and media tools via streamable HTTP with bearer authentication.1Apache 2.0
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Image/video analysis: NSFW detection, object detection, thumbnails
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/EyalWerber/telegram-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server