Telegram MCP for managing dialogs, messages, drafts, read statuses, and more.

What is chaindead telegram mcp

** ** *License: MIT* *Visitors*

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

  • Get current account information (tool: tg_me)
  • List dialogs with optional unread filter (tool: tg_dialogs)
  • Mark dialog as read (tool: tg_read)
  • Retrieve messages from specific dialog (tool: tg_dialog)
  • 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-mcp

NPX

You can run the latest version directly using npx (supports macOS, Linux, and Windows):

npx -y @chaindead/telegram-mcp

When using NPX, modify the standard commands and configuration as follows:

npx -y @chaindead/telegram-mcp auth ...
{
  "mcpServers": {
    "telegram": {
      "command": "npx",
      "args": ["-y", "@chaindead/telegram-mcp"],
      "env": {
        "TG_APP_ID": "<your-api-id>",
        "TG_API_HASH": "<your-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.gz

Then 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.gz

Linux

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.gz

Then 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.gz

Windows

Windows

  1. Download the latest release for your architecture:
    • Windows x64
    • Windows ARM64
  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@latest

Configuration

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 <2fa_password>

    Note: If you want to override existing session: add --new

    telegram-mcp auth --app-id <your-api-id> --api-hash <your-api-hash> --phone <your-phone-number>
    

    📩 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:

    • in MacOS, the configuration file is located at ~/Library/Application Support/Claude/claude_desktop_config.json
    • in 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

  2. Add the server configuration

    for Claude desktop:

     {
       "mcpServers": {
         "telegram": {
           "command": "telegram-mcp",
           "env": {
             "TG_APP_ID": "<your-app-id>",
             "TG_API_HASH": "<your-api-hash>",
             "PATH": "<path_to_telegram-mcp_binary_dir>",
             "HOME": "<path_to_your_home_directory"
           }
         }
       }
     }
    

    for Cursor:

    {
      "mcpServers": {
        "telegram-mcp": {
          "command": "telegram-mcp",
          "env": {
            "TG_APP_ID": "<your-app-id>",
            "TG_API_HASH": "<your-api-hash>"
          }
        }
      }
    }
    

Star History

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)

mcp
zhixiaoqiang antd components mcp avatar

zhixiaoqiang antd components mcp

An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询

designantdapi

Submit Your MCP Server

Share your MCP server with the community

Submit Now