Telegram Account MCP
Provides access to a Telegram user account, with tools for retrieving per-chat text history by chat ID or @username, listing conversations by date for up to 31 days, and retrieving outgoing messages by date. Optional sending of text messages and replies can be enabled.
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., "@Telegram Account MCPshow me the last 10 messages from @john_doe"
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.
Telegram account MCP
Local Telegram user-account MCP for Codex CLI and Claude Code. QR login is the default; no bot or web server.
QR replaces phone/code login—not API credentials. This user-account MCP cannot work without api_id and api_hash; a bot token is not a substitute for access to your personal chats. Get the credentials once (Telegram's instructions):
Sign in at my.telegram.org with the phone number of your Telegram account and the code Telegram sends you.
Open API development tools and create an application (fill in the required title, short name and other fields).
Copy its numeric api_id and api_hash into your private
.envasTELEGRAM_API_IDandTELEGRAM_API_HASH. Never paste them into an agent chat.
1. Sign in with QR
Requires Python 3.11+ and uv.
git clone https://github.com/Vlislavn/telegram-account-mcp.git
cd telegram-account-mcp
uv sync --locked --no-dev
cp .env.example .env
chmod 600 .envAfter filling in .env, run uv run --no-sync telegram-account-mcp login.
On your phone: Telegram → Settings → Devices → Link Desktop Device → scan the terminal QR. Expired QR codes refresh automatically; enter your 2FA password if asked. The session is saved privately outside the repo at ~/.local/share/telegram-account-mcp/session.session. If QR is unavailable, use uv run --no-sync telegram-account-mcp login --phone instead.
Related MCP server: telegram-mcp
2. Connect one agent
Use your absolute checkout path and choose one command:
codex mcp add telegram -- uv --directory "/absolute/path/to/telegram-account-mcp" run --no-sync telegram-account-mcp serve
# or, from the Claude Code project where you want access:
claude mcp add --scope local telegram -- uv --directory "/absolute/path/to/telegram-account-mcp" run --no-sync telegram-account-mcp serveRestart the agent; check codex mcp list or claude mcp list. No extra agent instructions are needed.
Tools: per-chat text history (by ID or @username), conversations by date (up to 31 days), outgoing messages by date. Sending text/replies is off by default. To expose it, set TELEGRAM_ENABLE_SEND=1 in .env and restart the agent; configure its per-call approval before sending. An uncertain send (status=unknown) must be checked in Telegram before retrying. Optional TELEGRAM_ALLOWED_CHAT_IDS restricts every tool to numeric chat IDs; unset means all accessible chats.
Privacy: never publish .env or .session. MCP message text can reach the agent's model provider. Two agents should not use one session simultaneously. QR/phone login has offline tests, but a real login still requires the owner to scan/confirm; it has not been verified with a live account.
Run offline tests: uv sync --locked && uv run pytest -q. Changes · MIT license.
Available Tools
3 toolsget_sent_messagesCRead-only
Read outgoing text messages on an ISO date.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered structurally. The description adds no behavioral context beyond that: no indication of result ordering, volume, pagination, or what constitutes 'outgoing' versus other message types.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single short sentence with the action and scope front-loaded and no filler. It is efficient, though very terse given the tool's schema gaps.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained, and the safety profile is covered by annotations. However, with zero schema description coverage on the only parameter and no usage routing to siblings, the description leaves clear gaps for an agent deciding between the three telegram tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% for the single 'date' parameter, so the schema itself provides no meaning. The description partially compensates by specifying the 'ISO date' format, but adds nothing about timezone, range boundaries, or whether partial dates are accepted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Read') and resource ('outgoing text messages') with a scoping condition ('on an ISO date'). It is reasonably distinguishable from telegram_get_conversations and telegram_get_chat_history, though it never explicitly contrasts itself with those siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus the sibling conversation/chat-history tools, and no exclusions or prerequisites are stated. The agent must infer that this is the sent-message-specific lookup.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_get_chat_historyBRead-only
Read newest-first text history by numeric ID or @username.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| chat_id | Yes | ||
| before_msg_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds useful behavioral context by specifying newest-first ordering and that the result is text history, but it does not mention pagination behavior or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single front-loaded sentence with no wasted words. It efficiently conveys the core operation, ordering, and identifier format.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with annotations covering safety and an output schema covering returns, the description is adequate but incomplete. It leaves usage guidelines absent and two of three parameters undocumented, which matters given 0% schema description coverage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must carry parameter meaning. It clarifies that chat_id accepts a numeric ID or @username, which adds value beyond the anyOf schema type, but it says nothing about the limit or before_msg_id parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb ('Read'), resource ('text history'), scope ('newest-first'), and chat identifier format ('numeric ID or @username'). It implicitly contrasts with siblings that list conversations or sent messages, but it does not explicitly name or differentiate them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus telegram_get_conversations or get_sent_messages. It only states what the tool does, leaving usage context to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_get_conversationsCRead-only
Read text conversations on one date or an inclusive date range.
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| end_date | No | ||
| chat_types | No | ||
| start_date | No | ||
| group_allowlist_ids | No | ||
| group_allowlist_names | No | ||
| private_allowlist_ids | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds only that results are text conversations scoped to a date range; it says nothing about pagination, volume limits, auth/allowlist requirements, or what happens if no date is supplied.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with zero filler, and the date-scoping constraint is stated up front. It is efficient, though arguably too terse for a 7-parameter tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need no explanation, and annotations cover read-only semantics. But with 7 parameters at 0% schema coverage, the description leaves most input semantics (allowlists, chat types) undocumented, which is a substantial gap for a filtering tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 7 parameters, so the schema provides no help. The description clarifies only the date/start_date/end_date interplay; chat_types, group_allowlist_ids, group_allowlist_names, and private_allowlist_ids are entirely unexplained in both the schema and the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ("Read") and resource ("text conversations") with a scoping qualifier ("on one date or an inclusive date range"). However, it never distinguishes itself from the sibling telegram_get_chat_history, so an agent cannot tell the two apart from the description alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase "on one date or an inclusive date range" implicitly tells the agent how to scope the call, which is useful context. But there is no explicit when-to-use/when-not-to-use guidance and no mention of the alternatives (get_sent_messages, telegram_get_chat_history), leaving the selection decision to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
get_sent_messages - First observed
telegram_get_chat_history - First observed
telegram_get_conversations
TDQS
Scored across 3 tools
get_conversations and get_chat_history both retrieve message history, one by date and the other by chat ID or username, so their boundaries overlap. get_sent_messages is more distinct as outgoing-only, but the overall set still has moderate ambiguity in read operations.
All tool names use snake_case with a get_ verb, which is readable and mostly consistent. However, two tools are prefixed with telegram_ while get_sent_messages is not, creating a minor deviation.
Three tools is a small but plausible set for a read-only Telegram message retrieval server. Each tool covers a distinct retrieval angle, though it is somewhat thin if the server's scope is broader account management.
The surface covers reading conversations, sent messages, and chat history, but lacks message search, media retrieval, contact/chat listing, and any send or write operations. These are notable gaps if the server is meant to represent a Telegram account comprehensively.
Maintenance
Related MCP Connectors
Search, read and reply to your Telegram chats, transcribed voice included.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Run a Telegram channel from your AI agent. Posts go out through your own bot, not your account.
Project memory, tasks and Telegram notifications for your coding agent. Chip account required.
Related MCP Servers
- AlicenseAqualityDmaintenanceRead-only Telegram access for Claude and other MCP hosts. Provides tools to list chats, read recent messages, and download media from your own Telegram account without needing an api_id/api_hash.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate a Telegram account through the same commands as the terminal client: messaging, chat management, voice transcription, calls, stickers, and privacy settings.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search and analyze a Telegram account as a read-only knowledge source, allowing chat discovery, message search, history reading, contact inspection, and media download without exposing any mutating Telegram tools.13Apache 2.0