MCP.so
登录

Telegram MCP Server

@chigwell

基本信息

分类

沟通协作

许可证

Apache-2.0

传输方式

stdio

作者

chigwell

关于 Telegram MCP Server

Telegram MCP server powered by Telethon to let MCP clients read chats, manage groups, and send/modify messages, media, contacts, and settings.

Telegram MCP Server 配置

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

{
  "mcpServers": {
    "telegram-mcp": {
      "command": "uv",
      "args": [
        "sync"
      ]
    }
  }
}

Telegram MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Telegram MCP Server?

Telegram MCP Server is a Telegram integration for Claude, Cursor, and other MCP-compatible clients. It exposes Telegram account, chat, message, contact, media, folder, and admin operations through the Model Context Protocol (MCP) using Telethon.

How to use Telegram MCP Server?

Clone the repository, install dependencies with uv sync, generate a session string using uv run session_string_generator.py, configure environment variables in .env, and run with uv run main.py. For Claude Desktop or Cursor, point the MCP server at the cloned checkout and supply TELEGRAM_API_ID, TELEGRAM_API_HASH, and TELEGRAM_SESSION_STRING in the server’s env block. Docker is also supported.

Key features of Telegram MCP Server

  • 80+ MCP tools for accounts, chats, messages, contacts, media, profile, folders, and drafts
  • Multi‑account support with per‑account session strings and labels
  • Read‑only mode to restrict tool exposure via TELEGRAM_EXPOSED_TOOLS
  • Proxy support (SOCKS5, SOCKS4, HTTP, MTProxy) with per‑account overrides
  • File path security with allowed roots and strict validation
  • Docker deployment with Compose or direct commands

Use cases of Telegram MCP Server

  • Let an AI assistant send, schedule, edit, or delete Telegram messages
  • Analyze chat history and have the assistant reply based on context
  • Manage multiple Telegram accounts from a single MCP client
  • Automate group/channel creation, member invitations, and admin actions
  • Download or upload media, send voice notes, stickers, and GIFs programmatically

常见问题

1

What are the requirements to run Telegram MCP Server?

Python 3.10+, Telegram API credentials from my.telegram.org/apps, a Telegram session string or file‑based session, and an MCP‑compatible client such as Claude Desktop or Cursor.

2

How do I enable read‑only mode?

Set the environment variable `TELEGRAM_EXPOSED_TOOLS=read-only` in the server configuration. This exposes only tools annotated with `readOnlyHint=True`; it does not reduce the Telegram session’s account permissions.

3

Can I use multiple Telegram accounts?

Yes. Use suffixed session variables such as `TELEGRAM_SESSION_STRING_WORK` and `TELEGRAM_SESSION_STRING_PERSONAL`. Labels become the `account` parameter in tools. Write tools require an account label; read‑only tools fan out to all accounts when omitted.

4

Does Telegram MCP Server support proxies?

Yes. Set `TELEGRAM_PROXY_TYPE`, `TELEGRAM_PROXY_HOST`, `TELEGRAM_PROXY_PORT` (and optional username/password). Supported types: socks5, socks4, http, mtproxy. Per‑account overrides use the same suffix as session variables.

5

How are file paths secured?

File‑path tools are disabled until allowed roots are configured, either as CLI arguments or via MCP client Roots. Paths are resolved to real paths and must stay inside an allowed root; traversal, wildcard, and null‑byte patterns are rejected.

评论

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