Telegram Web MCP Server
Allows AI agents to interact with Telegram Web, providing tools for searching chats, retrieving chat history, sending messages, and getting profile info.
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., "@Telegram Web MCP ServerSearch for 'Design Team' chat and show recent messages"
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 Web MCP Server
A powerful, token-efficient Model Context Protocol (MCP) server for AI Agents to interact with Telegram Web.
Instead of forcing your AI (like Claude, Antigravity, or Cursor) to use heavy browser automation subagents that waste tokens analyzing DOM trees and screenshots, this server provides a clean, text-based API to interact with Telegram chats directly via a persistent Playwright session.
✨ Features
Token Efficient: Returns clean text instead of complex HTML DOMs.
Persistent Session: Log in once, and the session is saved forever.
Smart Tools:
search_chats- Find and open a chat by username.get_recent_chats- Retrieve recent chat names/titles and metadata from the sidebar.get_chat_history- Get the most recent text messages.get_profile_info- Retrieve user profiles and bios.send_message- Send messages directly to the active chat.send_file- Upload documents/files to a specified chat.send_photo- Upload images/photos to a specified chat.reply_to_message- Reply directly to a specific target message.
AI-Ready Skills: Includes dedicated skill guides to teach your AI exactly how to use these tools without sounding like a robot.
Related MCP server: telegram-mcp
📦 Installation & Setup (For Humans)
Clone & Install Dependencies
git clone https://github.com/yourusername/telegram-mcp.git cd telegram-mcp npm installDownload Playwright Browsers
npm run setup(Note: This command installs the necessary Chromium binaries. If it fails due to network issues, try connecting via VPN).
Build the Project
npm run buildInitial Login (Headful Mode) To use Telegram Web, you must log in once. Run the login script:
npm run loginA browser window will appear. Scan the QR code with your Telegram app on your phone. Once you see your chats, close the browser window. Your session is now saved in the
telegram_profile/folder!
🤖 Integration (For AI Agents)
Add this server to your AI's MCP configuration file (e.g., in Antigravity or Claude Desktop).
MCP Configuration Example
{
"mcpServers": {
"telegram": {
"command": "node",
"args": ["/absolute/path/to/telegram-mcp/build/index.js"]
}
}
}🧠 Teach your AI how to use it!
We have provided a ready-to-use Skill for your AI.
Simply copy the skills/telegram-mcp/ folder into your AI's custom skills directory (for example, .gemini/config/skills/). The AI will read this file and instantly learn the best practices for chatting like a real human!
🛠️ Available MCP Tools
Tool Name | Description | Parameters |
| Find and open a chat by username |
|
| Retrieve a list of recent chat names/titles and metadata from the left sidebar |
|
| Get recent text messages from the currently open chat |
|
| Get profile info of the currently open chat | none |
| Send a message to the currently open chat |
|
| Upload a document or file to a specified chat (or currently open chat) |
|
| Upload an image/photo to a specified chat (or currently open chat) |
|
| Reply directly to a target message in a chat |
|
Built with ❤️ for the AI Automation community.
This server cannot be deployed
Maintenance
Related MCP Connectors
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, send, and organize Telegram messages and chats. Supports tools for listing chats, fetching messages, sending/reply, archiving, muting, and folder management.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to test Telegram bots by driving the official Telegram Web client in a real browser, allowing visual verification of bot responses, inline keyboards, and Mini Apps.2MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate a Telegram account through the same commands as the terminal client: messaging, chat management, voice transcription, calls, stickers, and privacy settings.1MIT