Telegram MCP Server
Allows reading, searching, sending, and forwarding messages on Telegram.
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 Serverread the latest 10 messages from the group 'Tech Talk'"
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
Model Context Protocol server for Telegram. Let AI read, search, send, and forward your Telegram messages.
Quick Start
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your Telegram API credentials
# Authenticate (first time only)
npm run auth
# Build and run
npm run build
npm startRelated MCP server: telegram-mcp
What It Does
This MCP server exposes Telegram as a set of tools that any MCP-compatible AI client can use:
Tool | Description |
| List all your conversations, groups, and channels |
| Get info about the authenticated account |
| Read message history from any chat |
| Search messages across all chats |
| Send a message to any chat |
| Forward a message between chats |
Prerequisites
Node.js 18+
Telegram API credentials — Get them at my.telegram.org:
Log in with your phone number
Go to API Development Tools
Create an application
Copy
api_idandapi_hash
Configuration
Edit .env with your credentials:
API_ID=12345678
API_HASH=your_api_hash_here
SESSION_STRING=Note:
SESSION_STRINGis generated automatically when you runnpm run auth.
Authentication
First-time setup requires interactive login:
npm run authYou'll be prompted for:
Phone number (with country code, e.g.
+628123456789)Auth code (sent to your Telegram app)
2FA password (if enabled)
On success, your session is saved to .env automatically.
Running
Production
npm run build
npm startDevelopment (with hot reload)
npm run devTool Reference
telegram_list_chats
List all chats (conversations, groups, channels).
Parameters:
limit (number, optional, default: 100)
Maximum number of chats to returntelegram_get_me
Get current authenticated user info. No parameters required.
Returns: id, firstName, lastName, username, phone
telegram_read_messages
Read messages from a specific chat.
Parameters:
chat_id (string, required)
Chat ID or username (e.g., "@channel", "123456789")
limit (number, optional, default: 20)
Number of messages to fetch
offset_id (number, optional)
Message ID to start from (for pagination)telegram_search_messages
Search messages across all your Telegram chats.
Parameters:
query (string, required)
Search query
limit (number, optional, default: 20)
Maximum number of resultstelegram_send_message
Send a message to any chat.
Parameters:
chat_id (string, required)
Chat ID or username
text (string, required)
Message text to sendtelegram_forward_message
Forward a message from one chat to another.
Parameters:
to_chat_id (string, required)
Target chat ID or username
from_chat_id (string, required)
Source chat ID or username
message_id (number, required)
Message ID to forwardExample: Connect to Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"telegram": {
"command": "node",
"args": ["path/to/telegram-mcp/dist/index.js"]
}
}
}Project Structure
telegram-mcp/
├── src/
│ ├── index.ts # MCP server entry (stdio transport)
│ ├── auth.ts # First-time authentication helper
│ ├── telegram-client.ts # Telegram client wrapper
│ └── tools/
│ ├── index.ts # Tool registry
│ ├── list.ts # list_chats, get_me
│ ├── read.ts # read_messages, search_messages
│ └── send.ts # send_message, forward_message
├── .env.example # Environment template
├── package.json
└── tsconfig.jsonTech Stack
Package | Purpose |
| MCP protocol implementation |
| Telegram client (MTProto) |
| Input validation |
| Environment configuration |
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/my-feature)Commit your changes (
git commit -m 'Add my feature')Push to the branch (
git push origin feature/my-feature)Open a Pull Request
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.
Latest Blog Posts
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/BoonieX/telegram-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server