telegram-mcp
Allows AI agents to read and summarize Telegram group and channel history, search messages and dialogs, download media, send messages, and delete messages via MTProto, enabling tasks like research, conversation summarization, and resource extraction from Telegram communities.
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-mcpSummarize @project_alpha from 30 July 2026 10:00 to 12:00 Europe/Moscow."
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
Turn Telegram group history into source-linked summaries with Codex or Claude.
What is this?
telegram-mcp is an MCP server and a portable agent skill for summarizing Telegram discussions over exact time ranges. It uses MTProto rather than Bot API, so it can read groups and channels already available to your Telegram account without adding a bot.
Connect it to Codex, Claude, or another MCP client. The client resolves the requested source, reads complete bounded windows, removes overlap, and returns topic and participant summaries with traceable source links.
Related MCP server: Telegram Agent for Codex
Summary-first use cases
One group
Summarize @project_alpha from 30 July 2026 10:00 to 12:00 Europe/Moscow.
Include participant contributions, decisions, risks, resources, and sources.Several groups
Summarize Project Alpha and Build Room from Monday 09:00 until now.
Keep coverage and sources separate for each group, then show shared topics.Search and research
Find a historical message or exact resource link.
Compare how several communities discussed the same topic.
Download and inspect referenced media when the user asks for it.
Tools
Tool | Description |
| Search chats, groups, and channels by name or username |
| Fetch messages with date range, unread filter, and mark-as-read support |
| Full-text search across all chats or within a specific chat |
| Download media (photo, video, document) from a message to a local file |
| Fetch a message by its |
| Delete messages from a chat (requires opt-in via |
| Send a text message to a chat (requires opt-in via |
| Send a local file to a chat as a document (requires opt-in via |
Full reference with parameters and examples → docs/tools.md
Quick Start
1. Get Telegram API credentials
Go to my.telegram.org, create an app, and grab your API_ID and API_HASH.
2. Install
git clone https://github.com/newink/telegram-mcp.git
cd telegram-mcp
bun install
cp .env.example .env
# Fill in TELEGRAM_API_ID and TELEGRAM_API_HASH3. Start and authorize via browser
bun startIf no session is configured, the server starts in setup mode and prints an auth URL:
WARN: auth required — open URL to connect Telegram account
url: "http://localhost:3000/auth?token=a3f9b2c1-..."Open the URL in your browser — you'll see an auth page where you can sign in with a QR code (scan with Telegram → Settings → Devices → Link Desktop Device) or your phone number. After signing in, the session is saved to .env and the server is ready.
One-time token — the
/authURL is only valid once per server start and expires after successful login. Restarting the server generates a new token.
That's it. Point your MCP client at http://localhost:3000/mcp.
Prefer the terminal? Use bun run auth
bun run auth
# Interactive CLI: QR code or phone number, saves session to .env
bun startBoth flows produce the same result — pick whichever fits your setup.
Docker
Run with Docker Compose — no Bun installation needed:
cp .env.example .env
# Fill in TELEGRAM_API_ID and TELEGRAM_API_HASH
docker compose upThe first time you start the container without a TELEGRAM_SESSION, it will print an auth URL — open it in your browser to sign in. The session is persisted to ./bot-data/ so you only need to auth once.
docker build -t telegram-mcp .
docker run -p 3000:3000 \
--env-file .env \
-e ENV_FILE=/app/bot-data/.env \
-v ./bot-data:/app/bot-data \
telegram-mcpPull pre-built image
# Latest stable
docker pull newink/telegram-mcp
# Or from GitHub Container Registry
docker pull ghcr.io/newink/telegram-mcpSupported platforms: linux/amd64, linux/arm64 (Raspberry Pi, Apple Silicon via Rosetta).
How the summary agent works
Normalize the inclusive start, end, and timezone.
Resolve each group or channel without guessing ambiguous names.
Read up to 500 messages per bounded request without marking them as read.
Split saturated intervals into smaller overlapping windows.
Verify coverage and stop safely on Telegram access errors.
Deduplicate overlaps and sort messages chronologically.
Cluster substantive topics and attribute each claim to participants.
Cite public Telegram messages and preserve external URLs exactly.
Separate facts from conclusions and disclose partial reads or uninspected attachments.
The packaged skill is
.agents/skills/telegram-summary/SKILL.md.
It is read-only: summary requests never invoke Telegram write tools.
Representative result:
### Runtime upgrade
- Anna (@anna) proposed the upgrade after mock CI.
- Boris (@boris) identified a container compatibility risk and requested a smoke test.
- Decision: run both checks before reconsidering the upgrade.
- Sources: https://t.me/project_alpha/5101, https://t.me/project_alpha/5102Private groups receive message IDs instead of fabricated public links. Media contents are excluded unless the attachment was explicitly downloaded and inspected.
Connect to Your AI Client
Codex
This repository includes .codex/config.toml:
[mcp_servers.telegram]
url = "http://localhost:3000/mcp"Start the MCP server, open the repository in Codex, and ask for a date-and-source summary. The packaged skill provides the orchestration contract.
Claude Desktop
Start the server first (bun start), then add to claude_desktop_config.json:
{
"mcpServers": {
"telegram": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}mcporter / OpenClaw
{
"mcpServers": {
"telegram": {
"baseUrl": "http://localhost:3000/mcp"
}
}
}Direct HTTP (any client)
# Initialize session first, then call tools:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_dialogs","arguments":{"query":"news"}}}'Environment Variables
Variable | Required | Description |
| Yes* | From my.telegram.org |
| Yes* | From my.telegram.org |
| Yes* | Generated by browser auth or |
| No | Server port (default: |
| No | Pino log level: |
| No | Set |
| No | Write-tool allowlist path (default: |
| No | Session keepalive interval (default: 6 hours) |
*Not required when TELEGRAM_MOCK=true.
Development
bun dev # Start with hot reload
bun test # Run tests (uses mock automatically)
bun run typecheck # TypeScript check
bun run lint # Biome lint + format
bun run lint:fix # Auto-fix lint issues
bun run knip # Find dead code
bun run audit # Dead code, docs, env coverage, and TODO checksMock mode — develop and test without a real Telegram account:
TELEGRAM_MOCK=true bun dev # server with fake data
TELEGRAM_MOCK=true bun test # run testsMock data includes sample dialogs, messages, and media — enough to build and test new tools without touching the real API.
Project structure and architecture → docs/architecture.md MTProto specifics and gotchas → docs/mtproto.md Adding new tools → docs/tools.md Testing and BDD scenarios → docs/testing.md
Built With
Bun — runtime & package manager
mtcute — MTProto client for TypeScript
@modelcontextprotocol/sdk — MCP server SDK
Zod — schema validation
Biome — linter & formatter
License
MIT
This server cannot be installed
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
- Alicense-qualityBmaintenanceTelegram MTProto-based MCP server with 19 tools for reading, searching, sending, forwarding, and summarizing messagesLast updatedMIT
- Alicense-qualityBmaintenancePrivacy-first Telegram MCP server enabling maintainers to triage chats, inspect context, search messages, draft replies, and send authorized messages locally without a cloud relay.Last updated5201MIT
- Alicense-qualityBmaintenanceA read-only Telegram MCP server that retrieves messages from your DMs, groups, and channels, enabling Claude to generate executive briefings from Telegram conversations.Last updatedMIT
- Flicense-qualityCmaintenanceAn MCP server that connects to a Telegram group chat, persists messages to a local SQLite database, and exposes tools to search, retrieve, and send messages via SSE.Last updated
Related MCP Connectors
An MCP server for deep research or task groups
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
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/t0uchY233/telegram-summarize'
If you have feedback or need assistance with the MCP directory API, please join our Discord server