Telegram MCP Readonly
Provides read-only search and analysis of a Telegram account, including finding chats by title or username, searching message history, reading messages, inspecting contacts and topics, and downloading media to a private local directory.
Click on "Install 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 MCP ReadonlySearch my Telegram for messages about 'project alpha' from last week."
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 MCP Readonly
Search and analyze your Telegram account with AI agents without exposing Telegram mutation tools.
Use your full Telegram account as a searchable knowledge source for Codex, Claude, and other Model Context Protocol clients. Find chats by title or username, search message text across the account, read history, inspect contacts and topics, and download media into one private local directory.
Runsetup_codex_readonly.py before connecting an agent. It enables the explicit strict-read-only allowlist. The codebase retains upstream write-capable tools for compatibility, but strict mode does not register them.
Why this fork
Explicit audited allowlist, independent of MCP annotation accuracy
Search by text, username, phone, or chat title - IDs are optional for discovery
One loopback service shared by multiple agent clients
Local file session and credentials with owner-only permissions
Multi-account support and sanitized Telegram output
No session string copied into agent configuration
Related MCP server: tdl-mcp
Read-only boundary
Available in strict mode | Not exposed in strict mode |
Accounts, chats, folders, topics, contacts | Send, reply, edit, delete, or forward messages |
Message history and account-wide search | Reactions, read receipts, drafts, or pins that mutate Telegram |
Participants, admins, links, and metadata | Join, leave, invite, ban, or change members |
Passive waits for incoming messages | Change profiles, privacy, folders, or chat settings |
Media download to one configured local directory | Arbitrary local paths or agent-selected filenames |
download_media_readonly is the only deliberate local write. It creates generated filenames below TELEGRAM_READONLY_DOWNLOAD_DIR with owner-only permissions and never calls a mutating Telegram RPC.
Strict mode limits the MCP tool surface, not the authority of the underlying Telegram session. A stolen session file can compromise the account. Keep the checkout,.env, .local/, and the host itself private and trusted.
Quick start
Requirements: Python 3.10+, uv, a Telegram account, and API credentials from my.telegram.org/apps.
git clone https://github.com/mshykhov/telegram-mcp-readonly.git
cd telegram-mcp-readonly
uv sync --frozen
uv run python setup_codex_readonly.pyThe setup opens Telegram QR authorization and creates these ignored local files:
.envwithTELEGRAM_EXPOSED_TOOLS=strict-read-only.local/telegram-readonly.sessiondownloads/for path-confined media downloads
Do not install telegram-mcp from PyPI or run it with uvx: that package name belongs to a different project. Clone this repository and run it from the checkout.
Shared service on macOS
A single local service avoids Telethon SQLite lock conflicts when Codex, Claude, or several sessions connect at once.
uv run telegram-mcp-shared-service check
uv run telegram-mcp-shared-service prepare
uv run telegram-mcp-shared-service activate
uv run telegram-mcp-shared-service statusConnect clients to the loopback-only endpoint:
{
"mcpServers": {
"telegram-readonly": {
"type": "http",
"url": "http://127.0.0.1:8765/mcp"
}
}
}The endpoint is unauthenticated and must stay bound to 127.0.0.1.
Example prompts
"Find the chat named Product Team and summarize its last 100 messages."
"Search all Telegram messages for
incident reviewfrom the last month.""Find messages containing this URL and show their chat names and dates."
"List unread chats, then summarize them without marking anything as read."
"Download the media from this message into the private download directory."
Configuration
The safe setup script writes the required values. See .env.example for optional proxy, multi-account, output, and event-feed settings.
For a manual launch, set at minimum:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_SESSION_NAME=/private/path/telegram-readonly
TELEGRAM_EXPOSED_TOOLS=strict-read-only
TELEGRAM_READONLY_DOWNLOAD_DIR=/private/path/downloadsDocumentation
Development
uv sync --frozen
uv run pytest --cov --cov-report=term-missing --cov-report=xml
uv run flake8 . --exclude=.venv --count --select=E9,F63,F7,F82 --show-source --statistics
uv run black --check .
npm ci
npm run rulesync:verifyAttribution
Based on chigwell/telegram-mcp. The strict read-only boundary, local setup, shared service, and security hardening are maintained in this repository.
Licensed under the Apache License 2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search 1.2M+ Telegram channels, 245k+ chats, 160k+ bots — no account, no key, no install.
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, send, and organize Telegram messages and chats. Supports tools for listing chats, fetching messages, sending/reply, archiving, muting, and folder management.1MIT
- 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
- AlicenseBqualityBmaintenanceProvides read-only access to a user's Telegram account via MTProto, enabling chat listing, message retrieval, search, and context fetching.5MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshykhov/telegram-mcp-readonly'
If you have feedback or need assistance with the MCP directory API, please join our Discord server