Godmode Telegram MCP
Provides full Telegram client capabilities via Telethon (User API/MTProto), enabling reading recent channel messages, keyword search across subscribed channels, channel info and stats, joining/leaving and muting channels, downloading media, message history, reactions, comments, forwarding, marking read, folder management, and analytics such as channel comparison, duplicate detection, inactive channel discovery, top posts, and engagement rankings.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Godmode Telegram MCP
MCP server that exposes full Telegram client capabilities to AI assistants (Claude Code, Perplexity, and other MCP-compatible clients). Uses Telethon (User API / MTProto) for channel reading, message search, reactions, folder management, and analytics across your subscribed channels.
Prerequisites
macOS (Apple Silicon or Intel)
Python 3.11+
Telegram API credentials (
api_idandapi_hashfrom my.telegram.org)Your phone number registered with Telegram
Related MCP server: Telegram MCP Server
Setup
1. Install Python 3.11+ (skip if already installed)
Open Terminal (press Cmd + Space, type "Terminal", press Enter).
Check if Python 3.11+ is already installed:
python3.11 --versionIf you see Python 3.11.x or higher — skip to step 2. If you see "command not found":
# Install Homebrew (macOS package manager) if you don't have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3.11:
brew install python@3.11After installation, note the path — you'll need it later:
which python3.11This will show something like /opt/homebrew/bin/python3.11 (Apple Silicon) or /usr/local/bin/python3.11 (Intel Mac). Save this path.
2. Clone and install
git clone https://github.com/Todmy/godmode-telegram-mcp.git
cd godmode-telegram-mcp
python3.11 -m pip install -e .3. Get Telegram API credentials
Open my.telegram.org in your browser
Log in with your phone number (international format, e.g.
+380501234567)Telegram will send a code to your Telegram app — enter it on the website
Click "API development tools"
Fill in the form:
App title: anything (e.g. "My MCP")
Short name: anything (e.g. "mymcp")
Platform: can leave default
Click Create application
You will see App api_id (a number) and App api_hash (a long hex string) — copy both
4. Configure
Back in Terminal, create the config:
mkdir -p ~/.tg-mcp
cp .env.example ~/.tg-mcp/.envOpen the config file in a text editor:
open -e ~/.tg-mcp/.envFill in your credentials:
TG_API_ID=12345678
TG_API_HASH=0123456789abcdef0123456789abcdef
TG_PHONE=+380501234567Replace with your actual values from step 3. Save and close the file.
5. Authenticate with Telegram
This is a one-time step. Telegram will send a verification code to your phone:
python3.11 -m tg_mcp.authEnter the code from Telegram when prompted
If you have two-factor authentication (2FA) enabled, you'll also be asked for your password
After successful auth, a session file is created at ~/.tg-mcp/session.session. You won't need to authenticate again unless you revoke the session.
6. Connect to your AI client
Requires the Perplexity Mac app from the App Store.
6a. Find your Python path
In Terminal, run:
which python3.11Copy the full path (e.g. /opt/homebrew/bin/python3.11).
Why this matters: Perplexity runs in a macOS sandbox and may find a different Python than the one you installed packages to. Using the full path ensures it finds the right one.
6b. Add the connector in Perplexity
Open Perplexity → click your avatar (bottom-left) → Settings
Go to MCP (or Connectors) in the sidebar
If prompted to install PerplexityXPC helper — click Install and follow the instructions. This is required for Perplexity to run local programs.
Click "Add" (or "+")
Stay on the Simple tab
Fill in:
Server Name:
godmode-telegram-mcpCommand: your full Python path +
-m tg_mcp, for example:/opt/homebrew/bin/python3.11 -m tg_mcpEnvironment Variables: leave empty (credentials are loaded from
~/.tg-mcp/.envautomatically)
Click Save
Wait a few seconds — the status should change to Running (green)
6c. Enable the connector
Go back to the Perplexity home screen. Under the search bar, click Sources and enable godmode-telegram-mcp.
Now you can ask Perplexity things like:
"Show me recent messages from @channel_name"
"Search my Telegram channels for AI governance"
"Which of my channels had the most engagement this week?"
Troubleshooting Perplexity
Error | Cause | Fix |
| Wrong Python path | Run |
| Command is incomplete | Make sure the command includes |
| PerplexityXPC not installed | Go to Settings → MCP and install the PerplexityXPC helper |
Connector stuck on "Starting" | First connection to Telegram | Be patient — the first run may take 10-15 seconds to connect |
Add to your Claude Code MCP settings (~/.claude/settings.json):
{
"mcpServers": {
"godmode-telegram-mcp": {
"command": "python3.11",
"args": ["-m", "tg_mcp"]
}
}
}Any MCP client that supports stdio transport can use this server. The command to run:
python3.11 -m tg_mcpRefer to your client's documentation for how to register an MCP server with a shell command.
Usage
The server exposes 5 MCP tools. Two are shortcuts for common tasks, three implement the dynamic toolsets pattern for 23 operations.
Quick examples
Read recent messages from a channel:
tg_feed channel="@llm_under_hood" hours=24List all subscribed channels sorted by activity:
tg_overview sort=activityFind an operation by keyword:
tg_search_ops query="react"Get operation details:
tg_describe_op name="react_to_message"Execute an operation:
tg_execute op="search_messages" params={"query": "AI governance", "hours": 168}MCP Tools
Tool | Purpose |
| Read channel messages with time window, field selection, truncation |
| Channel/folder overview with sorting, filtering, metrics |
| Search the operations catalog by keyword or category |
| Get full schema and usage for a specific operation |
| Execute any operation with parameter validation |
Available Operations (23)
Channels
Operation | Description |
| List all subscribed channels and groups with basic info |
| Detailed info: description, admins, creation date, subscribers |
| Activity stats: post frequency, avg views, engagement rate |
| Join a channel by @handle or t.me link |
| Leave a channel (destructive, requires |
| Mute or unmute channel notifications |
Messages
Operation | Description |
| Keyword search across all or specific channels |
| Fetch single message with full content and media metadata |
| Download a message's attached file to disk (default |
| Paginated message history for a channel |
| Find which channel posted about a topic first |
Interactions
Operation | Description |
| Add emoji reaction to a message |
| Post comment in channel discussion thread |
| Forward message to Saved Messages or specified chat |
| Mark all messages in a channel as read |
Folders
Operation | Description |
| List all Telegram folders with channel counts |
| List channels in a specific folder |
| Move a channel into a folder |
| Create a new empty folder |
Analytics
Operation | Description |
| Side-by-side metrics for 2+ channels |
| Detect cross-posted content by text similarity |
| Find channels with no posts in N days |
| Highest-engagement messages across channels |
| Rank channels by engagement rate |
Troubleshooting
Problem | Cause | Fix |
| Missing config file | Run |
| Empty or missing API ID | Get credentials from my.telegram.org |
| Auth not completed | Run |
| Expired or revoked session | Re-run |
| Network issue or Telegram down | Check internet connectivity, retry |
| Too many requests | Wait the indicated time, then retry |
| File permissions too open | Run |
Architecture
The server uses the Speakeasy Dynamic Toolsets pattern: 5 static MCP tools keep the tool list small (token-efficient), while 23 operations are discoverable through tg_search_ops / tg_describe_op / tg_execute. List responses use the TOON format for 30-60% token reduction vs JSON.
Data Locations
Path | Contents |
| API credentials |
| Telethon session (auth state) |
| SQLite cache (channels, messages) |
| Structured JSON logs |
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Telegram automation for AI: read and search channel summaries, get digests, manage auto-publishing.
Telegram for AI agents, no login: keyword search, channel posts, comments, username lookup.
Your personal Telegram account for AI: read, search and sum up chats. QR login, no API key.
Live Telegram data: trending topics, channel profiles & metrics, post history incl. edits/deletions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with a user's Telegram account: list chats, read history, search, and send messages through Telegram's MTProto API.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a personal Telegram account for sending/reading messages, media, group management, and more via the MTProto API.MIT
- AlicenseNot gradedqualityCmaintenanceRead public Telegram channels from AI agents — channel metadata, posts, comments, and search. No MTProto, no Telethon, no api_id.1MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to manage Telegram files, messages, and dialogs directly via MTProto, supporting upload, download, search, forwarding, and storage overview operations.19MIT