Secure Telegram MCP logo

Secure Telegram MCP

Scopes Telegram access per MCP endpoint with encrypted sessions, API keys, folder ACLs, and read-only defaults.

Install Secure Telegram MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "secure-telegram-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "secure-telegram-mcp"
      ],
      "env": {
        "TELEGRAM_MCP_ENDPOINT_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

secure-telegram-mcp connects MCP clients to Telegram through endpoint-specific API keys and scoped account access. It stores Telegram sessions and policy encrypted, rechecks permissions on every tool call, and can require human confirmation before writes. Use it when different AI clients need separate access to chats, folders, or accounts without exposing a full Telegram session. The service runs through Node.js and can be connected from clients such as Claude, Cursor, Claude Code, and VS Code.

Use cases

  • 隔離 work and personal Telegram access across separate AI clients
  • Grant an agent read-only access to selected Telegram folders
  • Allow controlled message sending with per-endpoint permissions
  • Connect multiple Telegram accounts through separate endpoints
  • Require human approval before an MCP client writes to Telegram

Key features

  • Per-endpoint API keys with folder, chat, and channel scoping
  • AES-256-GCM encrypted Telegram sessions and policy
  • Execution-time permission checks with fail-closed writes
  • Read-only defaults and optional MCP elicitation confirmations
  • Per-account pacing and saturation circuit breaker
  • Two-phase, confined media upload workflow

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

9/9 checks healthy over the last 32d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 1d ago via OSV.dev · secure-telegram-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads1kPackage downloads in the last 30 days.
Last commit25d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Secure Telegram MCP works

What secure-telegram-mcp does

secure-telegram-mcp exposes selected Telegram operations as MCP tools while keeping each client behind its own endpoint. An endpoint is tied to one logged-in Telegram account and can be limited to chosen chats, folders, or channels. Access can be read-only or can include individually enabled write permissions.

The design separates client credentials from Telegram credentials. MCP clients receive an endpoint token, while the local service owns the Telegram session and policy. Clients without a valid endpoint key can discover the tool list but cannot use it to access Telegram data.

Sessions and policy are encrypted at rest with AES-256-GCM and keys protected through scrypt. Unlocking can use machine-bound protection, a PIN, or a recovery keyfile. Only salted endpoint-key hashes are stored. A single Telegram account can serve multiple endpoints through one background connection.

How it works

Run the setup command to provide Telegram app credentials, authenticate with a QR code or phone login, choose a session name, and create an endpoint. The endpoint picker assigns read or write permissions to selected chats and folders. Setup prints the endpoint token once in an MCP client configuration block.

Clients connect with the connect command and the TELEGRAM_MCP_ENDPOINT_TOKEN environment variable. The token identifies and authorizes the endpoint; client configuration does not need the Telegram api_id, api_hash, or PIN. When PIN protection is enabled, unlock the service separately with the start command so clients never handle the PIN.

Every tool call checks the current endpoint policy and token. Write requests pass access control, optional confirmation, quota, and audit stages in sequence. Rotating an endpoint key revokes access for live connections. Telegram text is sanitized and length-limited before being returned to the model, and writes, denials, and media egress are recorded in append-only NDJSON logs.

Setup and configuration

Node.js 20.10 or newer and Telegram api_id and api_hash from my.telegram.org/apps are required. Start setup with:

Terminal
npx -y secure-telegram-mcp setup

Choose QR login or phone-number authentication; two-step verification is handled during setup when enabled on the account. After creating an endpoint, place its token in one MCP client configuration. Combining multiple endpoint entries in one client gives that client the combined scopes.

For a typical stdio configuration:

config.json
{
  "mcpServers": {
    "telegram": {
      "command": "npx",
      "args": ["-y", "secure-telegram-mcp", "connect"],
      "env": {
        "TELEGRAM_MCP_ENDPOINT_TOKEN": "tgmcp_..."
      }
    }
  }
}

Tools and capabilities

The server provides 18 tools organized around eight permission verbs:

  • Read Telegram data with get_messages, search_messages, list_dialogs, list_topics, get_chat_info, get_media_info, get_pinned_messages, and list_participants.
  • Download media with download_media, which uses a strict size limit and a server-selected destination.
  • Send and edit content with send_message, edit_message, prepare_media, and send_media.
  • Manage drafts, messages, read state, reactions, and forwarding with save_draft, delete_message, mark_read, send_reaction, and forward_message.

Forwarding requires read access to the source chat and forward permission on the destination. Sending local media uses two steps: prepare_media creates an expiring opaque handle for a file under the confined media root, and send_media consumes that handle.

Per-account token buckets pace messages, forwards, and searches, while a circuit breaker backs off the account when saturation is detected. These controls reduce flood-limit risk but cannot guarantee that Telegram will not impose a ban. Human confirmation can be enabled per endpoint for clients supporting MCP elicitation; unsupported clients fail closed rather than silently allowing writes.

Limitations and notes

The service intentionally provides no raw MTProto invoke tool and does not let a model alter its own scope. Endpoint scope therefore must be changed outside the model-accessible tool surface. A forgotten PIN cannot be recovered. The endpoint key is printed only once during setup, so it must be copied before closing the setup terminal.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Secure Telegram MCP

secure-telegram-mcp is an MCP server that connects AI clients to Telegram through scoped endpoint API keys. Its main tools read messages, search chats, list dialogs, inspect chat data, download media, send or edit messages, manage drafts, mark messages read, react, forward content, and send prepared media under endpoint permissions.

Run `npx -y secure-telegram-mcp setup` with Node.js 20.10 or newer and Telegram `api_id` and `api_hash` credentials. Setup authenticates the account, creates an endpoint, selects its scope, and prints a one-time token for the client configuration.

Configure an MCP stdio server that runs `npx -y secure-telegram-mcp connect` and set `TELEGRAM_MCP_ENDPOINT_TOKEN` to the token printed by setup. The client does not need Telegram app credentials or the service PIN.

Yes. Cursor can use the generated MCP configuration or its installation link after setup, provided you replace the placeholder with the endpoint token. Each Cursor configuration should receive only the endpoint scope intended for that client.

Yes. Endpoints can be created with read permissions only, and write permissions are opt-in per endpoint. The server rechecks permissions during every call, so tool discovery does not grant authority to write or reach out-of-scope chats.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSecure Telegram MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/secure-telegram-mcp?style=directory)](https://allmcps.com/mcp/secure-telegram-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/secure-telegram-mcp"><img src="https://allmcps.com/api/badge/secure-telegram-mcp?style=directory" alt="Secure Telegram MCP on AllMCPs" /></a>