telegram-api-mcp
This server is a comprehensive MCP interface to the Telegram Bot API v10.2, exposing all 185 methods for messaging, chat and user management, media, stickers, forums, and more.
Messaging: Send text with HTML/Markdown/MarkdownV2 formatting; rich messages up to 32,768 characters with headings, tables, lists, collages, footnotes, and up to 50 inline media; photos, audio, documents, videos, animations, voice notes, video notes, paid media, media groups, locations, venues, contacts, polls, dice, stickers, and checklists; set chat actions and message reactions; forward/copy messages.
Message editing/deletion: Edit text, captions, media, reply markup, live locations, and checklists; stop polls; delete single or multiple messages.
Chat and member management: Get chat info, administrators, member counts, and members; ban/unban/restrict/promote users; set custom admin titles and tags; manage chat photos, titles, descriptions, permissions, and sticker sets; pin/unpin messages; leave chat.
Invite links and join requests: Create, edit, revoke, and export invite links; create subscription invite links; approve/decline join requests; get user chat boosts.
Forum topics: Create, edit, close, reopen, and delete topics; manage the general topic; pin/unpin and unpin all messages in topics.
Bot self-management: getMe, log out, close; set/get commands, name, description, short description, and default administrator rights; manage profile photo; get user profile photos and audio tracks.
Stickers and files: Send stickers, get sticker sets, get custom emoji stickers, upload sticker files, create/add to sticker sets; get file info for downloads.
Updates & webhooks: Get updates, set/delete webhooks, get webhook info (available via meta-mode).
Meta-mode: Use only
telegram_findandtelegram_callto access all 185 methods with ~99% context token savings.Formatting guidance: Built-in
telegram_formattool and resources explain syntax for rich messages, media, and reply markup.Reliability & security: Rate limiting (global and per-chat), circuit breaker with auto-recovery, retries with exponential backoff respecting Telegram 429, Zod validation, token masking, file upload path traversal protection, and response truncation.
Provides full access to 169 Telegram Bot API methods for managing messages, media, polls, chats, forums, stickers, payments, business, stories, gifts, games, inline, managed bots, and more.
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-api-mcpsend a poll 'Best language?' with options Python, JavaScript, Rust"
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-api-mcp
Ultimate MCP server for Telegram Bot API — 185 methods, full v10.2 coverage, rich messages, meta-mode, rate limiting, circuit breaker.
185/185 Bot API methods with Zod validation, token masking, tool annotations, and zero bloat (2 dependencies).
Features
185/185 Bot API methods — messages, media, polls, chats, forums, stickers, payments, business, stories, gifts, games, inline, managed bots
Rich messages — post up to 32768 characters with headings, tables, lists, collages, slideshows, footnotes and up to 50 inline media, instead of the 1024-character caption ceiling
Bot API 10.2 (July 2026) — rich messages, ephemeral messages, live photos, guest mode, join-request queries, poll media
telegram_formattool — the server explains the exact shape ofrich_message,media,reply_markup,polland more before you send, so an agent never has to guess the syntax (also exposed as MCP resources undertelegram://format/…)Meta-mode — 2 tools instead of 185, saves ~99% context tokens
Rate limiting — global (30 req/sec) + per-chat (20 msg/min), token bucket with async mutex
Circuit breaker — 3-state (closed/open/half-open), auto-recovery
Retry with backoff — respects Telegram 429
retry_after, exponential backoff on 5xxZod validation — every parameter validated before hitting Telegram API
Token masking — bot token never appears in responses, logs, or error messages
File upload security — path traversal protection, configurable allowed directories
Tool annotations — all 185 methods annotated (readOnly, destructive, idempotent, openWorld)
Docs mirror + audit —
npm run docs:refreshre-downloads the official spec,npm run auditfails if any method or parameter drifts from itResponse truncation — 100K char limit to prevent context overflow
Zero bloat — only 2 dependencies:
@modelcontextprotocol/sdk+zod
Related MCP server: telegram-bot-mcp
Quick Start
Claude Code
claude mcp add telegram -- npx telegram-api-mcp -e TELEGRAM_BOT_TOKEN=your_tokenWith meta-mode (recommended for large conversations):
claude mcp add telegram -- npx telegram-api-mcp \
-e TELEGRAM_BOT_TOKEN=your_token \
-e TELEGRAM_META_MODE=trueClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["telegram-api-mcp"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_token_from_botfather"
}
}
}
}With default chat (skip chat_id in every call)
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["telegram-api-mcp"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_token",
"TELEGRAM_DEFAULT_CHAT_ID": "-1001234567890"
}
}
}
}From source
git clone https://github.com/timoncool/telegram-api-mcp.git
cd telegram-api-mcp
npm install && npm run build
TELEGRAM_BOT_TOKEN=your_token node dist/index.jsEnvironment Variables
Variable | Required | Default | Description |
| Yes | — | Bot token from @BotFather |
| No | — | Default chat ID for all tools |
| No | — | Default forum topic thread ID |
| No |
| Use 2 meta-tools instead of 185 |
| No |
| Max requests/sec (Telegram limit) |
| No |
| Max messages/min per group (Telegram limit) |
| No |
| Retry attempts on transient errors |
| No |
| Failures before circuit opens |
| No |
| Circuit breaker cooldown (ms) |
| No | — | Comma-separated allowed upload paths |
| No |
| Max upload file size (50MB) |
Meta Mode
When TELEGRAM_META_MODE=true, the server exposes only 2 tools instead of 185:
telegram_find— search methods by keyword or categorytelegram_call— call any method by name with JSON params
This saves ~99% of context tokens while keeping full API access:
User: "Post a poll in my channel"
AI: → telegram_find(query: "poll")
AI: → telegram_call(method: "sendPoll", params: { chat_id: ..., question: "...", options: [...] })API Coverage
185/185 methods — 100% Bot API 10.2 (July 2026)
Category | Count | Key methods |
Bot | 21 | getMe, setMyCommands, setMyProfilePhoto, getFile, getUserProfilePhotos |
Chat | 18 | getChat, setChatTitle, pinChatMessage, answerChatJoinRequestQuery, getUserPersonalChatMessages |
Stickers | 16 | sendSticker, createNewStickerSet, uploadStickerFile, setStickerKeywords |
Editing | 15 | editMessageText, editMessageMedia, deleteMessage, editEphemeralMessageText, deleteEphemeralMessage |
Business | 14 | readBusinessMessage, setBusinessAccountName, getBusinessAccountGifts, approveSuggestedPost |
Messages | 13 | sendMessage, sendRichMessage, sendRichMessageDraft, sendChecklist, deleteMessageReaction |
Forum | 13 | createForumTopic, editForumTopic, closeForumTopic, deleteForumTopic |
Media | 10 | sendPhoto, sendVideo, sendLivePhoto, sendMediaGroup, sendPaidMedia |
Members | 9 | banChatMember, promoteChatMember, setChatMemberTag, restrictChatMember |
Invite | 8 | createChatInviteLink, createChatSubscriptionInviteLink, approveChatJoinRequest |
Payments | 8 | sendInvoice, createInvoiceLink, getStarTransactions, getMyStarBalance |
Gifts | 8 | sendGift, getUserGifts, getChatGifts, giftPremiumSubscription, upgradeGift |
Inline | 5 | answerInlineQuery, answerCallbackQuery, answerGuestQuery, answerWebAppQuery |
Managed Bots | 5 | getManagedBotToken, getManagedBotAccessSettings, setManagedBotAccessSettings |
Other | 5 | verifyUser, verifyChat, setUserEmojiStatus, savePreparedInlineMessage |
Forwarding | 4 | forwardMessage, forwardMessages, copyMessage, copyMessages |
Stories | 4 | postStory, editStory, deleteStory, repostStory |
Updates | 4 | getUpdates, setWebhook, deleteWebhook, getWebhookInfo |
Games | 3 | sendGame, setGameScore, getGameHighScores |
Polls | 1 | sendPoll (revoting, shuffle, media, country restrictions) |
Passport | 1 | setPassportDataErrors |
Long posts: rich messages
send_photo and friends cap the caption at 1024 characters — that limit is set by Telegram and still applies. To publish a real post, use send_rich_message instead:
{
"chat_id": "@mychannel",
"rich_message": {
"markdown": "# Heading
Paragraph with **bold** and a [link](https://t.me).

| Model | Speed |
|:------|------:|
| A | **42** |
> Block quote
- List item
- Another item"
}
}Not sure of the syntax? Ask the server — it ships the reference:
telegram_format(topic: "rich_message")telegram_format also answers for caption, media, reply_markup, poll, checklist, reply_parameters, link_preview_options and suggested_post_parameters, by topic, by tool name (send_media_group), or in plain wording ("long post", "album", "buttons"). The same docs are served as MCP resources at telegram://format/<topic>.
Pass exactly one of markdown (GitHub-flavored, plus Telegram tags), html, or blocks. Limits enforced before the request leaves the server:
Limit | Value |
Text | 32768 characters |
Blocks (nested included) | 500 |
Media attachments | 50 |
Table columns | 20 |
Nesting levels | 16 |
Media inside markdown/html must be HTTP(S) URLs and sit in their own block. send_rich_message_draft streams a partial message as a 30-second preview while it is still being generated — finish with send_rich_message to persist it.
Architecture
src/
├── index.ts # Entry point
├── config.ts # Environment config with validation
├── server.ts # MCP server (standard + meta mode)
├── telegram-client.ts # HTTP client with retry, rate limit, circuit breaker
├── rate-limiter.ts # Token bucket: global + per-chat
├── circuit-breaker.ts # 3-state circuit breaker (closed/open/half-open)
├── method-registry.ts # Declarative method definitions + Zod schema builder
├── formats.ts # Reference for structured params, served by telegram_format
└── methods/
├── index.ts # Aggregator + search
├── messages.ts # sendMessage, sendDice, sendChecklist, ...
├── forwarding.ts # forwardMessage, copyMessage, ...
├── editing.ts # editMessageText, deleteMessage, ...
├── chat.ts # getChat, setChatTitle, banChatMember, ...
├── bot.ts # getMe, setMyCommands, getFile, ...
├── forum.ts # createForumTopic, editForumTopic, ...
├── stickers.ts # sendSticker, createNewStickerSet, ...
├── payments.ts # sendInvoice, getStarTransactions, ...
├── business.ts # readBusinessMessage, setBusinessAccount*, ...
├── stories.ts # postStory, editStory, deleteStory, ...
├── gifts.ts # sendGift, getUserGifts, convertGiftToStars, ...
├── games.ts # sendGame, setGameScore, ...
├── inline.ts # answerInlineQuery, answerCallbackQuery
├── managed-bots.ts # getManagedBotToken, replaceManagedBotToken
├── updates.ts # getUpdates, setWebhook, ...
├── passport.ts # setPassportDataErrors
└── other.ts # verifyUser, setChatMenuButton, ...
scripts/
├── refresh-docs.mjs # Re-download core.telegram.org/bots/* into docs/
└── audit-registry.mjs # Diff src/methods against the docs mirrorDesign principles
Declarative registry — each method is pure data (name, params, types, annotations). One generic handler serves all 185 methods. Adding a new method = one array entry.
Spec-checked —
docs/mirrors the official Bot API pages andscripts/audit-registry.mjsdiffs the registry against it, so a new Telegram release surfaces as a failing check rather than a runtime 400.Zod validation — every parameter validated before reaching Telegram. Clear error messages with hints instead of opaque API 400s.
Token bucket rate limiting — no race conditions (async mutex). Defaults match Telegram's official limits: 30 req/sec global, 20 msg/min per group.
Circuit breaker — 429 (rate limit) is NOT counted as failure. Only real errors (5xx, network) trip the breaker. Half-open probe recovers automatically.
Tool annotations — every method has MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) so AI clients know which tools are safe to auto-approve.
Response truncation — responses capped at 100K chars to prevent context window overflow.
Security
Bot token never appears in MCP tool responses or error messages (masked as
***)File upload paths validated against allowed directories (
TELEGRAM_ALLOWED_UPLOAD_DIRS)Path traversal attacks blocked (resolve + normalize + separator check)
No
eval(), noFunction(), no dynamic importsNo external requests except
api.telegram.orgNo telemetry, no analytics, no phone-home
Zero bloat: only 2 runtime dependencies (
@modelcontextprotocol/sdk+zod)
Development
npm install
npm run build # TypeScript compilation
npm run typecheck # Type checking without emit
npm test # Run all tests (vitest)
npm run test:watch # Watch mode
npm run lint # ESLint
npm run docs:refresh # Re-download the official Bot API docs into docs/
npm run audit # Diff the registry against the docs mirrorOther Projects by @timoncool
Project | Description |
Civitai API as MCP server | |
TRAIL — cross-MCP content tracking protocol | |
AI music studio — songs, vocals, covers, videos | |
AI video production in the browser | |
AI anti-spam bot for Telegram | |
Live-coding music platform |
Support the Author
I build open-source software and do AI research. Most of what I create is free and available to everyone. Your donations help me keep creating without worrying about where the next meal comes from =)
All donation methods | dalink.to/nerual_dreming | boosty.to/neuro_art
BTC:
1E7dHL22RpyhJGVpcvKdbyZgksSYkYeEBCETH (ERC20):
0xb5db65adf478983186d4897ba92fe2c25c594a0cUSDT (TRC20):
TQST9Lp2TjK6FiVkn4fwfGUee7NmkxEE7C
Star History
License
MIT
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
- FlicenseNot gradedqualityDmaintenanceAn MCP server that wraps the Telegram Bot API into semantic tools for LLM agents, supporting multi-bot management for sending and receiving messages. It enables agents to send text, photos, and documents, as well as fetch recent updates from multiple configured Telegram bots.
- AlicenseBqualityCmaintenanceFull-featured Telegram Bot API server for MCP (Model Context Protocol). 174 tools covering the entire Bot API — messages, chats, stickers, payments, forums, stories, and more.100587MIT
- AlicenseAqualityCmaintenanceMCP server that exposes a Telegram bot, enabling sending messages and retrieving updates through natural language.31MIT
- FlicenseAqualityCmaintenanceAn MCP server for interacting with Telegram bots and channels using the Telegraf library. It allows AI agents to send messages, manage channels, forward content, and intelligently respond to Telegram conversations.5248
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
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/timoncool/telegram-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server