telegram-mcp-connect
Provides read access to Telegram account, allowing listing chats, reading recent messages, searching messages globally or within a chat, and optionally sending messages.
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-connectwhat did I miss in my unread chats today?"
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-connect
Connect Telegram to Claude Code, Codex, Cursor and any other MCP client. It runs as a Telegram MCP server on your own machine and gives your assistant read access to your Telegram account, so you can ask about your chats in plain language.
"summarise the last few messages in Acme"
"what did I miss in my unread chats today?"
"search my telegram for that link someone sent about that restaurant"Your Telegram session is stored in one file on your laptop. Nothing is uploaded and there is no server in the middle.
Install
You need Node.js 18 or newer. If you have npm, you already have it.
npx telegram-mcp-connect setupThe setup wizard walks through three things:
Creating a Telegram app. It opens my.telegram.org/apps for you and tells you which two values to copy back.
Signing in. Phone number, then a login code. The code arrives inside the Telegram app, not by SMS.
Connecting your editors. It detects Claude Code, Codex, Cursor, VS Code, Zed, Windsurf, Gemini CLI and others, then writes the config for whichever ones you pick.
Restart your editor and ask it something about your Telegram.
Related MCP server: Telegram Bot MCP Server
Tools
Tool | What it does |
| Shows which account is connected |
| Lists your chats newest first, with unread counts |
| Reads recent messages from one chat |
| Searches your messages globally or inside one chat |
Naming a chat
You can refer to a chat the way you would say it out loud. All of these work:
"Acme <> Contoso" exact title
"acme contoso" punctuation and case are ignored
@some_channel username
-1001234567890 numeric id from tg_list_chatsIf a name matches more than one chat, the server says which ones so you can pick.
Reading further back
tg_read_chat returns 30 messages by default and 100 at most. To page backwards, pass beforeId set to the lowest message id you have already seen.
Sending messages
Off by default. The setup wizard asks whether you want it, and you can also turn it on for one editor at a time:
# Claude Code can send, Cursor stays read only
npx add-mcp telegram-mcp-connect@latest -g -a claude-code --args --allow-write
npx add-mcp telegram-mcp-connect@latest -g -a cursorThat adds tg_send_message and tg_mark_read.
Where your credentials live
Everything sits in ~/.telegram-mcp-connect/config.json with 0600 permissions, in a 0700 directory. That file is the only copy. It is deliberately kept out of your editors' config files, which are plain text and often end up inside a git repo.
Two things worth knowing before you run this:
Telegram has no read only credential. The session that reads your chats can also send messages and delete the account. This server only exposes read tools by default, but the session it holds is not itself restricted. Run it on a computer you control.
Messages from group chats are untrusted text. If your assistant reads a message that says "ignore your previous instructions", that is a prompt injection attempt. Keeping sending disabled limits what such a message can do.
To revoke access, either run the command below or open Telegram and go to Settings > Devices.
npx telegram-mcp-connect logoutThis revokes the session on Telegram's side and deletes the local file.
Troubleshooting
npx telegram-mcp-connect doctorIt checks your credentials, file permissions and connection, prints the account you are signed in as, and lists which editors have the server registered.
The editor cannot see the server. Restart it. Most MCP clients only read their config at startup.
"Not signed in to Telegram". Your session was revoked, usually from Settings > Devices. Run setup again.
Login code never arrives. Check the Telegram app itself rather than your SMS inbox. Telegram sends it as a message from the account named "Telegram".
Configuration
You do not normally need these. setup writes the config file for you. They exist for containers and CI, and they override the config file when set.
Variable | Purpose |
| Telegram app credentials |
| Session string |
| Set to |
| Config directory, defaults to |
|
|
| How long to wait for Telegram before giving up, defaults to 20000 |
NO_COLOR is respected for all CLI output.
Development
Built with Bun and shipped as plain Node.
bun install
bun test
bun run dev setup # run the CLI from source
bun run build # produce dist/cli.jsAnything under src/ and bin/ has to run on Node 18, since users install through npx. Bun only APIs like Bun.file and import.meta.dir will build fine and then crash for everyone.
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
- Alicense-qualityCmaintenanceAn MCP server that enables interaction with Telegram to send, read, and search messages across chats and dialogs. It supports waiting for incoming messages and retrieving conversation history through natural language commands.Last updated354MIT
- Alicense-qualityDmaintenanceEnables AI assistants to publish, edit, search, and manage messages in Telegram channels via a set of MCP tools.Last updatedMIT
- Flicense-qualityDmaintenanceEnables users to read, search, and manage Telegram messages in channels, groups, and private chats through MCP tools.Last updated
- Alicense-qualityDmaintenanceEnables reading and searching Telegram channel/group/DM messages from Claude Code using MTProto for full message history access.Last updated36MIT
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
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/Sharathxct/telegram-mcp-connect'
If you have feedback or need assistance with the MCP directory API, please join our Discord server