# claude-ops-telegram-server

Connects a personal Telegram account to your coding agent via MTProto. Lets assistants read private direct messages, search conversation history, and send replies.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 545
- Author: Lifecycle-Innovations-Limited
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Lifecycle-Innovations-Limited/claude-ops/tree/HEAD/claude-ops/telegram-server
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/claude-ops-telegram-server

## What it does

The server relies on `gram.js` and user-level MTProto authentication instead of BotFather bots. Bots cannot inspect private direct messages between two people. By authenticating as a user, the assistant gains access to personal DMs, groups, and channels. It provides four tools: `list_dialogs`, `get_messages`, `send_message`, and `search_messages`.

Setting this up requires an `api_id` and `api_hash` from `https://my.telegram.org/apps`. You must run an initial interactive authentication step to verify SMS codes and 2FA, which generates the `TELEGRAM_SESSION` string.

Treat `TELEGRAM_SESSION` like a raw password and keep it out of version control. If you trigger Telegram account limits during frequent queries, expect a temporary cooldown lasting 15 to 30 minutes.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `TELEGRAM_API_ID`, `TELEGRAM_API_HASH`, `TELEGRAM_PHONE`, `TELEGRAM_SESSION` — 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 claude-ops-telegram-server -e TELEGRAM_API_ID=<TELEGRAM_API_ID> -e TELEGRAM_API_HASH=<TELEGRAM_API_HASH> -e TELEGRAM_PHONE=<TELEGRAM_PHONE> -e TELEGRAM_SESSION=<TELEGRAM_SESSION> -- npx -y claude-ops-telegram-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add telegram-server --env TELEGRAM_API_ID=<TELEGRAM_API_ID> --env TELEGRAM_API_HASH=<TELEGRAM_API_HASH> --env TELEGRAM_PHONE=<TELEGRAM_PHONE> --env TELEGRAM_SESSION=<TELEGRAM_SESSION> -- npx -y claude-ops-telegram-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "telegram-server": {
            "command": "npx",
            "args": [
                "-y",
                "claude-ops-telegram-server"
            ],
            "env": {
                "TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
                "TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>",
                "TELEGRAM_PHONE": "<TELEGRAM_PHONE>",
                "TELEGRAM_SESSION": "<TELEGRAM_SESSION>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "telegram-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "claude-ops-telegram-server"
            ],
            "env": {
                "TELEGRAM_API_ID": "<TELEGRAM_API_ID>",
                "TELEGRAM_API_HASH": "<TELEGRAM_API_HASH>",
                "TELEGRAM_PHONE": "<TELEGRAM_PHONE>",
                "TELEGRAM_SESSION": "<TELEGRAM_SESSION>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TELEGRAM_API_ID=<TELEGRAM_API_ID> -e TELEGRAM_API_HASH=<TELEGRAM_API_HASH> -e TELEGRAM_PHONE=<TELEGRAM_PHONE> -e TELEGRAM_SESSION=<TELEGRAM_SESSION> telegram-server npx -y claude-ops-telegram-server
```
Replace <…> with your own values

## When to use it
- inspect private Telegram direct messages inside development workflows
- run full-text message search across all active chats
- review recent conversations alongside unread counters
- post replies or channel updates directly from a personal profile

## Example prompts
- Check recent unread direct messages using list_dialogs.
- Search for messages mentioning 'deployment issue' across all Telegram chats.
- Send a confirmation message to a contact using send_message.

## Similar
- [Notify MCP Server](https://affpapa.org/en/nevibecode/mcp/notify-mcp-server.md) — MCP server · ★ 28

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