telegram-mcp

telegram-mcp

Enables use of a personal Telegram account within MCP clients for reading and sending messages, searching chats, and managing media, all running locally.

Category
Visit Server

README

telegram-mcp

Your Telegram account in an MCP client. Signs in as you, not as a bot: it reads your private chats, and anything it sends comes from you.

Install

Node 22+.

  1. Get API keys: my.telegram.org → API development tools → create an app (platform Other, rest blank) → copy api_id and api_hash.

  2. Sign in — once, in a terminal:

    TELEGRAM_API_ID=... TELEGRAM_API_HASH=... npx @vkruglikov/telegram-mcp login
    

    It asks for your phone, the code Telegram sends, and your 2FA password if you have one. This is a terminal command and not a tool on purpose — as a tool, the code and the password would pass through the model's context and land in chat logs.

  3. Register the server:

    claude mcp add telegram \
      --env TELEGRAM_API_ID=... \
      --env TELEGRAM_API_HASH=... \
      -- npx -y @vkruglikov/telegram-mcp
    

    Clients that read a JSON config instead:

    {
      "mcpServers": {
        "telegram": {
          "command": "npx",
          "args": ["-y", "@vkruglikov/telegram-mcp"],
          "env": { "TELEGRAM_API_ID": "...", "TELEGRAM_API_HASH": "..." }
        }
      }
    }
    
  4. Check: npx @vkruglikov/telegram-mcp status.

logout revokes the session server-side and deletes it locally.

Features

Your account:

list_chats Dialogs, newest first, or only unread
search_chats Find a dialog by name — Вадим also matches Vadim
get_history Read a chat. Does not mark it read
search_messages Full-text, one chat or the whole account
send_message / send_file Delivered immediately, no undo
download_media Save an attachment
mark_read The only tool that marks anything read — the other side sees it
list_contacts Saved contacts

All of Telegram, not just your chats:

search_public_chats Channels, groups and people you have never opened
search_public_posts Text of every public channel. A few free searches a day; the result says how many are left

Prompts, shown as slash commands: personalize, draft_reply, catch_up.

Drafting in your voice

  1. Run /personalize. It calls sample_my_messages to collect messages you sent in recent private chats, then describes the patterns: languages and how you mix them, message length, greetings and sign-offs, punctuation you skip, which emoji and where, recurring phrasings, how formality shifts, and what you never do.
  2. It shows the profile before saving. Edit or reject it.
  3. Saved to ~/.telegram-mcp/style.md. Reconnect the server to load it.
  4. /draft_reply <chat> [intent] writes in that voice and shows the draft. It never sends.

get_style_profile prints the profile, forget_style_profile deletes it.

The profile covers how you write, not what you think. Facts, opinions and commitments stay yours to supply.

Everything stays on your machine

Local process, straight to Telegram, no service in between. Everything lives in ~/.telegram-mcp:

  • session.db — your login session
  • style.md — your style profile, if you made one
  • downloads/ — downloaded attachments

No telemetry, no account of ours, no third party. Credentials, session and messages go nowhere else.

Treat session.db like a password. It grants full access to your account without the password and without 2FA. Never copy it to another machine or into a repo. If it leaks, revoke it in Telegram → Settings → Devices. Deleting the folder by hand revokes nothing — use logout.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured