
Telegram
STDIOTelegram MCP server for accessing and searching channel content via API or web scraping.
Telegram MCP server for accessing and searching channel content via API or web scraping.
A powerful MCP (Model Context Protocol) server that enables Claude to interact with Telegram channels and groups. This server provides both web scraping and direct API access to Telegram content.
git clone https://github.com/DLHellMe/telegram-mcp-server.git cd telegram-mcp-server
npm install
cp .env.example .env
Edit .env
and add your configuration:
TELEGRAM_API_ID
and TELEGRAM_API_HASH
Build the project:
npm run build
api_id
and api_hash
to the .env
fileAdd this to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{ "mcpServers": { "telegram-scraper": { "command": "node", "args": ["/absolute/path/to/telegram-mcp-server/dist/index.js"], "env": { "TELEGRAM_API_ID": "your_api_id", "TELEGRAM_API_HASH": "your_api_hash" } } } }
After configuration, restart Claude Desktop. The Telegram tools will be available in Claude.
telegram_api_login - Authenticate with Telegram (first time only)
Use telegram_api_login to connect to Telegram
api_scrape_channel - Scrape channel posts (unlimited by default)
Use api_scrape_channel with url="https://t.me/channelname"
Or with a limit:
Use api_scrape_channel with url="https://t.me/channelname" and max_posts=50
api_search_channel - Search within a channel
Use api_search_channel with url="https://t.me/channelname" and query="keyword"
scrape_channel - Scrape public channels
Use scrape_channel with url="https://t.me/channelname"
telegram_login - Login for restricted content
Use telegram_login with phone="+1234567890"
Session data and cookies are stored in platform-specific directories:
%APPDATA%\telegram-mcp-data
~/Library/Application Support/telegram-mcp-data
~/.config/telegram-mcp-data
You can override this with the TELEGRAM_DATA_PATH
environment variable.
.env
file - it contains sensitive API credentials.gitignore
file to prevent accidental commits# Run in development mode npm run dev # Build the project npm run build # Watch for changes npm run watch
Contributions are welcome! Please:
MIT License - see LICENSE file for details
Built with:
This tool is for educational and research purposes. Please respect Telegram's Terms of Service and the privacy of channel members. Always obtain permission before scraping private channels.
telegram_api_login
firstBROWSER_TIMEOUT
in .env