tg-mcp-tools
Provides tools for browsing Telegram folders, dialogs, messages, and sending messages, allowing AI agents to access and interact with Telegram channels and chats.
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., "@tg-mcp-toolswhat's new in my Travel folder this 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.
tg-mcp-tools
A local MCP server for Cursor and Claude Desktop. It reads your Telegram subscriptions over MTProto (personal account, not a bot) and exposes channel posts to the agent for digests and natural-language questions like “what’s new in my Travel folder this week?”
Install
npm install -g tg-mcp-toolsOr run without installing (recommended for MCP):
npx tg-mcp-tools-auth # one-time login
npx tg-mcp-tools # MCP server (stdio)Related MCP server: MCP-Telegram
Features
10 MCP tools: folders, dialogs, messages, digests, send message, archive/unarchive
Post links — every message includes a
urlfield (https://t.me/...)Archived channels — included when listing subscriptions
QR login — scan from the terminal, no SMS or in-app codes
Requirements
Node.js 18+
Telegram API credentials from my.telegram.org/apps
Quick start
Create a project directory, add credentials, authorize, then connect MCP.
mkdir my-telegram-mcp && cd my-telegram-mcp
cp path/to/node_modules/tg-mcp-tools/.env.example .env
# or from a git clone: cp .env.example .envFill in .env:
TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=your_api_hashAuthorize (scan QR in terminal; session is saved to .env in the current directory):
npx tg-mcp-tools-auth
# or, from a git clone: npm run authVerify the MCP server starts:
npx tg-mcp-tools
# or, from a git clone: npm run mcpCursor setup
Add to .cursor/mcp.json in your project (where .env lives):
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "tg-mcp-tools"]
}
}
}The server loads .env from the current working directory (your project root). You don't need to duplicate env vars in mcp.json if .env is present.
For local development from a git clone, use:
{
"mcpServers": {
"telegram": {
"command": "npm",
"args": ["run", "mcp"]
}
}
}After changing the config, reload Cursor (Developer: Reload Window).
MCP tools
Tool | Purpose |
| Telegram chat folders (tabs) with id and name |
| Create a folder with channels and filter rules |
| List channels, groups, and chats; optional |
| Posts from one channel (@username or numeric id) |
| Digest from multiple channels, sorted by date |
| Digest from all channels/groups in a folder |
| Send formatted text to a user (@username), chat id, or |
| Move chats/channels to Archive |
| Restore chats/channels from Archive |
Example prompts in Cursor:
What’s new in my Travel folder this week?
Authorization
Run
npx tg-mcp-tools-authfrom the directory where.envshould liveOn your phone: Telegram → Settings → Devices → Link Desktop Device
Scan the QR code in the terminal
Enter your 2FA password if prompted
TELEGRAM_SESSIONis written to.envautomatically
Scripts
Command | Description |
| One-time login; saves |
| Start the MCP server (stdio) |
| Same, when developing from a git clone |
| Compile TypeScript → |
Security
Do not commit
.env— it contains your Telegram session (full account access)Never share
TELEGRAM_SESSIONin logs, issues, or chatsRevoke API credentials or sessions at my.telegram.org
Project layout
src/
├── config.ts # load .env from repo root
├── env-file.ts # update .env values after auth
├── telegram-client.ts # mtcute: dialogs, history, post URLs
├── index.ts # MCP server and tool registration
└── auth.ts # CLI auth (QR)Stack
@mtcute/node — MTProto client
TypeScript (ESM), zod, dotenv
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/ausievich/tg-mcp-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server