Memungkinkan AI client untuk membaca, mencari, meninjau, dan mengirim pesan melalui akun Telegram pribadi Anda, lengkap dengan batasan pengiriman per profil.
Juga dikenal sebagai WireCatLabs/tg-cli, tg-cli, @wirecat/tg-cli
- Stars
- 16
- Tools
- —
- Unduhan, 30 hari
- —
- Versi terbaru
- 0.130.0
- Commit terakhir
- 14 Nov 2026
- Lisensi
- Apache-2.0
Apa itu Telegram MCP?
Telegram adalah MCP server. Memungkinkan AI client untuk membaca, mencari, meninjau, dan mengirim pesan melalui akun Telegram pribadi Anda, lengkap dengan batasan pengiriman per profil.
Ringkasan dibuat dari README proyek
Tentang Telegram MCP server
WireCat Telegram memungkinkan Anda mengelola komunikasi Telegram melalui AI agent. Tool ini memungkinkan AI client seperti Claude Desktop, Cursor, atau Claude Code untuk berinteraksi dengan akun Telegram asli Anda, bukan sekadar bot. Tool ini berfungsi sebagai interface local-first yang dapat membaca, mencari, dan mengirim pesan, sambil tetap menyimpan riwayat chat secara lokal di komputer Anda untuk pencarian yang privat.
Pengguna menyiapkan koneksi dengan mendaftarkan aplikasi Telegram mereka sendiri dan login melalui QR code atau nomor telepon. Server ini mendukung beberapa profil, sehingga Anda dapat memisahkan akun atau konteks yang berbeda. Untuk mencegah perilaku yang tidak diinginkan, tool ini menyertakan batasan penulisan per profil, seperti batas default 30 pesan per jam. Developer dapat terhubung melalui local MCP server menggunakan command tg personal mcp serve, yang menyediakan prompt siap pakai untuk tugas seperti merangkum pesan terbaru atau meninjau pertanyaan yang belum terjawab di grup chat.
Apa yang bisa Anda lakukan dengannya
- 1Merangkum janji terbaruMinta AI agent Anda untuk mengidentifikasi apa saja yang Anda janjikan dalam chat terbaru agar Anda dapat melacak kewajiban Anda.
- 2Menemukan informasi spesifikCari seluruh riwayat pesan Anda untuk menemukan detail spesifik seperti lokasi pertemuan atau ketentuan kontrak.
- 3Memantau aktivitas grupIdentifikasi pertanyaan yang belum terjawab dalam grup tertentu untuk memastikan diskusi tetap aktif.
- 4Automasi balasan pesanGunakan AI client untuk menyusun dan mengirim draf balasan atau pengingat kepada kontak Anda.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal Telegram MCP
Format diverifikasi 10 Nov 2026Tambahkan ke CursorTambahkan ke GooseInstal Telegram MCP di Claude Code
$ claude mcp add tg-cli -- npx -y @wirecat/tg-cliInstal Telegram MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"tg-cli": {
"command": "npx",
"args": [
"-y",
"@wirecat/tg-cli"
]
}
}
}Instal Telegram MCP di VS Code
.vscode/mcp.json
{
"servers": {
"tg-cli": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@wirecat/tg-cli"
]
}
}
}Instal Telegram MCP di VS Code CLI
$ code --add-mcp '{"name":"tg-cli","type":"stdio","command":"npx","args":["-y","@wirecat/tg-cli"]}'Instal Telegram MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"tg-cli": {
"command": "npx",
"args": [
"-y",
"@wirecat/tg-cli"
]
}
}
}Instal Telegram MCP di Codex
$ codex mcp add tg-cli -- npx -y @wirecat/tg-cliInstal Telegram MCP di Codex config.toml
~/.codex/config.toml
[mcp_servers.tg-cli] command = "npx" args = ["-y", "@wirecat/tg-cli"]
Instal Telegram MCP di Gemini CLI
$ gemini mcp add -s user tg-cli npx -- -y @wirecat/tg-cliInstal Telegram MCP di Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"tg-cli": {
"command": "npx",
"args": [
"-y",
"@wirecat/tg-cli"
]
}
}
}Konfigurasi
TG_PROFILE
| Nama | Deskripsi | Tipe |
|---|---|---|
| TG_PROFILE | — |
Pengecekan otomatis
Berjalan 12 Nov 2026Laporan lengkap →Lolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkauLolos
- Lisensi open source (OSI)Lolos
- Ada commit atau release dalam satu tahun terakhirLolos
- Nama package tidak mirip dengan package populerLolos
- Remote endpoint menggunakan HTTPSTidak diperiksa
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Tidak ada instruksi tersembunyi untuk modelLolos
- Tidak ada advisory kritis pada paket atau dependensinyaLolos
README
Lihat di GitHubtg — Telegram CLI for AI agents
An example conversation (invented people, illustrative output):
You: Use tg CLI. What did I promise anyone in the last three days?
Agent: (runs tg personal review 'date>3d': 12 chats)
I owe
· Alice Example — the invoice by Friday. "Alice Example", 24.09
Waiting on others
· Bob Sample — the mock-up by 25.09. Not in "Design" yet
You: Remind Bob about the mock-up.
Agent: Draft: "Hi Bob, how is the mock-up going?" Send it?
You: Yes.
Quick start
npm install -g @wirecat/tg-cli # or: bun add -g @wirecat/tg-cli; pnpm: see docs/installation.md
tg skill install --for all # the agent skill, for Claude Code, Codex and Gemini CLI
tg personal setup # app registration and login
tg personal inbox # other people's unread messages, in every chat; nothing is marked read
A global install does not install the agent skill: tg personal setup offers it, or run tg skill install --for all. npm may warn that install scripts are blocked or "not yet covered by allowScripts" (@wirecat/tg-cli,
better-sqlite3); that is harmless, and you need not allow them — why.
On Windows, if tg is not found, open a new terminal, or use the PowerShell installer in
the installation guide.
Allow about five minutes. tg personal setup registers your own Telegram app at
my.telegram.org, logs in by QR code, checks your first chats and installs
the agent skill. Downloading older history is a separate step.
It needs Node 22.19+ or 24+, or Bun, on macOS, Linux or Windows. Try it without installing:
npx @wirecat/tg-cli --help.
More: installation guide · on wirecat.dev
What can you do?
Catch up. "Use tg CLI. What came in since this morning, and who is waiting for my answer?"
tg personal inbox
tg personal review 'date>1d'
Find anything. "Use tg CLI. When did we agree on the venue with Alice?" — an answer with the date and the message itself.
tg personal search all "venue" # messages and notes on this computer, and Telegram's own search
By default the words also go to Telegram's server search; add --offline to keep the query on this computer.
Keep your promises. "Use tg CLI. What did I promise, and what am I still waiting on?" tg personal review
hands over everything said since the last review in one call, your own messages too.
tg personal review --new # what changed since the last review --new
Run your groups. "Use tg CLI. Which questions in Hiking has nobody answered?"
tg personal review chat:Hiking --unanswered
tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed
More: recipes, with a schedule and limits for each · on wirecat.dev
Built for AI agents
Your agent. Your Telegram. Your rules.
- Agents with a terminal (for example Claude Code, Codex, Gemini CLI) run
tgcommands themselves. The bundled skill tells them how:tg personal setup --agent …ortg skill installputs it in place, andtg skill showprints it before login. - Apps without a terminal (for example Claude Desktop, Cursor and other MCP clients) connect to
tg personal mcp serve. It comes with ready prompts:/catch-up,/review,/reply,/find,/open-tasksand/link-conversations.
tg personal mcp add claude-code # or: tg personal mcp add codex
tg personal mcp config # the entry for Claude Desktop, Cursor and others
The profile can send by default, so mcp add stops first. Check the profile's permissions, then run
it again with --allow-writes.
More: the MCP server · on wirecat.dev
Why tg?
- Your whole account, not only bots. Every chat, group, channel and contact, with its history —
tgis one more of your devices. - Local-first search. Everything read is kept on your computer. Search reads that copy and, by default,
asks Telegram's own search too;
--offlinekeeps the query on your computer. - Made for agents. One operation per call, the same JSON shape every time with
--json, a fixed exit code for each kind of failure, an MCP server and a skill. - Safe by default. Reading marks nothing read. A profile decides which actions an agent may take,
which chats it may send to, and how many messages an hour (30 by default). When a send's outcome is
unknown,
tgsays so and gives a repeat command that Telegram does not deliver twice. - The full Bot API too. All 185 methods, next to the convenient bot commands.
More: compared with other tools · on wirecat.dev
Your account
tg works in your name, as one more of your devices. It is not a bot: it talks to Telegram over
MTProto, Telegram's own API for client apps, with an app you register yourself. It sees your chats,
their history, groups, channels and contacts.
tg personal chats list --limit 5
tg personal messages list "Book club" --limit 20
tg personal messages send "Book club" "Call at 3?" --reply-to <id>
tg personal reactions add "Book club" <id> 👍
tg personal messages send me "Call mum" --at-time 2h # a reminder in Saved Messages in two hours
tg personal messages send "Book club" "The minutes" --file minutes.pdf
tg personal messages download "Book club" <id> --output-dir ~/Downloads
tg personal messages transcribe "Book club" <id> # a voice message as text
- Read. Chats, history, one message with its neighbours, other people's unread messages in every
chat (
tg personal inbox), everything since the last review (tg personal review), new messages as they arrive (tg personal watch), a message's files, voice messages as text. - Write. Markdown, replies, files, photos, videos and voice messages, silent and scheduled messages (they go out even with this computer off), edits, forwards, pins, reactions, polls, deletion — for you or for everyone.
- Voice on your computer. Telegram transcribes for Premium accounts;
tgcan also run a speech model on this machine, downloaded only when you ask. - Contacts and the account. Add, rename, block and import contacts; your own aliases and notes for people; who you are logged in as, and every device logged in to the account.
- One person. Their profile, when they were last seen, their messages per shared chat, and whether the account looks like a bot or a spammer.
More: using tg · on wirecat.dev · one person · on wirecat.dev
Log in and profiles
Every user registers their own Telegram app; tg personal setup or tg personal session start does it for you. The
app keys go to the system keyring, and the session is a file only your user can read.
tg personal session start # a QR code: Settings → Devices → Link Desktop Device
tg personal session start phone # or a phone number, the code and your 2FA password
tg personal session start qr # without a terminal (an agent): the QR code as text to paste into the chat
tg personal account show # who you are logged in as
tg account list # every profile here, and who each is logged in as
Several accounts are several profiles, and the profile is the first word, not an option:
tg personal chats list # profile "personal"
tg work chats list # profile "work"
export TG_PROFILE=work # or for the whole shell session
tg never picks a profile for you, not even the only one: a command that uses an account and has no
profile named stops and lists the profiles on this computer. Name one, or set TG_PROFILE for a
whole shell session.
More: login and sessions · on wirecat.dev · profiles · on wirecat.dev
The local store and search
Everything tg reads is kept in a local store on your computer. Search runs over it and over
Telegram by default; --offline answers from the store without connecting.
tg personal search messages 'contract chat:"Project Alpha"'
tg personal search messages "contract" --backend archive # local only
tg personal messages sync "Project Alpha" --last 5000 --background
tg personal store export "Project Alpha" --format markdown --output alpha.md
tg personal messages evidence "Project Alpha" --json # bounded evidence for a chat brief
tg personal server install # keep the store current as a systemd or launchd service
tg personal store backup ~/tg-backup.db # a copy, safe while the store is in use
Search by words, people, dates, files, links and tags; save searches; find discussions by topic.
More: search · on wirecat.dev · the local store · on wirecat.dev
Groups you run
tg personal review chat:Hiking --unanswered # questions nobody answered in 24 hours
tg personal chats events "Hiking" "time>=7d" # who joined, left, was added or removed, and by whom
tg personal chats members list "Hiking" --all # everyone, with their role and when they were last seen
tg personal topics list "Hiking" # a forum group's topics, newest activity first
tg personal chats inspect https://t.me/+AbCdEf # where an invite link leads, without joining
tg personal chats create "Hiking 2027" @alice_example # a new group, with the people you name
tg personal stats chats show "Hiking" # group activity
Renaming a group, adding and removing members and admins, join requests, invite links, forum topics and moderation rules for links, forwards and floods are commands too.
More: groups you run · on wirecat.dev
A bot
tg personal bot works with a bot through Telegram's official Bot API and
its token from @BotFather. You can keep several bots; each has a name you
choose, and that name is the first word of the command.
tg sales bot auth set # the token, at a hidden prompt; Telegram checks it first
tg sales bot auth show # which bot it is
tg sales bot recipients add user:<id> # the bot may write only here
tg sales bot messages send "Team" "Build is ready" --file report.pdf
tg sales bot api --help # every Bot API method, each with its fields
tg personal bot list --check # every bot on this computer
- Every Bot API method.
tg <bot> bot api <method>takes native field flags or a JSON body. - One token per name, in the keyring, apart from your own login;
TG_BOT_TOKENfor CI. The token is never printed — not in an error, not with--trace, not in a run record. - Recipients and a journal. Each bot has its own list of chats it may write to, and a journal of what it did, without the text.
- Messages, admins, members, buttons, the menu, webhooks — send, edit, delete and pin;
bot chats admins,bot callbacks answer,bot commands,bot webhooks. - History.
bot watchprints and keeps what happens in the bot's chats;bot messages syncimports older channel and supergroup messages.
More: a Telegram bot · on wirecat.dev
Agent setup in detail
The skill. Claude Code reads ~/.claude/skills/tg-cli/; Codex, Gemini CLI and local Cursor read
~/.agents/skills/tg-cli/. Start a new agent session if it does not see the skill.
tg skill install --for all # both folders, without logging in
tg skill show # the complete instructions, without installing them
The MCP server. Commands stay discoverable with their arguments and current availability. The
profile's permissions decide which may run. readonly stops writes; at ask the server shows no
form, so set up approval in your agent app.
claude mcp add tg -- tg personal mcp serve # Claude Code, by hand
claude mcp add tg -- tg mcp serve --profiles all # one server for every profile
tg personal mcp check # check the local MCP server
From the browser. ChatGPT or Claude in the browser reach tg personal mcp serve --http --public-url <url> behind
your tunnel, after a login with a one-time access code from your terminal.
More: the MCP server · on wirecat.dev · remote access · on wirecat.dev
Output for scripts and agents
With --json a command prints only data, as one JSON value — no tables, colour or hints; it does the
same when another program reads its output. --jsonl prints one object per line. Every list has one
shape:
{ "items": [ … ], "page": { "limit": 20, "has_more": true }, "meta": { … } }
An error goes to stderr as one line, with stdout empty, and the command exits with a fixed code: 4
log in, 5 the profile may not do this, 6 chat or message not found, 8 a limit, 9 Telegram did
not answer in time, 14 unknown whether a message went. tg commands --json is the whole command
tree. A partial read or download can exit 0: check complete in the JSON.
More: CLI contract · on wirecat.dev · every command and exit code · on wirecat.dev
Settings and permissions
tg personal config set permissions.messages readonly # no change to messages from this profile
tg personal config set permissions.messages.send ask # a question in the terminal before each send
tg personal config set sends_per_hour 10 # at most 10 sends an hour (30 by default)
tg personal recipients add "Book club" # the first add turns the recipient list on
tg personal sends list # every attempt: sent, refused, failed or not known
tg personal config show # what is set, and where it came from
More: permissions · on wirecat.dev · configuration · on wirecat.dev
Limits
Each profile has one request pace, shared by every command, background job and server at once, so bulk work stays under Telegram's limits. Short waits from Telegram are waited out; a long wait stops the run instead of being repeated.
More: limits and waits · on wirecat.dev
Security
- The session file is as good as your password, readable only by your user; the app keys are in the system keyring. No command takes a password, a login code or a phone number as an argument.
- The local store holds the full text of what was read, unencrypted and readable only by your user. It stays after logout; only whole-disk encryption protects it from a stolen disk.
- Every send, from a command or over MCP, passes the profile's limits and is written to a journal —
without its text.
--filerefuses credential files, CLI folders and the local store. - Control characters in names, titles and messages are shown as text, so other people's text cannot control your terminal.
- The limits stop an agent talked into sending by a message it read, not one that sets out to get round them: for that, run the agent in a sandbox or as a separate user.
To report a vulnerability: SECURITY.md.
More: security · on wirecat.dev
When something goes wrong
tg personal doctor # where the files are and whether a session is saved, without connecting
tg personal doctor --online # check that the login works
tg personal chats list --trace # each request to Telegram, with no text, names, phone numbers or keys
tg personal runs list # recorded runs
More: troubleshooting by symptom · on wirecat.dev · diagnostics · on wirecat.dev
How it differs
Telegram's own apps are made for a person; tg is made for a script and an agent. A Telegram bot sees
only the chats it was added to and speaks as the bot; tg is you, in your chats. Other open tools
connect a Telegram account to an agent too: tgcli, telegram-mcp and tdl.
More: compared with other tools · on wirecat.dev
Part of WireCat
WireCat is an open-source, local-first context layer for AI agents. tg is
where it starts; max-cli brings the MAX messenger into the
same local store. Start with Telegram. Add more context when you need it. Your context. Any agent.
Questions and setup help: join the WireCat Discord. Bugs go to this repository's issues.
Pertanyaan tentang Telegram MCP
Bagaimana cara menambahkan Telegram MCP ke Claude Code?
Jalankan claude mcp add tg-cli -- npx -y @wirecat/tg-cli di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan Telegram MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Apakah ini bekerja dengan akun Telegram pribadi saya, bukan bot?
Ya, tool ini login sebagai salah satu perangkat Anda melalui MTProto menggunakan aplikasi Telegram yang Anda daftarkan sendiri, sehingga ia dapat melihat semua chat dan riwayat Anda.
Bagaimana cara MCP client terhubung ke Telegram melalui tool ini?
Jalankan command MCP server dan tambahkan entri config yang dihasilkan ke Claude Desktop, Cursor, atau MCP client lainnya.
Apakah agent bisa mengirim pesan, dan apakah ada batasannya?
Pengiriman pesan dimungkinkan namun dibatasi: sebuah profil menentukan chat mana saja yang boleh dikirimi pesan dan berapa banyak pesan per jam, secara default adalah 30 pesan.
Apakah saat mencari pesan, query saya dikirim ke Telegram?
Secara default, pencarian mencakup salinan lokal dan pencarian server Telegram; gunakan --offline untuk menjaga agar query tetap berada di komputer Anda.
Apakah membaca pesan akan menandainya sebagai sudah dibaca?
Tidak, membaca pesan tidak akan mengubah status pesan, dan command inbox tidak akan menandai apa pun sebagai sudah dibaca.