TgPilot
Provides access to a real Telegram user account, enabling AI agents to read chats, get unread digests, search message history, reply, forward, post to channels, manage groups and channels, send media/files/polls, download media, react, pin messages, mark chats as read, join or leave chats, invite users, update profile details, and block users.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TgPilotWhat did I miss in Telegram this morning? Reply to Alex that I'll be there at 7."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
✈️ TgPilot
Give Claude, Cursor or any MCP-compatible AI agent your Telegram account.
Read chats, get unread digests, search history, reply, forward, post to channels, manage groups — by just asking your AI in plain language.
You: What did I miss in Telegram this morning? Reply to Alex that I'll be there at 7.
Claude: You have 4 unread chats:
• Alex — asks if you're coming to dinner tonight
• Design team — new mockups for the landing page (3 files)
• Mom — "call me when you're free"
• @durov channel — 1 new post
✅ Replied to Alex: "Sure, I'll be there at 7!"Why TgPilot
🧠 Works with any MCP client — Claude Desktop, Claude Code, Cursor, Windsurf, Cline, Zed, n8n, your own agent.
👤 Real user account, not a bot: everything you can do in the Telegram app, your agent can do too.
🛡 Safety first — read-only mode, allow / deny lists of chats, rate-limit handling, no data leaves your machine.
🙋 Human-like — shows "typing…" with a natural pause before messaging people.
⚡ One command to log in, one line of config to connect. No database, no bot token, session is a single string.
Related MCP server: Telegram MCP Server
🧰 Tools
Read | Act |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Run tgpilot tools to see the list.
📦 Install
pip install git+https://github.com/Shukurov777/tgpilot
# or
uv tool install git+https://github.com/Shukurov777/tgpilot🔑 Log in (once)
Get
api_idandapi_hashat my.telegram.org/apps.Run:
tgpilot loginEnter your phone, the code from Telegram and 2FA password (if any). You'll get TG_SESSION — a string that
gives full access to the account. Keep it secret.
🔌 Connect to your AI
{
"mcpServers": {
"telegram": {
"command": "tgpilot",
"args": ["serve"],
"env": {
"TG_API_ID": "123456",
"TG_API_HASH": "your_api_hash",
"TG_SESSION": "your_session_string"
}
}
}
}claude mcp add telegram \
-e TG_API_ID=123456 -e TG_API_HASH=your_api_hash -e TG_SESSION=your_session_string \
-- tgpilot serve{
"mcpServers": {
"telegram": {
"command": "tgpilot",
"args": ["serve"],
"env": { "TG_API_ID": "123456", "TG_API_HASH": "your_api_hash", "TG_SESSION": "your_session_string" }
}
}
}docker build -t tgpilot .
docker run -i --rm --env-file .env tgpilot servetgpilot serve --transport streamable-http⚙️ Configuration
Variable | Default | Description |
| — | From my.telegram.org |
| — | Printed by |
|
|
|
|
| "typing…" and a short pause before messaging people |
| empty | Comma list of |
| empty | Chats the agent must never see or touch |
|
| Where |
💡 Ideas to try
"Give me a digest of all unread chats, grouped by importance."
"Find who sent me the invoice last week and forward it to @accountant."
"Summarize the last 200 messages in the Design team group and post the summary there."
"Create a channel 'Daily AI news' and post today's top 5 headlines."
"Every message from @boss — reply that I'll answer within an hour." (with a scheduler / agent loop)
🔒 Security
Everything runs locally; TgPilot talks only to Telegram servers.
The session string is equal to your password — store it in env/secret manager, never commit it.
Start with
--read-onlyandTG_ALLOW_CHATSuntil you trust your agent.Content of messages is untrusted input. Tool instructions remind the model to treat chats as data, not commands.
Automating a user account must follow the Telegram Terms of Service. Don't spam.
🗺 Roadmap
Voice message transcription (Whisper)
Stories: view & download
Real-time events (new message → agent)
Multiple accounts
Prompts: daily digest, inbox zero
🤝 Contributing
Issues and PRs are welcome. If TgPilot saves you time — leave a ⭐, it really helps the project grow.
License
MIT © Bahrullo Shukurov
Available Tools
25 toolsblock_userC
Block or unblock a user.
Inputs: user (required), unblock. Returns: result
create_groupC
Create a supergroup (or a channel when channel=True).
Inputs: title (required), about, channel. Returns: result
delete_messagesC
Delete messages (your own for everyone, or locally).
Inputs: chat (required), message_ids (required), for_everyone. Returns: result
download_mediaB
Download photo/video/voice/file from a message, returns local path.
Inputs: chat (required), message_id (required). Returns: result
edit_messageC
Edit your own message.
Inputs: chat (required), text (required), message_id (required). Returns: result
forward_messagesC
Forward one or more messages to another chat.
Inputs: to_chat (required), from_chat (required), message_ids (required). Returns: result
get_chat_infoC
Details of a user, group or channel (bio, members, links).
Inputs: chat (required). Returns: result
get_meB
Info about the connected Telegram account.
Inputs: no named parameters. Returns: result
get_participantsC
Members of a group or channel (admin rights required for channels).
Inputs: chat (required), limit, query. Returns: result
invite_usersC
Add users to a group or channel.
Inputs: chat (required), users (required). Returns: result
join_chatB
Join a public channel/group (@name) or an invite link (t.me/+hash).
Inputs: link (required). Returns: result
leave_chatB
Leave a group/channel or delete a private dialog.
Inputs: chat (required). Returns: result
list_dialogsC
Recent chats with type, id and unread counters.
Inputs: limit, unread_only. Returns: result
mark_readC
Mark a chat as read.
Inputs: chat (required). Returns: result
pin_messageC
Pin or unpin a message.
Inputs: chat (required), message_id (required), unpin. Returns: result
reactB
Put an emoji reaction on a message (empty emoji removes it).
Inputs: chat (required), message_id (required), emoji. Returns: result
read_commentsC
Comments under a channel post.
Inputs: channel (required), post_id (required), limit. Returns: result
read_messagesB
Last messages of a chat, oldest first. Use before_id to paginate.
Inputs: chat (required), limit, before_id. Returns: result
search_chatsC
Find users, groups and channels by name, @username or phone.
Inputs: query (required), limit. Returns: result
search_messagesC
Full-text search in one chat or across all chats (chat='').
Inputs: query (required), chat, limit. Returns: result
send_fileC
Send a local file, photo, video or voice note.
Inputs: chat (required), path (required), caption, as_voice. Returns: result
send_messageB
Send a text message (Markdown). Optional reply and scheduled send.
Inputs: chat (required), text (required), reply_to, schedule_minutes. Returns: result
send_pollC
Create a poll with 2-10 options.
Inputs: chat (required), options (required), question (required), multiple. Returns: result
unread_digestC
Summary of unread chats with their latest messages.
Inputs: chats, per_chat. Returns: result
update_profileB
Change name and/or bio of the account (empty = keep).
Inputs: bio, last_name, first_name. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 25 tools
Tools mostly map to distinct Telegram resources and actions. Some related areas exist—list_dialogs/search_chats/get_chat_info for chat discovery and read_messages/search_messages/unread_digest for retrieval—but their descriptions make the boundaries usable.
Nearly all tools follow a snake_case verb_noun pattern such as send_message, read_messages, and join_chat. A few exceptions like unread_digest, react, and get_me are readable but slightly break the convention.
25 tools is on the high side, but the broad Telegram client surface justifies most of them. Each tool corresponds to a real operation, with little obvious duplication, though some settings/admin functions could potentially be consolidated.
The set covers core messaging, media handling, chat discovery, group membership, profile updates, and basic moderation. Minor gaps remain around admin/permission management, chat settings such as mute/archive, and retrieving block lists.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Let AI assistants post to your Telegram chats, groups and channels. Not affiliated with Telegram.
Chat with Pally, the AI assistant in your texts and on Telegram, from any MCP-compatible AI app.
Your Telegram, WhatsApp, Instagram, mail and calendar in Claude or ChatGPT. Never sends messages.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Telegram accounts through MCP, supporting messaging, contacts, groups, media, and admin functions.4Apache 2.0
- AlicenseBqualityDmaintenanceEnables full access to your personal Telegram account via MCP, allowing reading, sending, and searching messages, managing chats, and retrieving user information through natural language commands.1841 npm4MIT
- AlicenseCqualityBmaintenanceConnects AI tools to Telegram via MCP, enabling reading chats, sending messages, managing groups, and more using your own account.5447 PyPI7MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to control a real Telegram user account via MTProto, allowing message sending, chat reading/searching, and message management through MCP tools.40 npm-