
aiogram-mcp
io.github.Py2755Published by GitHub account Py2755v0.7.1Updated Oct 25, 2026
MCP server for aiogram Telegram bots — 30 tools, 7 resources, 3 prompts, event streaming
Overview
Turns an existing aiogram Telegram bot into an MCP server so an AI assistant can send messages, manage chats and react to events.
- What you can do
- Send, forward, delete and pin messages, photos, documents, voice, video, stickers, polls, contacts and locations, and build inline keyboard menus with edits and callback answers. Look up bot, chat and member information, member counts and user profile photos. Moderate chats by banning or unbanning users and changing chat title and description. Subscribe to real-time Telegram events pushed as MCP notifications, and optionally broadcast to many chats. Read resources for bot info, config, chat lists, message history, event queue, file metadata and an audit log, plus moderation, announcement and user report prompts.
- When to use it
- Use it when you already run an aiogram bot and want an AI client such as Claude Desktop to operate that same bot: answering and sending messages, running moderation, posting announcements, or building interactive button flows without rewriting handlers.
- Requirements
- Runs locally as a stdio process started alongside your bot (Python 3.10+ and aiogram 3.20+, installable via pip or uvx). Needs a Telegram Bot API token supplied in the BOT_TOKEN environment variable, and the bot code must add the middleware and MCP server. Network access to Telegram is required.
Installation
In SourceWeft
- Open aiogram-mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
aiogram-mcp
[CI] [Python 3.10+] [License: MIT] [PyPI version] [MCP Registry]
Connect your Telegram bot to AI agents via the Model Context Protocol.
aiogram-mcp turns any aiogram bot into an MCP server. AI clients like Claude Desktop can then send messages, read chat history, build interactive menus, and react to events in real time — all through your existing bot, without rewriting a single handler.
Why aiogram-mcp?
Most Telegram MCP servers are thin wrappers with 3-5 tools. aiogram-mcp goes further:
- 30 tools — messaging, rich media, moderation, interactive keyboards, event subscriptions, broadcasting
- 7 resources — bot info, config, chat lists, message history, event queue, file metadata, audit log
- 3 prompts — ready-made moderation, announcement, and user report workflows
- Structured output — every tool returns typed Pydantic models with
outputSchemafor programmatic parsing - Real-time events — the bot pushes Telegram events to AI clients via MCP notifications (no polling)
- Interactive messages — AI agents create inline keyboard menus, handle button presses, edit messages
- Rate limiting — built-in token bucket prevents Telegram 429 errors
- Permission levels — restrict AI agents to read-only, messaging, moderation, or full admin access
- Audit logging — track every tool invocation with timestamps and arguments
- Zero rewrite — add 5 lines to your existing bot, keep all your handlers
How It Works
The bot runs normally for Telegram users. The MCP server runs alongside it, giving AI agents access to the same bot via tools and resources.
Installation
Requires Python 3.10+ and aiogram 3.20+.
Quickstart
1. Add aiogram-mcp to your bot
2. Connect Claude Desktop
Add to your claude_desktop_config.json:
Now Claude can send messages, read history, create button menus, and react to events in your Telegram bot.
Built-in Tools
Messaging (5 tools)
Interactive Messages (3 tools)
Users (3 tools)
Chats (6 tools)
Rich Media (10 tools)
Events (2 tools)
Broadcast (1 tool, opt-in)
MCP Resources
Read-only data that AI agents can access without calling tools:
MCP Prompts
Pre-built workflows that give AI agents structured context:
Real-time Event Streaming
AI agents don't need to poll. The bot pushes events automatically:
The AI agent calls subscribe_events once, then receives push notifications whenever new events match its filters.
Interactive Messages
AI agents can build full interactive UIs in Telegram — menus, confirmations, multi-step wizards:
The AI agent sends a message with buttons:
User taps a button → event appears in the queue → AI agent reacts:
The bot needs dp.callback_query.middleware(middleware) to capture button presses.
Safety Controls
allowed_chat_ids— AI can only interact with listed chats. Default: all chats.enable_broadcast— broadcast tool is disabled by default as a safety measure.max_broadcast_recipients— caps the number of chats in a single broadcast.
Advanced Configuration
Rate Limiting
Built-in token bucket rate limiter prevents Telegram 429 errors. All outgoing API calls are automatically paced.
Permission Levels
Audit Log
Every tool invocation is logged. Access via telegram://audit/log resource.
Examples
Development
License
MIT. See LICENSE.
Source: README.md at commit a5ae934
Tools
0Version history
1- v0.7.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts