telegram-mcp
Enables 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.
README
telegram-mcp
Telegram MCP server that gives AI agents full access to your chats, channels, and groups. Works with any MCP-compatible client (Claude Code, Cursor, etc.). Built with Telethon.
Read messages, send replies, and organize your Telegram: auto-categorize channels into folders, mute noisy chats, archive stale ones, and clean up subscriptions. See AGENTS.md for ready-to-use workflows.
What can it do?
Read - list chats/channels/groups, fetch and search messages, get chat details
Write - send, edit, delete, and forward messages, pin/unpin, mark as read
Organize - archive/unarchive, mute/unmute, create and manage chat folders
AI Workflows
The tools are designed to work together for multi-step organization tasks. AGENTS.md includes ready-to-use workflows:
- Auto-organize channels into folders - fetch all channels, sample recent messages to infer topics, group into themed folders
- Identify cleanup candidates - find inactive or high-unread channels, suggest archive/mute/unsubscribe
- Triage unread messages - summarize what's important across chats, bulk mark-read the rest
- Reorganize existing folders - audit folder structure, find uncategorized chats, restructure
Setup
1. Get Telegram API credentials
Go to my.telegram.org/apps and create an application. You'll get an API_ID and API_HASH.
2. Install
git clone https://github.com/VovaVindar/telegram-mcp.git
cd telegram-mcp
python3 -m venv .venv
.venv/bin/pip install -e .
3. Configure
cp .env.example .env
# Edit .env with your API_ID and API_HASH
4. Authenticate
.venv/bin/python3 telegram_mcp_server.py
Scan the QR code with your Telegram app (Settings > Devices > Link Desktop Device). This creates a telegram.session file that stores your auth state.
5. Connect to Claude Code
The .mcp.json file registers the server automatically. Just open Claude Code in this directory and the tools will be available.
To use it from any directory, add this to your ~/.claude/claude_code_config.json:
{
"mcpServers": {
"telegram-mcp": {
"command": "/absolute/path/to/telegram-mcp/.venv/bin/fastmcp",
"args": ["run", "/absolute/path/to/telegram-mcp/telegram_mcp_server.py"]
}
}
}
Available Tools
| Tool | Description |
|---|---|
list_dialogs |
List chats/channels/groups with optional filter |
get_messages |
Fetch messages (use "me" for Saved Messages) |
search_messages |
Search messages by text, optionally within a chat |
get_chat_info |
Get details about a chat or user |
send_message |
Send a message (supports reply) |
edit_message |
Edit an existing message |
delete_messages |
Delete messages by ID |
forward_messages |
Forward messages between chats |
archive_chat |
Archive a chat |
unarchive_chat |
Unarchive a chat |
pin_message |
Pin a message in a chat |
unpin_message |
Unpin a message |
mark_read |
Mark all messages in a chat as read |
mute_chat |
Mute a chat (optionally for N hours) |
unmute_chat |
Unmute a chat |
list_folders |
List all chat folders |
create_folder |
Create a new folder with specified chats |
update_folder |
Rename or modify folder chats |
delete_folder |
Delete a folder |
Tips
- Use
chat_id="me"to target Saved Messages - Paginate with
offset_id: pass the last message ID from the previous batch - Folder names are limited to 12 characters by Telegram
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.