Local-first TDLib Telegram MCP server with 110 tools, account isolation and production guardrails.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Telegram MCP for real accounts β safe by default, TDLib-powered, production-ready.
A local-first Model Context Protocol server that gives
an AI agent real Telegram-account access without handing it the keys to your account. It
starts read-only, hides write tools until you opt in, and runs over STDIO for desktop
clients or Streamable HTTP at /mcp for managed deployments.
inbox/reader profile;
write and quota-consuming tools are hidden from the model, not merely blocked, until you
turn them on.The image is an illustrative mockup; a real screencast is on the way.
Runtime-inclusive releases need no JDK, Gradle, Git, Python, or Node.js. Use a test account for your first run if you can.
1. Install (macOS Apple silicon / Linux with Homebrew):
Windows with Scoop:
2. Log in with a QR scan β the one-time code never touches your shell history:
3. Check the session is ready β this reads local state and starts no server:
Do not run serve --transport stdio yourself to try it out. With STDIO your AI
client starts the server and owns its lifetime; a copy you launched in a terminal
holds the TDLib session, and the client's own copy then exits with code 2 because
it cannot lock td.binlog. Give the command to the client instead (below) and let
it do the starting.
Then try a first prompt that cannot change anything:
βSummarize my last 20 conversations. Do not send or modify anything.β
In this mode write and quota-consuming tools are absent from the tool list entirely, so the
model has nothing destructive to call. Switch to MCP_READ_ONLY=false only after you have
reviewed the surface. When you do, add MCP_DESTRUCTIVE_APPROVAL=auto so deletes, bans and
leaves wait for your answer through host elicitation where available, or through the
server's loopback page otherwise, rather than trusting the model's own "confirmed": true.
Generate the entry instead of transcribing one β it fills in the key your client actually expects and pins the version it was generated from:
--client claude-code|cursor|vscode|codex switches target β Codex gets TOML, VS
Code gets the servers key it actually reads, Claude Code gets the explicit
transport type. --writes enables write tools and the approval prompt that
guards the destructive ones β pair it with a write-capable
--profile inbox|community-admin|all, since the default reader surface hides
write tools before read-only mode is consulted. --docker default emits a container entry with a
pinned image, and --http default emits the shared-daemon entry for Claude Code,
Cursor, VS Code, or Codex. Claude Desktop does not read remote servers from
claude_desktop_config.json; add a network-reachable remote endpoint under
Settings β Connectors instead. Claude remote connectors do not accept the
generator's custom API-key header, so this server must be exposed over HTTPS
with MCP_AUTH_MODE=oauth. The generator therefore rejects
--client claude --http.
STDIO is the low-friction path for desktop clients. The generated entry looks like:
claude_desktop_config.json, then quit the app
from the tray and start it again. Use Settings β Developer β Edit Config to open the file:
it points at the right copy for your build. Editing %APPDATA%\Claude by hand works only
for the installer build β the Microsoft Store build is packaged as MSIX and keeps its config
in %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\ instead.~/.cursor/mcp.json (or Settings β MCP β Add)..vscode/mcp.json; VS Code names the top-level key servers
instead of mcpServers and requires an explicit "type": "stdio" or
"type": "http".For a managed HTTP deployment instead of STDIO:
See CLI and STDIO, interactive authentication, and client compatibility for exact platform/client variants.
Copy-paste configurations and prompts for real tasks, each with the smallest tool surface that can do the job: summarize your inbox, find a lost message, research public groups, read-only community health check, and draft replies without sending β index in docs/recipes.
Most Telegram MCP servers wrap the Bot API or a Telethon user session and expose every capability to the model at once. This project optimizes for connecting an agent to a real account you care about, safely:
| Dimension | This server | Typical Telethon / Bot-API MCP servers |
|---|---|---|
| Account access | Real user account via TDLib (tdlight-java) | Often bot-only, or a single Telethon user session |
| Default posture | Read-only; write/quota tools hidden until enabled | Usually all tools exposed from the start |
| Multi-account | Isolated sessions, mandatory selection, scoped keys, no cross-account read fan-out | Single account, or implicit fan-out |
| Transports | STDIO and Streamable HTTP /mcp | Usually STDIO only |
| Guardrails | Confirmation gating, audit log, anti-spam limits, chat allow-list, untrusted-content marking | Minimal |
| Distribution | Signed runtime bundles (no JDK), SBOM + provenance, GHCR image | Source install via pip/npx |
A fuller architectural comparison (TDLib vs Telethon vs Bot API, and why "hidden, not blocked" matters) is in docs/COMPARISON.md. The detailed, dated benchmark against the leading public servers β including features deliberately declined (raw MTProto escape hatch, ownership transfer, bulk contact export) β is in PUBLIC_BENCHMARK_AND_ROADMAP.md.
You don't expose 110 tools on day one. MCP_TOOL_PROFILE narrows the advertised surface
before a client ever sees it, without weakening account scoping, read-only mode,
confirmation, audit, or anti-spam:
| Profile | Surface |
|---|---|
reader | Always non-mutating β safe for a first look |
inbox | Personal messages, drafts, media, contacts, privacy |
community-admin | Moderation, group/channel, permissions, bot commands |
research | Bounded account/public discovery and reading |
all | The full inventory (opt in deliberately) |
See TOOL_PROFILES.md for the exact intent of each surface.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/telegram-mcp-server)<a href="https://allmcps.com/mcp/telegram-mcp-server"><img src="https://allmcps.com/api/badge/telegram-mcp-server?style=directory" alt="Telegram MCP Server on AllMCPs" /></a>