MCP.so
登录

Telegram MCP Server

@kdoronin

基本信息

分类

沟通协作

传输方式

stdio

作者

kdoronin

提交者

Konstantin

关于 Telegram MCP Server

暂无概览

Telegram MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "Telegram": {
      "command": "node",
      "args": [
        "/Users/dka/Documents/Solo/git/telegram_mcp/mcp-server.js"
      ]
    }
  }
}

Telegram MCP Server 工具

4

Gets a list of user dialogs (chats).

Gets messages from the specified chat.

Sends a message to the specified chat.

Executes an arbitrary Telegram API method (use with caution).

概览

What is Telegram?

Telegram is an MCP (Model Context Protocol) server that enables AI agents and other MCP clients to interact with the Telegram messaging platform. It provides a bridge between the Telegram API and MCP-compatible tools, allowing automated reading of dialogs and messages, sending messages, and executing arbitrary Telegram methods using a user’s Telegram account.

How to use Telegram?

To use Telegram, clone the repository, install dependencies with npm install, create a .env file with your API_ID and API_HASH from my.telegram.org, and run the server with npm run mcp or node mcp-server.js. The server can then be configured in MCP clients such as Cursor or Claude Desktop by pointing to the server’s command (e.g., node /full/path/to/project/mcp-server.js). On first use, the server prompts for a phone number and a confirmation code (and a 2FA password if enabled).

Key features of Telegram

  • Reads dialogs and messages from your Telegram account.
  • Sends messages to any chat or user.
  • Executes arbitrary Telegram API methods via executeMethod.
  • Saves authenticated sessions locally for reuse.
  • Supports two-factor authentication (2FA).
  • Integrates easily with MCP clients like Cursor and Claude Desktop.

Use cases of Telegram

  • An AI assistant fetching recent chats and sending replies on a user’s behalf.
  • Automated message broadcasting to a Telegram channel or group.
  • Retrieving message history for analysis or logging.
  • Executing custom Telegram API calls to manage contacts, groups, or bots.
  • Building conversational agents that operate through Telegram.

常见问题

1

What are the requirements to run Telegram?

You need Node.js 14+ (or higher), npm, a Telegram API ID and API Hash obtained from [my.telegram.org](https://my.telegram.org), and a Telegram account for authentication.

2

How are sessions stored?

Sessions are saved as JSON files inside the `sessions/` directory, named after the phone number (e.g., `+79001234567.json`). Each file contains an encrypted authorization token and a timestamp.

3

What happens during first-time authorization?

The server asks for the phone number, then a confirmation code sent by Telegram. If two-factor authentication is enabled, the password is requested (up to 3 retries). Successful authorization saves the session for future use.

4

Can I use arbitrary Telegram API methods?

Yes, the `executeMethod` tool allows executing any Telegram API method. Use it with caution as it can perform destructive actions.

5

What authentication does Telegram support?

The server uses the user’s phone number and confirmation code for initial auth, and supports two-factor authentication (2FA) passwords when enabled. Multi‑session handling is supported via the `session` parameter (the phone number).

评论

沟通协作 分类下的更多 MCP 服务器