Telegram Archive

io.github.GeiserX由 GitHub 账号 GeiserX 发布v0.4.1更新于 Oct 29, 2026

Search and read your archived Telegram chats and messages

已验证STDIO仅桌面知识与记忆沟通与协作

概览

AI 生成的概览

一个 MCP 服务器,让助手搜索、浏览并阅读自建 Telegram-Archive 实例中归档的 Telegram 聊天与消息。

可以做什么
  • 列出聊天与文件夹,可按名称、归档状态或文件夹筛选
  • 在所有聊天中或单个聊天、论坛话题内搜索消息文本
  • 分页读取聊天、按指定时区读取某一天的消息,或读取某条消息前后的上下文
  • 列出论坛话题、置顶消息以及单个聊天的消息与媒体统计
  • 把消息附带的图片作为模型可查看的图像返回
适用场景
适合已经运行 Telegram-Archive 查看器、希望助手在已保存的 Telegram 历史中查找内容的人:检索过往消息、总结某个聊天或某一天、查看某条消息的上下文。
运行要求
通过 npx 或 Docker 以 stdio 在本地运行。需要一个可访问的 Telegram-Archive 实例地址(TELEGRAM_ARCHIVE_URL),以及查看器登录凭据 TELEGRAM_ARCHIVE_USER 和 TELEGRAM_ARCHIVE_PASS。npm 包首次启动时会下载发布二进制并按随包发布的校验和进行校验。
安装前请注意
服务器使用查看器用户名和密码登录你的归档,因此 TELEGRAM_ARCHIVE_PASS 应作为密钥保存,不要明文写入配置。除 refresh_stats 外所有工具均为只读,该工具会让查看器重新计算全归档统计,可用 READ_ONLY 隐藏它。归档中的消息内容和媒体会传给模型。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Telegram Archive,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[telegram-archive-mcp]

telegram-archive-mcp

[npm] [CI] [License] [Docker Pulls] [codecov]

An MCP server for any Telegram-Archive instance. LLMs use it to search messages, browse chats and read archived Telegram history.

Features

  • Speaks MCP 2026-07-28 and every earlier revision down to 2024-11-05 on stdio and Streamable HTTP. Clients that still use the initialize handshake work unchanged.
  • Search one chat or every chat at once, read a chat page by page, one calendar day in your timezone, or the conversation around one message.
  • Forum topics, pinned messages, folders and per-chat statistics.
  • The photo attached to a message, returned as an image the model can look at and scaled to 1568 pixels when larger (get_media).
  • Every tool is read-only except refresh_stats; READ_ONLY=1 hides that one too.
  • Signs in to Telegram-Archive through /api/login with TELEGRAM_ARCHIVE_USER and TELEGRAM_ARCHIVE_PASS.
  • HTTP listens on loopback by default, checks Origin, caps request bodies, and requires MCP_AUTH_TOKEN on any other address.
  • Ships as an npm package, a Docker image and multi-arch Go binaries.

Install

Every client below runs the server over stdio. Set the URL, user and password of your Telegram-Archive viewer.

Claude Code

sh
claude mcp add --env TELEGRAM_ARCHIVE_URL=http://localhost:8000 \  --env TELEGRAM_ARCHIVE_USER=admin --env TELEGRAM_ARCHIVE_PASS=your-viewer-password \  --transport stdio telegram-archive -- npx -y telegram-archive-mcp

Claude Desktop (claude_desktop_config.json) and Cursor (~/.cursor/mcp.json)

json
{  "mcpServers": {    "telegram-archive": {      "command": "npx",      "args": ["-y", "telegram-archive-mcp"],      "env": {        "TELEGRAM_ARCHIVE_URL": "http://localhost:8000",        "TELEGRAM_ARCHIVE_USER": "admin",        "TELEGRAM_ARCHIVE_PASS": "your-viewer-password"      }    }  }}

VS Code (.vscode/mcp.json, asks for the password once)

json
{  "inputs": [    { "type": "promptString", "id": "tg-pass", "description": "Telegram-Archive viewer password", "password": true }  ],  "servers": {    "telegram-archive": {      "type": "stdio",      "command": "npx",      "args": ["-y", "telegram-archive-mcp"],      "env": {        "TELEGRAM_ARCHIVE_URL": "http://localhost:8000",        "TELEGRAM_ARCHIVE_USER": "admin",        "TELEGRAM_ARCHIVE_PASS": "${input:tg-pass}"      }    }  }}

Codex (~/.codex/config.toml)

toml
[mcp_servers.telegram-archive]command = "npx"args = ["-y", "telegram-archive-mcp"]env = { TELEGRAM_ARCHIVE_URL = "http://localhost:8000", TELEGRAM_ARCHIVE_USER = "admin", TELEGRAM_ARCHIVE_PASS = "your-viewer-password" }

Docker, for any client above: use docker as the command with these arguments, and a release tag from the releases page, never latest:

sh
docker run -i --rm -e TELEGRAM_ARCHIVE_URL -e TELEGRAM_ARCHIVE_USER -e TELEGRAM_ARCHIVE_PASS drumsergio/telegram-archive-mcp:vX.Y.Z

The npm package downloads the release binary on first start and checks it against the checksums published with the package, so it also works with npm 12, which skips install scripts. A long-running HTTP server (Docker Compose) and local builds are in Getting started.

Tools

ToolWhat it does
list_chatsLists chats, most recent first; filter by search (name), archived or folder_id. Each chat's ref is the chat_id the other tools take.
list_foldersLists your Telegram folders and their ids.
search_all_chatsSearches message text in every chat at once.
search_messagesSearches one chat, optionally one forum topic.
get_messagesReads a chat newest first, by offset or keyset cursor, optionally one forum topic.
get_message_contextReturns one message with the messages before and after it.
get_messages_by_dateReturns every message of one calendar day in a timezone.
get_pinned_messagesReturns a chat's pinned messages.
get_topicsLists a forum group's topics; their ids feed topic_id.
get_chat_statsMessage and media counts and size of one chat.
get_mediaThe photo attached to a message, as an image, or the file's details.
refresh_statsMakes the viewer recalculate archive-wide statistics. Hidden with READ_ONLY=1.

Every tool returns structured content with an output schema, alongside the same JSON as text. Arguments and defaults are on Usage.

Documentation

The full documentation is at geiserx.github.io/telegram-archive-mcp.

  • Getting started: npm, Docker Compose, local build
  • Configuration: environment variables and client configuration
  • Usage: the 4 resources and 12 tools, paging, reading one day at a time
  • Development: testing, contributing, credits
  • Related projects: Telegram Archive, other MCP servers, where this one is listed

License

GPL-3.0-or-later

来源:README.md,提交 2a8f863

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

5
  1. v0.4.1最新Oct 29, 2026
  2. v0.3.1Oct 21, 2026
  3. v0.3.0Oct 16, 2026
  4. v0.1.3Oct 5, 2026
  5. v0.0.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分