Telegram MCP server
Provides tools for interacting with the Telegram API, enabling AI assistants to list chats, channels, groups, and messages; send, edit, delete, and forward messages; create groups; mark dialogs as read; manage chat folders; mute/unmute, archive/unarchive, and leave dialogs.
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 MCP serversummarize my unread Telegram 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 MCP server
About
The server is a bridge between the Telegram API and the AI assistants and is based on the Model Context Protocol.
Based onsparfenyuk/mcp-telegram (MIT).
The original project provided the MCP server skeleton and read-only tools (ListDialogs, ListMessages).
This project adds write/admin tools (send, edit, delete, forward, create group, mark as read, folders,
mute/archive/leave) and richer message/dialog output. Thanks to @sparfenyuk for the base work.
Ensure that you have read and understood theTelegram API Terms of Service before using this server. Any misuse of the Telegram API may result in the suspension of your account.
Related MCP server: tdlib-mcp-server
What is MCP?
The Model Context Protocol (MCP) is a system that lets AI apps, like Claude Desktop, connect to external tools and data sources. It gives a clear and safe way for AI assistants to work with local services and APIs while keeping the user in control.
What does this server do?
Tools available in this project:
ListDialogs— list chats / channels / groupsListMessages— list messages with id, date, sender, text (search / unread filters)GetMessage— read a single message by idSendMessage— send a text messageEditMessage— edit your messageDeleteMessages— delete messagesForwardMessages— forward messages (optional delete originals ≈ move)CreateGroup— create a basic group or megagroupMarkAsRead— mark a dialog as readListFolders— list chat folders (dialog filters)UpsertFolder— create or update a folder with dialog idsDeleteFolder— delete a folder by idReorderFolders— set folder orderMuteDialog— mute notifications (forever or for N seconds)UnmuteDialog— unmute notificationsArchiveDialog/UnarchiveDialog— move dialogs to/from archiveLeaveDialog— leave a group/channel or remove a private dialogDownload media files
Get the list of contacts
Practical use cases
Create a summary of the unread messages
Send replies or drafts from an AI assistant
Forward / clean up messages across chats
Create a group and invite users by id
Organize chats into Telegram folders
Mute, archive or leave noisy chats
Find contacts with upcoming birthdays and schedule a greeting
Find discussions on a given topic, summarize them and provide a list of links
Prerequisites
Installation
uv tool install git+https://github.com/dimajolkin/mcp-telegramOriginal read-only project: sparfenyuk/mcp-telegram.
If you have already installed the server, you can update it usinguv tool upgrade --reinstall command.
If you want to delete the server, use theuv tool uninstall mcp-telegram command.
Configuration
Telegram API Configuration
Before you can use the server, you need to connect to the Telegram API.
Get the API ID and hash from Telegram API
Run the following command:
mcp-telegram sign-in --api-id <your-api-id> --api-hash <your-api-hash> --phone-number <your-phone-number>Enter the code you received from Telegram to connect to the API.
The password may be required if you have two-factor authentication enabled.
To log out from the Telegram API, use themcp-telegram logout command.
Claude Desktop Configuration
Configure Claude Desktop to recognize the Exa MCP server.
Open the Claude Desktop configuration file:
in MacOS, the configuration file is located at
~/Library/Application Support/Claude/claude_desktop_config.jsonin Windows, the configuration file is located at
%APPDATA%\Claude\claude_desktop_config.json
Note: You can also find claude_desktop_config.json inside the settings of Claude Desktop app
Add the server configuration
{ "mcpServers": { "mcp-telegram": { "command": "mcp-telegram", "env": { "TELEGRAM_API_ID": "<your-api-id>", "TELEGRAM_API_HASH": "<your-api-hash>" } } } }
Telegram Configuration
Before working with Telegram’s API, you need to get your own API ID and hash:
Login to your Telegram account with the phone number of the developer account to use.
Click under API Development tools.
A 'Create new application' window will appear. Fill in your application details. There is no need to enter any URL, and only the first two fields (App title and Short name) can currently be changed later.
Click on 'Create application' at the end. Remember that your API hash is secret and Telegram won’t let you revoke it. Don’t post it anywhere!
Development
Getting started
Clone the repository
Install the dependencies
uv syncRun the server
uv run mcp-telegram --help
Tools can be added to the src/mcp_telegram/tools.py file.
How to add a new tool:
Create a new class that inherits from ToolArgs
class NewTool(ToolArgs): """Description of the new tool.""" passAttributes of the class will be used as arguments for the tool. The class docstring will be used as the tool description.
Implement the tool_runner function for the new class
@tool_runner.register async def new_tool(args: NewTool) -> t.Sequence[TextContent | ImageContent | EmbeddedResource]: passThe function should return a sequence of TextContent, ImageContent or EmbeddedResource. The function should be async and accept a single argument of the new class.
Done! Restart the client and the new tool should be available.
Validation can accomplished either through Claude Desktop or by running the tool directly.
Debugging the server in terminal
To run the tool directly, use the following command:
# List all available tools
uv run cli.py list-tools
# Run the concrete tool
uv run cli.py call-tool --name ListDialogs --arguments '{"unread": true}'Debugging the server in the Inspector
The MCP inspector is a tool that helps to debug the server using fancy UI. To run it, use the following command:
npx @modelcontextprotocol/inspector uv run mcp-telegramDo not forget to define Environment Variables TELEGRAM_API_ID and TELEGRAM_API_HASH in the inspector.
Troubleshooting
Message 'Could not connect to MCP server mcp-telegram'
If you see the message 'Could not connect to MCP server mcp-telegram' in Claude Desktop, it means that the server configuration is incorrect.
Try the following:
Use the full path to the
uvbinary in the configuration fileCheck the path to the cloned repository in the configuration file
This server cannot be deployed
Maintenance
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Messaging tools for AI agents: send messages, manage chats, groups and channels.
I use your linked Telegram MTProto session (Integrations → Telegram) to list groups, members, and s…
1
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
- FlicenseNot gradedqualityDmaintenanceConnects AI agents to Telegram via the official TDLib library, enabling tools like getting user info, listing dialogs, and searching messages.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Telegram Bot API, allowing them to send messages, forward messages, get bot information, and receive updates.16 npm3MIT
- 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