tg-mcp
Provides tools to interact with a personal Telegram account, including reading chats, searching messages, downloading media, and sending messages or files.
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-mcpcheck my last message from Anna"
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
MCP server for a personal Telegram account. Read, search, download media, and send messages or files, from any MCP client.
Credentials stay on the machine in ~/.tg/ and are never returned by any tool.
Setup on a new machine
Needs uv and nothing else. Python, dependencies and the package are all fetched on demand.
1. Sign in (once per machine, interactive because Telegram sends a code):
uvx --from git+https://github.com/Abdk4Moura/tg-mcp tg-mcp-loginIt prompts for api_id / api_hash from https://my.telegram.org (API development
tools), then your phone number, then the code Telegram sends to the app. It writes
~/.tg/credentials.json and ~/.tg/session.session, both mode 600, and prints your
recent chats with their ids.
2. Register the server:
claude mcp add telegram -- uvx --from git+https://github.com/Abdk4Moura/tg-mcp tg-mcpThat is the whole setup. claude mcp list should show telegram ✔ Connected.
Related MCP server: telegram-mcp
Setting it up for other agents
Every MCP client needs the same two things. Whatever the config format, this is all it is:
command |
|
args |
|
The sign-in is per machine, not per agent. Run tg-mcp-login once and every agent on
that machine shares ~/.tg/. Adding a second or third client is config only.
Claude Code
claude mcp add telegram -- uvx --from git+https://github.com/Abdk4Moura/tg-mcp tg-mcpAdd --scope user to make it available in every project rather than just the current one.
Claude Desktop, Cursor, Windsurf, Continue, and most others
These share the same mcpServers block. Add:
{
"mcpServers": {
"telegram": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Abdk4Moura/tg-mcp", "tg-mcp"]
}
}
}to the client's config file:
Client | File |
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Cursor |
|
Windsurf |
|
Continue |
|
Restart the client afterwards. Most only read MCP config at startup.
Anything else
Clients such as opencode, Codex and Zed use their own config shapes rather than the
mcpServers block above. Check that client's own MCP documentation, and give it the same
command and args from the table at the top of this section.
If uvx is not on PATH
Some clients launch with a minimal environment and will not find uvx. Use its absolute
path as the command (which uvx to find it, commonly ~/.local/bin/uvx).
Tools
Tool | What it does |
| Which account is signed in |
| Recent chats with their numeric ids |
| Read messages; |
| Search message text across all chats or within one peer |
| Fetch a message's attachment to disk |
| Sends text. Real, immediate, not recallable by this server |
| Sends a file with an optional caption |
Sessions
Each machine that runs tg-mcp-login creates its own Telegram session, listed
separately under Settings → Devices and revocable on its own.
Copying session.session between machines also works, but both then share one session
identity: revoking it logs out both, and a login from a very different IP can trip
Telegram's security checks. Prefer a fresh login per machine.
That file is full account access. Anyone holding it can read and send as you.
Configuration
Variable | Default | Purpose |
|
| Where |
|
| Where |
Local development
uv run --directory /path/to/tg-mcp tg-mcpMaintenance
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
- FlicenseBqualityDmaintenanceAn MCP server that enables interaction with Telegram messaging platform, allowing users to retrieve unread messages, fetch entity information, and send messages through natural language interfaces.610
- 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.104MIT
- AlicenseAqualityCmaintenanceMCP server that exposes a Telegram bot, enabling sending messages and retrieving updates through natural language.3MIT
- AlicenseBqualityDmaintenanceA Telegram MCP server that connects agents to a real Telegram user account via MTProto, enabling reading, searching, sending, moderating, and managing Telegram chats through natural language or automated tool calls.1009729MIT
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
An MCP server for deep research or task groups
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
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/Abdk4Moura/tg-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server