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 "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., "@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.
Telegram MCP Tools
A local MCP server for Cursor, Claude, Codex, or any other client. 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?”
Features
21 MCP tools across domains:
channels(create/rename/join/leave/discover/search),subscriptions(list/archive/mute),folders,messages,sendPost 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
Related MCP server: Claudegram
Requirements
Node.js 18+
Telegram API credentials from my.telegram.org/apps
Quick start (npm package)
Use this path if you consume the published package — no git clone needed.
1. Create a project directory and install the package
mkdir my-telegram-mcp && cd my-telegram-mcp
npm install tg-mcp
cp node_modules/tg-mcp/.env.example .env2. Add API credentials to .env
TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=your_api_hash3. Authorize (QR in terminal; session is saved to .env)
npx tg-mcp-authOn your phone: Telegram → Settings → Devices → Link Desktop Device → scan the QR code. TELEGRAM_SESSION is written to .env automatically.
4. Connect MCP
Cursor
Add to .cursor/mcp.json in the same directory as .env:
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "tg-mcp"]
}
}
}The server loads .env from the current working directory (your project root). You don't need to duplicate env vars in mcp.json.
Reload Cursor after changing the config (Developer: Reload Window).
Claude Desktop
Open the config file: Settings → Developer → Edit Config
Add a telegram entry under mcpServers. Put credentials in env — Claude Desktop does not load .env from disk:
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "tg-mcp"],
"env": {
"TELEGRAM_API_ID": "12345678",
"TELEGRAM_API_HASH": "your_api_hash",
"TELEGRAM_SESSION": "your_session_string"
}
}
}
}Copy the three values from .env after npx tg-mcp-auth. If you re-authorize, update TELEGRAM_SESSION here too.
Fully quit Claude Desktop (system tray → Exit), then relaunch. The connector appears under Connectors.
Development (git clone)
Use this path if you work from the repository — local src/, rebuilds, and MCP Inspector.
1. Clone and install
git clone https://github.com/ausievich/tg-mcp-tools.git
cd tg-mcp-tools
npm install
cp .env.example .env2. Add API credentials to .env (same as above)
3. Build and authorize
npm run build
npm run auth4. Connect MCP
Cursor
{
"mcpServers": {
"telegram": {
"command": "npm",
"args": ["run", "mcp"]
}
}
}Run npm run build after code changes. npm run inspect builds and opens MCP Inspector for interactive tool testing.
MCP tools
Tool | Purpose |
| Create a new broadcast channel (title and optional description) |
| Rename a channel or group (requires admin rights) |
| Telegram-recommended similar public channels (by channel, folder, or all subscriptions) |
| Global search for public channels/groups by name or post content |
| Subscribe to a channel/group by @username, id, or invite link |
| Unsubscribe from a channel or leave a group |
| Mute notifications for chats/channels (forever by default) |
| Restore notifications for muted chats/channels |
| Telegram chat folders (tabs) with id and name |
| Create a folder with channels and filter rules |
| Update an existing folder: replace included chats or rename it |
| List channels, groups, and chats; optional |
| Posts from one channel; pagination ( |
| Comments on a channel post by t.me URL or |
| Full-text search in one chat across entire history |
| Search by text across all channels/groups in a folder |
| 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:
What’s new in my Travel folder this week?
Get all comments on https://t.me/channel/123 and summarize the discussion
Security
Do not commit
.env— it contains your Telegram session (full account access)Claude Desktop / Codex: config files with inline
envhold the same secrets as.env— treat them like.envNever share
TELEGRAM_SESSIONin logs, issues, or chatsRevoke API credentials or sessions at my.telegram.org
Log out locally:
npx tg-mcp-logout(npm) ornpm run logout(git clone)
Stack
@mtcute/node — MTProto client
TypeScript (ESM), zod, dotenv
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA simple MCP server that allows Claude to access your Telegram account to read and send messages on your behalf.7Apache 2.0
- AlicenseBqualityDmaintenanceMCP server that enables Claude Code to interact with a personal Telegram account via MTProto, providing over 120 tools for messaging, media, chat management, and more.1002MIT
- AlicenseNot gradedqualityDmaintenanceA read-only Telegram MCP server that retrieves messages from your DMs, groups, and channels, enabling Claude to generate executive briefings from Telegram conversations.MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that connects to a Telegram group chat, persists messages to a local SQLite database, and exposes tools to search, retrieve, and send messages via SSE.-