telegram-notes-mcp
Enables semantic search over Telegram messages using embeddings generated by a local or self-hosted Ollama server, allowing meaning-based queries.
Provides tools for searching, syncing, and managing your own Telegram chats via full-text and semantic search, including listing whitelisted chats and retrieving message context.
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-notes-mcpfind the link about the new design system in my chats"
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-notes-mcp
A local MCP server that gives Claude Code (or any MCP client) full-text and semantic search over your own Telegram chats — via your personal MTProto (Telethon) login. Everything runs on your machine: your own Telegram session, your own SQLite database, your own (optional) Ollama server for embeddings. Nothing is sent to a third-party cloud unless you point it at one yourself.
Ask Claude things like "what did we decide about the deploy last Tuesday?" or "find that link someone shared about X" and get an answer grounded in your actual chat history — not a hallucination.
What's in here
Piece | What it does |
MCP server ( | Exposes search tools to Claude Code / any MCP client |
Web control panel ( | Local browser UI: status, sync, search, ask-Ollama, chat whitelist editor |
Topic analytics ( | Clusters conversation into "bursts", extracts links, labels topics via LLM |
Voice transcription ( | Transcribes voice/video messages via Telegram's built-in transcription (needs Premium) |
Cross-device sharing ( | Export/import the derived analytics layer between your own machines |
Only the MCP server needs to be registered with Claude Code — the rest are optional local tools you run yourself.
Related MCP server: mcp-telegram
MCP tools
Tool | Description |
| Full-text search (SQLite FTS5) |
| Search by meaning via embeddings, with rerank if a whitening index is trained |
| Whitelisted chats with message counts and last activity |
| Messages surrounding a specific message — useful to read the thread around a hit |
| Force an incremental re-sync of all whitelisted chats |
| Index one batch of messages without embeddings (call repeatedly while |
| Transcribe pending voice/video messages (requires Telegram Premium) |
Quick start — mini-app (Windows)
A standalone local app: control-panel window (no browser chrome) + a system tray icon, with Start Menu / Desktop shortcuts. After cloning:
powershell -ExecutionPolicy Bypass -File setup.ps1This creates a venv, installs dependencies (.[app,analytics]), makes a
.env from the template, and creates shortcuts. Then:
Fill in
.env— your ownTG_API_ID/TG_API_HASH(from my.telegram.org) andTG_CHAT_WHITELIST.Log in to your own Telegram:
.venv\Scripts\python.exe scripts\login.py(creates your local session + database — your chats only).Launch the telegram-notes shortcut → a window opens and a tray icon appears.
Panel without the tray (plain browser): .venv\Scripts\python.exe webui\panel.py.
More detail: webui/README.md.
Quick start — manual / macOS / Linux
Windows only: if your only Python is the Microsoft Store version (
where pythonpoints intoWindowsApps\...), install a regular Python from python.org (orwinget install Python.Python.3.13) and use that one below — the Store build has a known bug where the interactive login prompt can crash withEOFErroron a repeated code entry.Create a virtualenv and install the package:
Windows:
python -m venv .venv && .venv\Scripts\activatemacOS/Linux:
python3 -m venv .venv && source .venv/bin/activateThen:
pip install -e ".[dev]"
Create your own
api_id/api_hashat my.telegram.org → "API development tools" — pick any app name, it's free and instant. Don't reuse someone else'sapi_id/api_hash— see docs/prd/001-login-code-never-arrives.md for why that silently breaks login codes.Copy
.env.exampleto.envand fill inTG_API_ID/TG_API_HASHandTG_CHAT_WHITELIST(comma-separated usernames like@someoneand/or numeric chat ids like-1001234567890;me= your own Saved Messages).Run the one-time interactive login:
python scripts/login.py(asks for your phone number + the code Telegram sends you — check the Telegram app itself first, not just SMS; creates the.sessionfile atTG_SESSION_PATH).Register the server with Claude Code (see below).
Each machine (Windows, macOS, ...) does its own login and keeps its own
local .session file and SQLite database — nothing syncs between machines
unless you explicitly use the share.py export/import feature.
Configuration
All configuration lives in .env (see .env.example for the full list with
comments). Required: TG_API_ID, TG_API_HASH, TG_CHAT_WHITELIST.
Everything else — semantic search (TG_OLLAMA_URL / TG_EMBED_MODEL /
TG_OLLAMA_AUTH), analytics noise-filter (TG_OWN_BOT_USERNAME), and the
bot-message editor (TG_BOT_TOKEN) — is optional.
Registering with Claude Code
Preferred: use the CLI so it lands in whichever config file your Claude
Code version actually reads (this has moved between versions — don't
hand-edit ~/.claude/.mcp.json, it's not necessarily the file claude mcp list uses; check with claude mcp list after adding):
claude mcp add telegram-notes -- /absolute/path/to/telegram-notes-mcp/.venv/bin/python -m telegram_notes_mcp.serverOn Windows use the .venv\Scripts\python.exe path. A newly added
user-scope server may need a one-time approval — run claude mcp list and,
if it shows "Pending approval", approve it via claude mcp get telegram-notes or /mcp inside an interactive session.
Don't add a cwd field/flag — Claude Code silently ignores it and always
launches the server from wherever Claude Code itself was started, not this
directory. That's fine: config.py locates .env and resolves any
relative TG_SESSION_PATH/TG_DB_PATH by the project's own directory
(derived from this package's install location), not the process's current
working directory, so the server works correctly regardless of where the
MCP client actually launches it from.
Known issues and their fixes
If something doesn't work, check whether it's already documented:
docs/prd/001-login-code-never-arrives.md — login code never shows up
docs/prd/002-numeric-chat-id-not-resolving.md — a group/channel whitelisted by numeric id fails to sync
docs/prd/003-claude-code-mcp-registration.md — server doesn't show up in Claude Code after registering it
Running tests
pytest
Privacy
Your Telegram session (
.session), database (messages.db), and.envnever leave your machine and are git-ignored by default.Semantic search and Q&A require an Ollama server — point
TG_OLLAMA_URLat your own (local or self-hosted); no data goes to a third-party LLM API unless you configure one yourself.Only chats you explicitly list in
TG_CHAT_WHITELISTare ever synced.
License
MIT — see LICENSE.
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
- 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/RaspizDIYs/telegram-notes-mcp-public'
If you have feedback or need assistance with the MCP directory API, please join our Discord server