Run Telegram ad campaigns from Claude, ChatGPT or Cursor with an MCP server
Telegram has a large audience that classic ad platforms barely reach: people who use bots, groups and channels every day. MGRAM is an ad network inside Telegram, and it ships a hosted MCP server, so an AI assistant can r
Telegram has a large audience that classic ad platforms barely reach: people who use bots, groups and channels every day. MGRAM is an ad network inside Telegram, and it ships a hosted MCP server, so an AI assistant can run campaigns for you:
- Bot broadcasts: your post arrives as a regular message from a bot the person already uses.
- Reply Ads: a short ad right after a bot's answer or a message in a group.
- Channel and group subscribers and bot or Mini App starts, paid per confirmed action.
The server is at https://mcp.mgram.biz/mcp (Streamable HTTP, OAuth 2.1) and is listed in the official MCP Registry as io.github.mgram-web/mgram.
Connect it
Claude (claude.ai and Claude Desktop): Settings โ Connectors โ Add custom connector โ URL https://mcp.mgram.biz/mcp โ Connect, then sign in to MGRAM with Telegram or e-mail.
Claude Code
claude mcp add --transport http mgram https://mcp.mgram.biz/mcp
Then /mcp โ mgram โ Authenticate.
ChatGPT: Settings โ Apps & Connectors โ Advanced โ developer mode โ Create, URL https://mcp.mgram.biz/mcp, authentication OAuth.
Cursor (~/.cursor/mcp.json) and VS Code (.vscode/mcp.json):
{ "mcpServers": { "mgram": { "url": "https://mcp.mgram.biz/mcp" } } }
{ "servers": { "mgram": { "type": "http", "url": "https://mcp.mgram.biz/mcp" } } }
When you connect, MGRAM asks which permissions to give (read, orders, top-ups, tracking links) and lets you set a daily spending limit for this connection. Clients without OAuth can use a personal key from the panel (Settings โ AI assistants) as a Bearer token.
How spending is kept safe
Money is the part that worries people about agents, so the server is built around one rule: every spending tool needs a fresh quote and an explicit confirmation.
- The assistant calls a
quote_*tool (quote_mailing,quote_impressions,quote_subscribers,quote_bot_starts). Nothing is charged; it returns the exact price and a one-timequote_id. - It shows you the quote and waits for your yes.
- Only then it calls the matching
create_*tool with thatquote_idandconfirm=true.
On top of that, the connection's daily limit and switched-off services are enforced by the server itself, not by the prompt. Withdrawals and account security settings are not reachable through MCP at all. Texts that come back from MGRAM (channel names, post texts, click data) are written by other people, and the server's instructions tell the model to treat them as data, never as commands.
What you can ask
- "How much would it cost to reach 10,000 users of crypto bots in Uzbekistan? Show me the quote."
- "Write a post for my channel in its style, show me the preview, then quote 500 subscribers and wait for my yes."
- "Which of my last three campaigns brought the cheapest clicks? Put the rest of the budget there."
- "Make a tracking link for the post button. Later: how many people reached the bot through it?"
The assistant has 60+ tools: estimates and audience comparisons without spending (estimate_mailing, compare_mailing_variants), posts with premium emoji, buttons and media (save_post, set_post_media, submit_post), budgets for a goal, short tracking links with funnel steps (create_utm_link, get_utm_stats), market trends by topic and per-order performance. At the start of a chat it calls get_updates and tells you what changed since last time: finished orders, moderation results, top-ups.
Why MCP and not just an API
The same things are available in the web panel and through the API. MCP is simply the fastest way to run experiments: you describe the goal in plain words, the assistant compares variants on real MGRAM data, shows numbers, and you approve the one you like. It also works the other way: if you own a bot and want to earn from ads in it, see the Python and JavaScript SDKs.
Links
- MCP guide with the full tool list: github.com/mgram-web/mgram-sdk/tree/main/mcp
- Step-by-step article: Telegram ads with ChatGPT and Claude
- Telegram bot: @mgram ยท [email protected]
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.