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
访问服务器

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选