# telegram-archive-mcp

Connects language models to a Telegram-Archive deployment to search message history, inspect forum topics, and retrieve attached pictures.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7
- Author: GeiserX
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/GeiserX/telegram-archive-mcp
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/telegram-archive-mcp

## What it does

The server links your assistant to a self-hosted Telegram-Archive instance through its `/api/login` endpoint. It exposes read-only data resources such as `telegram-archive://stats` and `telegram-archive://chats`, letting models inspect folders, chat metadata, and health state without modifying any records.

Querying tools handle cursor-based message paging, pinned entries, forum topics, and day-by-day extractions via `get_messages_by_date` with timezone offsets. When entries contain photos, the `get_media` tool serves them directly to multimodal models, downscaling images wider than 1568 pixels.

You need an active Telegram-Archive viewer running beforehand, as the server cannot work without a valid `TELEGRAM_ARCHIVE_URL` and login credentials.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `TELEGRAM_ARCHIVE_URL`, `TELEGRAM_ARCHIVE_USER`, `TELEGRAM_ARCHIVE_PASS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env TELEGRAM_ARCHIVE_URL=<TELEGRAM_ARCHIVE_URL> --env TELEGRAM_ARCHIVE_USER=<TELEGRAM_ARCHIVE_USER> --env TELEGRAM_ARCHIVE_PASS=<TELEGRAM_ARCHIVE_PASS> --transport stdio telegram-archive-mcp -- npx -y telegram-archive-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add telegram-archive-mcp --env TELEGRAM_ARCHIVE_URL=<TELEGRAM_ARCHIVE_URL> --env TELEGRAM_ARCHIVE_USER=<TELEGRAM_ARCHIVE_USER> --env TELEGRAM_ARCHIVE_PASS=<TELEGRAM_ARCHIVE_PASS> -- npx -y telegram-archive-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "telegram-archive-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "telegram-archive-mcp"
            ],
            "env": {
                "TELEGRAM_ARCHIVE_URL": "<TELEGRAM_ARCHIVE_URL>",
                "TELEGRAM_ARCHIVE_USER": "<TELEGRAM_ARCHIVE_USER>",
                "TELEGRAM_ARCHIVE_PASS": "<TELEGRAM_ARCHIVE_PASS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "telegram-archive-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "telegram-archive-mcp"
            ],
            "env": {
                "TELEGRAM_ARCHIVE_URL": "<TELEGRAM_ARCHIVE_URL>",
                "TELEGRAM_ARCHIVE_USER": "<TELEGRAM_ARCHIVE_USER>",
                "TELEGRAM_ARCHIVE_PASS": "<TELEGRAM_ARCHIVE_PASS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TELEGRAM_ARCHIVE_URL=<TELEGRAM_ARCHIVE_URL> -e TELEGRAM_ARCHIVE_USER=<TELEGRAM_ARCHIVE_USER> -e TELEGRAM_ARCHIVE_PASS=<TELEGRAM_ARCHIVE_PASS> telegram-archive-mcp npx -y telegram-archive-mcp
```
Replace <…> with your own values

## When to use it
- query past Telegram discussions across archived channels
- fetch chat logs for a selected calendar date and timezone
- retrieve resized image attachments for multimodal analysis
- inspect forum topics and pinned messages inside archived groups

## Example prompts
- Check telegram-archive://chats and list all available discussion groups
- Collect chat entries from yesterday using get_messages_by_date for UTC
- Retrieve the photo attached to message 105 via get_media and explain what is depicted

## Similar
- [claude-ops-telegram-server](https://affpapa.org/en/nevibecode/mcp/claude-ops-telegram-server.md) — MCP server · ★ 547
- [Notify MCP Server](https://affpapa.org/en/nevibecode/mcp/notify-mcp-server.md) — MCP server · ★ 29
- [TONNode — TON blockchain access](https://affpapa.org/en/nevibecode/mcp/tonnode-ton-blockchain-access.md) — MCP server · ★ 27
- [telegram-mcp](https://affpapa.org/en/nevibecode/mcp/telegram-mcp.md) — MCP server · ★ 7

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
