Telegram MCP
Personal read-only Telegram MCP server exposing chat, message, and media tools via streamable HTTP with bearer authentication.
README
title: Telegram MCP (personal, read-only) emoji: 📬 colorFrom: blue colorTo: green sdk: docker app_port: 7860 pinned: false license: apache-2.0 short_description: Personal Telegram MCP, read-only, bearer auth
Telegram MCP — personal remote bridge
A self-hosted bridge that exposes chigwell/telegram-mcp (Telethon-based) as a remote MCP server over streamable HTTP.
- Userbot — runs under your personal Telegram account via MTProto (Telethon), not the Bot API. No bot needed, no chat to add.
- Read-only —
TELEGRAM_EXPOSED_TOOLS=read-only. Only the ~30 read tools are exposed (list chats, read messages, search, download media, etc.). Send/edit/delete/group-admin tools are not registered. - Bearer-token gated — Caddy in front of the streamable HTTP server rejects every request without
Authorization: Bearer <MCP_BEARER_TOKEN>.
Endpoint
https://francescomiliani-telegram-mcp.hf.space/mcp (streamable HTTP, MCP spec 2025-03-26).
Required Space secrets
Configure these in the Space's Settings → Variables and secrets:
| Name | Value | Where to get it |
|---|---|---|
TELEGRAM_API_ID |
int | https://my.telegram.org/apps |
TELEGRAM_API_HASH |
string | https://my.telegram.org/apps |
TELEGRAM_SESSION_STRING |
long base64-ish string | Generate locally with uv run session_string_generator.py --qr from chigwell/telegram-mcp |
MCP_BEARER_TOKEN |
long random string | openssl rand -hex 32 |
TELEGRAM_EXPOSED_TOOLS=read-only is set as a default Space variable (not secret).
Connecting from an MCP client
# Claude Code
claude mcp add --transport http telegram \
https://francescomiliani-telegram-mcp.hf.space/mcp \
--header "Authorization: Bearer $MCP_BEARER_TOKEN"
# Codex
codex mcp add telegram \
--url https://francescomiliani-telegram-mcp.hf.space/mcp \
--header "Authorization: Bearer $MCP_BEARER_TOKEN"
For stdio-only clients (Claude Desktop, some Windsurf builds), bridge through mcp-remote:
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://francescomiliani-telegram-mcp.hf.space/mcp",
"--header", "Authorization: Bearer ${MCP_BEARER_TOKEN}"],
"env": { "MCP_BEARER_TOKEN": "<your-token>" }
}
}
}
Security
- The Space URL is public. The bearer token is the only thing standing between the public internet and your Telegram account.
- Treat
TELEGRAM_SESSION_STRINGlike a password — anyone with it can read/write your account. - Free HF Spaces sleep after 48h of inactivity. The session is preserved (string-session mode), so the next request just wakes the container and reconnects. Expect a 20–40s cold start.
Architecture
internet ──HTTPS──▶ Caddy :7860 ──(bearer check)──▶ main.py :8765 ──(Telethon/MTProto)──▶ Telegram
│ │
└─ 401 if no/bad bearer └─ streamable HTTP MCP, /mcp endpoint
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.