telegram-mcp
Telegram MCP for managing dialogs, messages, drafts, read statuses, and more.
Documentation
Telegram MCP server
The server is a bridge between the Telegram API and the AI assistants and is based on the Model Context Protocol.
> [!IMPORTANT]
> Ensure that you have read and understood the Telegram API Terms of Service before using this server.
> Any misuse of the Telegram API may result in the suspension of your account.
Table of Contents
What is MCP?
The Model Context Protocol (MCP) is a system that lets AI apps, like Claude Desktop or Cursor, 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?
Capabilities
- [x] Get current account information (`tool: tg_me`)
- [x] List dialogs with optional unread filter (`tool: tg_dialogs`)
- [x] Mark dialog as read (`tool: tg_read`)
- [x] Retrieve messages from specific dialog (`tool: tg_dialog`)
- [x] Send draft messages to any dialog (`tool: tg_send`)
Prompt examples
Here are some example prompts you can use with AI assistants:
Message Management
- "Check for any unread important messages in my Telegram"
- "Summarize all my unread Telegram messages"
- "Read and analyze my unread messages, prepare draft responses where needed"
- "Check non-critical unread messages and give me a brief overview"
Organization
- "Analyze my Telegram dialogs and suggest a folder structure"
- "Help me categorize my Telegram chats by importance"
- "Find all work-related conversations and suggest how to organize them"
Communication
- "Monitor specific chat for updates about [topic]"
- "Draft a polite response to the last message in [chat]"
- "Check if there are any unanswered questions in my chats"
Installation
Homebrew
You can install a binary release on macOS/Linux using brew:
# Install
brew install chaindead/tap/telegram-mcp
# Update
brew upgrade chaindead/tap/telegram-mcpNPX
You can run the latest version directly using npx (supports macOS, Linux, and Windows):
npx -y @chaindead/telegram-mcpWhen using NPX, modify the standard commands and configuration as follows:
- Authentication command becomes:
npx -y @chaindead/telegram-mcp auth ...- Claude MCP server configuration becomes:
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "@chaindead/telegram-mcp"],
"env": {
"TG_APP_ID": "",
"TG_API_HASH": ""
}
}
}
}For complete setup instructions, see Authorization and Client Configuration.
From Releases
MacOS
> Note: The commands below install to `/usr/local/bin`. To install elsewhere, replace `/usr/local/bin` with your preferred directory in your PATH.
First, download the archive for your architecture:
# For Intel Mac (x86_64)
curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_x86_64.tar.gz
# For Apple Silicon (M1/M2)
curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Darwin_arm64.tar.gzThen install the binary:
# Extract the binary
sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin
# Make it executable
sudo chmod +x /usr/local/bin/telegram-mcp
# Clean up
rm telegram-mcp.tar.gzLinux
> Note: The commands below install to `/usr/local/bin`. To install elsewhere, replace `/usr/local/bin` with your preferred directory in your PATH.
First, download the archive for your architecture:
# For x86_64 (64-bit)
curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_x86_64.tar.gz
# For ARM64
curl -L -o telegram-mcp.tar.gz https://github.com/chaindead/telegram-mcp/releases/latest/download/telegram-mcp_Linux_arm64.tar.gzThen install the binary:
# Extract the binary
sudo tar xzf telegram-mcp.tar.gz -C /usr/local/bin
# Make it executable
sudo chmod +x /usr/local/bin/telegram-mcp
# Clean up
rm telegram-mcp.tar.gzWindows
Windows
1. Download the latest release for your architecture:
2. Extract the `.zip` file
3. Add the extracted directory to your PATH or move `telegram-mcp.exe` to a directory in your PATH
From Source
Requirements:
- Go 1.24 or later
- GOBIN in PATH
go install github.com/chaindead/telegram-mcp@latestConfiguration
Authorization
Before you can use the server, you need to connect to the Telegram API.
1. Get the API ID and hash from Telegram API
2. Run the following command:
> __Note:__
> If you have 2FA enabled: add --password
> __Note:__
> If you want to override existing session: add --new
telegram-mcp auth --app-id --api-hash --phone📩 Enter the code you received from Telegram to connect to the API.
3. Done! Please give this project a ⭐️ to support its development.
Client Configuration
Example of Configuring Claude Desktop to recognize the Telegram MCP server.
1. Open the Claude Desktop configuration file:
> __Note:__
> You can also find claude_desktop_config.json inside the settings of Claude Desktop app
2. Add the server configuration
for Claude desktop:
{
"mcpServers": {
"telegram": {
"command": "telegram-mcp",
"env": {
"TG_APP_ID": "",
"TG_API_HASH": "",
"PATH": "",
"HOME": "",
"TG_API_HASH": ""
}
}
}
}JSON Schema Version
Some MCP clients (e.g. VS Code) do not support JSON Schema Draft 2020-12 and will reject tools that use it. You can override the JSON Schema version by setting the `--schema-version` flag or the `TG_SCHEMA_VERSION` environment variable.
Common values:
| Version | URL |
|---|---|
| Draft-07 (recommended for VS Code) | `https://json-schema.org/draft-07/schema#` |
| Draft 2020-12 (default) | `https://json-schema.org/draft/2020-12/schema` |
Star History
Frequently asked questions
What is telegram-mcp?
telegram-mcp is Telegram MCP for managing dialogs, messages, drafts, read statuses, and more.
How do I install telegram-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is telegram-mcp open source?
Yes — it is hosted on GitHub at https://github.com/chaindead/telegram-mcp and has 346 stars.
Related MCP tools
The missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what's broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffic, and cluster audits - all in one Go binary.
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
One place to manage & connect to all your MCP servers
eBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®. This MCP server for MATLAB supports a wide range of coding agents like Claude Code® and Visual Studio® Code.
A command-line interface for interacting with MCP (Model Context Protocol) servers using both stdio and HTTP transport. Go-based implementation.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP