telegram-mcp-kit
Lets your AI assistant (Claude Code, Codex, any MCP client) read your own Telegram account, using a small local server that runs on your computer.
Who it's for: people who want their AI to search and read their real Telegram chats, not a bot's empty inbox.
What you get: Telegram tools inside your AI chat, for example "find what Anna wrote about the invoice", read-only to start.
Security warning. This logs in as YOU, so the saved login (a "session") is as powerful as your phone. Never paste your Telegram API hash, login code, 2FA password or session string into an AI chat, a command line, or Git. Never copy a session file to another computer. Never run pip install telegram-mcp: that name on PyPI is a different project. Use only github.com/chigwell/telegram-mcp.
Quick start
- Get your own Telegram API id and hash at my.telegram.org/apps. Keep them private.
- Give your agent the prompt below. It installs and starts the server and asks you for the login code. Type the code only into the private local login window.
- Start with read-only tools. Turn on sending later, only if you want it.
Done when: your AI client lists Telegram tools and a cheap check (get_me) shows your own name.
The setup skills install with one command. Claude Code, as a plugin:
/plugin marketplace add tonydzi/telegram-mcp-kit
/plugin install telegram-mcp-kit@telegram-mcp-kit
Any agent that reads Agent Skills (Claude Code, Codex, Cursor, Gemini CLI):
npx skills add tonydzi/telegram-mcp-kit
This installs the skills only. The Telegram MCP server itself is still installed by the steps in this README.
Want an AI agent to do it for you? Paste this to Claude Code / Codex / Cursor:
"Read the 'For AI agents' section of https://github.com/tonydzi/telegram-mcp-kit and set it up for me."
For AI agents
Preconditions
- Python 3.10 or newer (the upstream requirement), Git, optionally
uv. On Windows make sure python is not the Microsoft Store stub.
- A Claude Code and/or Codex install. The server speaks streamable HTTP at
http://127.0.0.1:<FREE_PORT>/mcp.
- Ask the human for: Telegram API id and API hash (they get them at my.telegram.org/apps), their phone number, and the login code and 2FA password when Telegram asks. The human types these into a private local window only. Never ask for them in chat, never put them in argv, a repo, a synced folder, a screenshot or shell history.
- Check first for an already working setup (running server, configured URL). Reuse it. Do not start a second owner of the same Telegram key.
Install
The server is upstream chigwell/telegram-mcp. This repo ships docs, a skill and old patches, not the server.
git clone https://github.com/chigwell/telegram-mcp
cd telegram-mcp
git remote get-url origin # must print https://github.com/chigwell/telegram-mcp
git checkout e55d9c7a66a8eb0855debb268a4ed5b63749af2d # commit this kit was checked against (24 Oct 2026)
Then create a separate virtualenv and install dependencies the way that commit documents (upstream ships uv.lock, poetry.lock, requirements.txt and its own README: follow them, do not guess).
Install the portable skill from this repo, only the directory skills/telegram-connect/:
git clone https://github.com/tonydzi/telegram-mcp-kit
mkdir -p ~/.claude/skills/telegram-connect # for Codex: ~/.codex/skills/telegram-connect
cp telegram-mcp-kit/skills/telegram-connect/SKILL.md ~/.claude/skills/telegram-connect/SKILL.md
Windows PowerShell:
git clone https://github.com/tonydzi/telegram-mcp-kit
New-Item -ItemType Directory -Force "$HOME\.claude\skills\telegram-connect"
Copy-Item telegram-mcp-kit\skills\telegram-connect\SKILL.md "$HOME\.claude\skills\telegram-connect\SKILL.md"
If telegram-connect already exists, compare and back it up before overwriting.
The patches/ folder targets an old upstream commit (a008ac2). Do not apply it to current upstream. One exception: 0002-extra-tools-multiaccount.upstream-5960872.patch is the same extra tools (chats.py and messages.py only) rebuilt for upstream commit 5960872; check it with git apply --check on that exact commit.