TeleHarvest
Provides tools to inspect and scrape Telegram public channels, private groups/channels, members, stories, messages, global search, similar-channel discovery, analytics/BI metrics, and dataset export.
Click on "Deploy 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., "@TeleHarvest scrape the last 100 posts from @durov"
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.
TeleHarvest v2.0 — AI-Agent-Ready Telegram Scraper & Intelligence Suite
TeleHarvest v2.0 is a complete, security-hardened Telegram scraping, multimodal indexing (OCR + Voice Transcription), hybrid semantic search, channel network discovery, BI analytics, and export suite — built to be effortless for both non-technical humans (1-Click Launch + Guided Simple/Pro TR/EN Web Dashboard) and AI Agents (18-Tool Native MCP Server + SKILL.md + --json CLI).
Launch in 1 click (
./start.shon macOS/Linux,start.baton Windows, oruv run tgscrape start) — or connect your AI agent and say: "Inspect and scrape@durov, discover similar channels, and export BI metrics + Gephi graph."
Accountless vs. MTProto: What Works Without Logging In?
Telegram enforces strict protocol rules on what can be read anonymously:
Target Type | Accountless ( | MTProto Login ( | Account Ban Risk |
Public Broadcast Channels (e.g. | YES (instant, no API keys) | YES (full history, comments, media) | NONE on |
Public Groups / Supergroups (e.g. | NO (Telegram never exposes group history on | YES (messages, topics, members, live) | LOW (safe preset) |
Private Channels & Private Groups ( | NO | YES (any chat you are a member of) | LOW (safe preset) |
Similar Channels, Stories & Global Search | NO | YES | LOW |
Live Real-Time Tracking (New / Edit / Delete) | NO | YES | LOW |
Run uv run tgscrape inspect <link> anytime (or paste any link in the Web Home Smart Inspector) to check a target without an account before scraping!
Related MCP server: Telegram MCP Readonly
1-Click Launch (Humans)
# macOS / Linux (creates env, checks build, starts server & opens browser)
./start.sh
# Windows
start.bat
# Or via CLI anytime:
uv run tgscrape startThe dashboard includes:
Simple Mode (6 essential tabs) by default + Pro Mode (all 12 tabs) toggle.
Turkish / English (
TR/EN) live language switcher.Smart Link Inspector Home: Paste
@durovor anyt.me/URL -> auto-detects accountless vs. 60-second QR login flow + 1-click presets (Last 100,Last 500 + Media).1-Click "Connect AI Agent (MCP)" Modal right in the sidebar to copy Claude Code / Cursor / Antigravity /
uvxsetup snippets.
Quick Start for AI Agents (Zero Friction)
Option 1: Built-In MCP Server (tgscrape mcp — 18 Tools)
git clone https://github.com/SmtDcs/telegram-scraper.git telegram-scraper
cd telegram-scraper
uv sync --python 3.12Claude Code (1 Command):
claude mcp add teleharvest -- uv --directory /ABSOLUTE/PATH/TO/telegram-scraper run tgscrape mcpCursor / Antigravity / Windsurf / Claude Desktop (mcp.json):
{
"mcpServers": {
"teleharvest": {
"command": "uv",
"args": ["--directory", "/ABSOLUTE/PATH/TO/telegram-scraper", "run", "tgscrape", "mcp"]
}
}
}Or Zero-Clone via uvx (from Git URL or PyPI):
{
"mcpServers": {
"teleharvest": {
"command": "uvx",
"args": ["--from", "git+https://github.com/SmtDcs/telegram-scraper", "tgscrape", "mcp"]
}
}
}Your AI agent immediately gets 18 native Telegram tools:
inspect_telegram_target, scrape_public_channel, list_accounts, list_dialogs, list_chats, scrape_chat, scrape_members, search_messages, get_message_thread, get_analytics, export_dataset, get_overview_stats, discover_similar_channels, global_telegram_search, scrape_stories, list_stories, get_channel_bi_metrics, semantic_search_messages.
Option 2: Agent Skill + --json CLI (No MCP Needed)
The repository includes AGENTS.md, CLAUDE.md, and a portable Agent Skill at .agents/skills/teleharvest/SKILL.md.
What's New in v2.0 & Key Features
Zero-Auth Public Channel Scraper (
t.me/s/): Instant scraping withHTTP 429retry backoff, multi-photo albums, SHA-256 media dedup, and Smartinspecttarget diagnostics.Full MTProto Scraper (
Telethon) + Safety Shield (AccountSafetyGuard): QR Code (Web UI + terminal ASCII), Phone+OTP+2FA,StringSession, SOCKS5/HTTP/MTProxy tester, gap-free incremental sync,fcntl.flocksession protection,safe/balanced/fastpresets, and automatic FloodWait/freeze quarantine.Snowball Channel Discovery & Gephi Graph Mapping:
GetChannelRecommendationsRequest+ forward network edges (discover), plusedgelist_csv(Gephi) &graph_jsonexports.Global Telegram Search: Search unjoined public channels and messages across Telegram (
global-search).Ephemeral Stories Archiver: Archive active 24h stories + media before expiration (
stories//api/chats/{id}/scrape-stories).Multimodal OCR + Voice Transcription indexed into FTS5: Gemini Vision OCR (
ocr) +gemini-3.5-transcribeaudio/voice/video_note transcription (transcribe) automatically searchable via SQLite FTS5.Auto-Translation & Hybrid Semantic Vector Search: Multi-language batch translation (
translate) + 768-dimgemini-embedding-001vectors (embed) fused with FTS5 via Reciprocal Rank Fusion (semantic-search).Channel BI Metrics & Native Broadcast Stats: Automatic ER % (engagement / views), ERR % (reach / subscribers), posts/day, plus native Telegram
GetBroadcastStatsRequestinspection (bi-stats).11 Export Formats:
json,jsonl,csv(UTF-8 BOM), 4-sheet Excel (.xlsx), self-contained HTML Archive, Markdown, filtered SQLite (.db),members_csv,members_json,edgelist_csv(Gephi), andgraph_json.Security Hardening: Optional Bearer
API_TOKEN, strict localhost CORS,X-Content-Type-Options: nosniff+ attachment downgrade on.html/.svg, SSRF-checked webhooks,0700/0600data directory permissions.
CLI Reference (tgscrape)
# Inspect any link without an account (channel vs group vs private)
uv run tgscrape inspect https://t.me/tradesberserk_chat --json
# Accountless public broadcast channel scrape
uv run tgscrape public @telegram --limit 200 --media --json
# Authorize an MTProto account (QR code in terminal or Phone+OTP+2FA)
uv run tgscrape auth add
uv run tgscrape auth list
uv run tgscrape auth export-string 1
# Browse joined chats & scrape private channels or public groups
uv run tgscrape dialogs
uv run tgscrape scrape @group_or_channel --limit 500 --comments --media
uv run tgscrape scrape @group_or_channel --incremental
uv run tgscrape scrape @group_or_channel --resume-backfill
uv run tgscrape media-retry --limit 200
# Harvest group members & admins
uv run tgscrape members @group_name --limit 2000
# Live monitor in terminal
uv run tgscrape listen
# Search (SQLite FTS5) & Export (11 formats)
uv run tgscrape search "bitcoin OR ethereum" --json
uv run tgscrape export xlsx --chat-id -100123456789
uv run tgscrape export members_csv --chat-id -100123456789
uv run tgscrape export edgelist_csv # Gephi graph CSV
uv run tgscrape export graph_json # Network nodes+edges JSON
uv run tgscrape export sqlite # secret-free filtered DB
# Discovery, Stories, Global Search & BI Metrics (v2.0)
uv run tgscrape discover @seed_channel --depth 1 --json
uv run tgscrape global-search "bitcoin" --type channels --json
uv run tgscrape stories -100123456789 --json
uv run tgscrape bi-stats --days 30 --json
# AI Digest, Auto-Tagging, OCR, Transcription, Translation & Semantic Search
uv run tgscrape ai digest --limit 150
uv run tgscrape ai classify --limit 50
uv run tgscrape ai ask "What were the main announcements this week?"
uv run tgscrape ai ocr --limit 25
uv run tgscrape ai transcribe --limit 20
uv run tgscrape ai translate --lang Turkish --limit 40
uv run tgscrape ai embed --limit 200
uv run tgscrape ai semantic-search "crypto inflows" --json
# Start MCP Server (for AI agents) or 1-Click Web Dashboard
uv run tgscrape mcp
uv run tgscrape start
uv run tgscrape serve --host 127.0.0.1 --port 8765Environment Variables (.env.example)
Variable | Default | Purpose |
| (optional) | Default Telegram API credentials from my.telegram.org/apps |
|
| Web Dashboard bind address |
| (empty) | Enables Bearer auth on |
| localhost ports | Comma-separated allowed browser origins |
|
|
|
|
| Above this duration (sec), jobs pause safely instead of waiting |
|
| Maximum media download size per file |
|
| Set |
|
|
|
|
| Google Gemini Interactions API config |
Docker
# For non-localhost exposure, set API_TOKEN in .env first
docker compose up -d --buildDevelopment & Tests
# Run full test suite
uv run pytest -v
# Rebuild React + TypeScript + Tailwind frontend into backend/tgscrape/static/
cd frontend && npm install && npm run buildDisclaimer & Safety Notice
Use TeleHarvest responsibly and only on channels, groups, and data you are authorized to access under Telegram's Terms of Service and applicable privacy laws. High-frequency MTProto scraping—especially aggressive member enumeration or bio harvesting on fresh/VoIP accounts or datacenter IPs—can lead to temporary FloodWait limits or account freezes. Prefer a dedicated secondary account on a clean IP with the default safe preset.
License
Available Tools
18 toolsdiscover_similar_channelsB
Discover related Telegram channels from a seed channel using Telegram recommendations & forward edges (requires MTProto).
Inputs: target (required), depth, account_id, max_channels, +1 more. Returns: result
export_datasetC
Export scraped Telegram data to a file.
Supported formats: json, jsonl, csv, xlsx, html, markdown, sqlite (secret-free), members_csv, members_json.
Inputs: fmt, query, chat_id, date_to, +2 more. Returns: result
get_analyticsB
Get analytics across scraped messages: daily/hourly volume, top hashtags, cashtags, domains, mentions, reactions, and viral posts.
Inputs: days, chat_id. Returns: result
get_channel_bi_metricsC
Get computed Business Intelligence metrics (ER %, ERR %, avg views, forwards, replies, posts/day) per channel.
Inputs: days, chat_id. Returns: result
get_message_threadB
Retrieve a parent Telegram message together with all scraped replies and channel comments.
Inputs: msg_id (required), chat_id (required), limit. Returns: result
get_overview_statsA
Return overall TeleHarvest database stats (chats, messages, users, media, alerts, edits, deletes).
Inputs: no named parameters. Returns: result
global_telegram_searchC
Search Telegram globally for public channels/groups (search_type='channels') or messages (search_type='messages') via MTProto.
Inputs: query (required), limit, account_id, search_type. Returns: result
inspect_telegram_targetA
Inspect any Telegram @username or t.me link WITHOUT an account.
Detects whether the target is a public broadcast channel (accountless scraping supported), a public group (requires MTProto login), a no-preview channel, a user/bot, or not found.
Inputs: target (required), proxy_url. Returns: result
list_accountsA
List configured Telegram MTProto accounts and their connection/safety status (secrets masked).
Inputs: no named parameters. Returns: result
list_chatsA
List all Telegram channels and groups currently stored in the local TeleHarvest SQLite database.
Inputs: no named parameters. Returns: result
list_dialogsB
List Telegram channels, supergroups, groups, and chats the authorized MTProto account has joined.
Inputs: limit, account_id. Returns: result
list_storiesB
List previously archived Telegram Stories from the local TeleHarvest database.
Inputs: limit, chat_id. Returns: result
scrape_chatB
Scrape ANY public group, private channel, or supergroup via an authorized MTProto account.
target accepts @username, t.me/link, t.me/+invite, or numeric chat ID.
Requires an authorized MTProto account (configure once with tgscrape auth add or Web UI Accounts page).
Inputs: target (required), limit, date_to, topic_id, +6 more. Returns: result
scrape_membersB
Safely harvest visible members and admins from a Telegram group via MTProto.
Always runs in safe non-aggressive mode to protect account health; falls back to message-sender harvesting if the group hides its member list.
Inputs: target (required), limit, account_id. Returns: result
scrape_public_channelA
Scrape a public Telegram broadcast channel via t.me/s/ WITHOUT needing an account or API keys.
Returns scrape stats plus the latest 10 scraped posts. Fails with a clear diagnostic if the target
is a public group or private channel (which require MTProto via scrape_chat).
Inputs: target (required), limit, proxy_url, download_media, +1 more. Returns: result
scrape_storiesB
Archive currently active ephemeral Telegram Stories from a channel or user via MTProto.
Inputs: target (required), account_id, download_media. Returns: result
search_messagesC
Search scraped Telegram messages using SQLite FTS5 full-text search and structured filters.
Inputs: limit, query, offset, chat_id, +6 more. Returns: result
semantic_search_messagesB
Run hybrid semantic + FTS5 search over scraped messages (uses Gemini embeddings when configured, falls back to FTS5).
Inputs: query (required), limit, chat_id. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target clearly different resources or workflows, with especially clear separation between accountless scraping and MTProto scraping. Minor overlap remains between list_chats and list_dialogs, between search_messages and semantic_search_messages, and among analytics/metrics tools, though descriptions generally clarify intent.
The set mostly follows a predictable verb_noun pattern such as list_chats, scrape_chat, search_messages, and get_analytics. A few names break the pattern, notably global_telegram_search and semantic_search_messages, but the overall convention remains readable.
Eighteen tools is slightly above the ideal compact range, but the server covers a broad domain including scraping, search, analytics, export, accounts, stories, and discovery. Each tool appears to earn its place rather than duplicating another operation.
The surface covers the core Telegram harvesting lifecycle well: target inspection, public and MTProto scraping, member/story archiving, search, thread retrieval, analytics, export, and discovery. Minor gaps exist around in-MCP account authorization/removal and data cleanup or alert management, but core workflows are not blocked.
Maintenance
Related MCP Connectors
Live Telegram data: trending topics, channel profiles & metrics, post history incl. edits/deletions.
Telegram for AI agents, no login: keyword search, channel posts, comments, username lookup.
Direct access to 60+ scraping and search tools. Extract structured data from Google (Search, Maps, Trends), Amazon, Airbnb, Social Media, and any web page directly into your AI agent.
Telegram CRM: lead sourcing, DM campaigns, shared inbox, pipelines and analytics. 120+ tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search and act on Telegram conversations, groups, channels, files, and links, with semantic search, AI-powered knowledge extraction, human-in-the-loop approvals, and PostgreSQL/pgvector persistence.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search and analyze a Telegram account as a read-only knowledge source, allowing chat discovery, message search, history reading, contact inspection, and media download without exposing any mutating Telegram tools.11Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Telegram through 50+ tools for chats, messages, contacts, users, groups, and channels, with per-topic isolation and a reactive inbox for multi-agent use.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Telegram chats, messages, contacts, users, groups, and channels via 50+ MCP tools, with a reactive inbox and per-topic proxy isolation for multi-agent setups.MIT