telegram-mcp-server
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-serversend a message to my boss saying I'll be 10 minutes late"
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-server
A Telegram MCP server via Telethon — persistent client, flood-safe, 9 grouped tools.
Zero API keys in code. Session files stored locally. Works with user accounts (2FA) and bots.
1. Install
git clone <this-repo> telegram-mcp-server
cd telegram-mcp-server
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
pip install -e .Get your API credentials
Go to my.telegram.org
Log in with your phone number
Create an app → get API ID and API Hash
One-time auth
# User account (with 2FA support)
export TG_API_ID=12345
export TG_API_HASH="your_hash_here"
telegram-mcp-server --auth --phone +33612345678
# Or via MCP tool: tg_session(action="auth", api_id=12345, api_hash="...", phone="+33612345678")Related MCP server: tdlib-mcp-server
2. Register in your MCP client
Claude Desktop / OpenCode
{
"mcpServers": {
"telegram": {
"command": "telegram-mcp-server",
"env": {
"TG_API_ID": "12345",
"TG_API_HASH": "your_hash_here"
}
}
}
}If not on PATH:
{
"mcpServers": {
"telegram": {
"command": "/path/to/.venv/bin/python",
"args": ["-m", "telegram_mcp_server"],
"env": {
"TG_API_ID": "12345",
"TG_API_HASH": "your_hash_here"
}
}
}
}Docker
docker build -t telegram-mcp .
docker run -i --rm \
-v ~/.telegram-mcp/sessions:/root/.telegram-mcp/sessions \
-e TG_API_ID=12345 \
-e TG_API_HASH="your_hash" \
telegram-mcp3. Tool catalog (9 tools, 8 actions)
tg_session — Session management
action | Required args | Description |
|
| Authenticate (2FA supported) |
| — | Check login status |
| — | Delete session |
tg_message — Send, forward, delete, reply
action | Required args | Description |
|
| Send a message |
|
| Forward a message |
|
| Delete a message |
|
| Reply to a message |
tg_chat — Chat operations
action | Required args | Description |
| — | List recent chats |
|
| Get chat info |
|
| List chat members |
|
| Leave a chat |
tg_search — Search
action | Required args | Description |
|
| Search messages (optionally in |
|
| Search contacts/users |
|
| Search channels |
tg_history — Chat history
action | Required args | Description |
|
| Get message history |
|
| Get media-only history |
|
| Get file-only history |
tg_user — User operations
action | Required args | Description |
| — | Get your own info |
|
| Get user info |
|
| Block a user |
|
| Unblock a user |
tg_media — Send media
action | Required args | Description |
|
| Send a photo |
|
| Send a video |
|
| Send a document |
|
| Send a voice note |
tg_channel — Channel management
action | Required args | Description |
|
| Create a supergroup/channel |
|
| Join a channel |
|
| Leave a channel |
|
| Get channel info |
tg_draft — Draft messages
action | Required args | Description |
|
| Save a draft |
| — | List all drafts |
|
| Delete a draft |
4. Environment variables
Variable | Default | Description |
|
| Telegram API ID (from my.telegram.org) |
|
| Telegram API Hash |
|
| Session files location |
5. Safety
Rate limiter: Send actions capped at 5/min. Read actions unlimited.
FloodWaitError auto-retry: Waits the required time (capped at 5 min).
Session files: Local only, never committed to git.
2FA support: Full support for accounts with two-factor auth.
6. MCP resources
tg://version— Server versiontg://session/status— Login state
License
MIT
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 Servers
- FlicenseAqualityBmaintenanceEnables AI agents to interact with Telegram via MTProto, supporting high-performance communication and seamless integration.1
- FlicenseNot gradedqualityCmaintenanceConnects AI agents to Telegram via the official TDLib library, enabling tools like getting user info, listing dialogs, and searching messages.
- AlicenseNot gradedqualityCmaintenanceEnables interaction with Telegram Bot API for sending messages, photos, editing messages, answering callbacks, and fetching updates.MIT
- AlicenseNot gradedqualityBmaintenanceEnables sending Telegram messages, photos, and documents, and retrieving bot information through the Telegram Bot API.581MIT
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Search 1.2M+ Telegram channels, 245k+ chats, 160k+ bots — no account, no key, no install.
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/Steph-ux/telegram-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server