Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"my-telegram-bot": {
"env": {
"BOT_TOKEN": "123456:ABC-DEF..."
},
"args": [
"path/to/your/bot.py"
],
"command": "python"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Connect your Telegram bot to AI agents via the Model Context Protocol.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
uvx 'aiogram-mcp' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked aiogram-mcp against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in communication / developer-tools
Manage Supabase projects — databases, auth, storage, and edge functions
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
MCP server for using the GitLab API
MCP Security Weekly
Get CVE alerts and security updates for io.github.Py2755/aiogram-mcp and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
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.
Most Telegram MCP servers are thin wrappers with 3-5 tools. aiogram-mcp goes further:
outputSchema for programmatic parsingTelegram users Your aiogram bot AI agent (Claude Desktop)
| | |
| send messages, tap buttons | |
| --------------------------> | |
| | MCP server (stdio or SSE) |
| | <-------------------------> |
| | tools / resources / events |
| | |
| bot replies, shows menus | send_message, edit, ban |
| <-------------------------- | <--------------------------- |
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.
pip install aiogram-mcp
Requires Python 3.10+ and aiogram 3.20+.
import asyncio
from aiogram import Bot, Dispatcher
from aiogram_mcp import AiogramMCP, EventManager, MCPMiddleware
bot = Bot(token="YOUR_BOT_TOKEN")
dp = Dispatcher()
# Middleware tracks chats, users, message history, and events
event_manager = EventManager()
middleware = MCPMiddleware(event_manager=event_manager)
dp.message.middleware(middleware)
dp.callback_query.middleware(middleware) # for interactive buttons
# Register your normal handlers here
# @dp.message(...)
# async def my_handler(message): ...
# Create the MCP server
mcp = AiogramMCP(
bot=bot,
dp=dp,
name="my-bot",
middleware=middleware,
event_manager=event_manager,
allowed_chat_ids=[123456789], # optional: restrict which chats AI can access
)
async def main():
await mcp.run_alongside_bot(transport="stdio")
asyncio.run(main())
Add to your `cla