TG multi Account MCP logo

TG multi Account MCP

Self-hosted MCP access to multiple Telegram accounts and bots with scoped tokens, search, messaging, drafts, and attachment handling.

Install TG multi Account MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "tg-multi-account-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "tg-account-mcp",
        "tg-mcp"
      ],
      "env": {
        "TG_MCP_PORT": "YOUR_VALUE_HERE",
        "TG_MCP_STATE_DIR": "YOUR_VALUE_HERE",
        "TG_MCP_BIND": "YOUR_VALUE_HERE",
        "TG_MCP_TRUSTED_NETWORKS": "YOUR_VALUE_HERE",
        "TG_MCP_URL": "YOUR_VALUE_HERE",
        "TG_MCP_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx --from tg-account-mcp tg-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

TG multi-account MCP connects AI agents to explicitly selected Telegram user accounts and optional bots through a self-hosted MCP service. Accounts are linked locally with QR authentication and, when enabled, a Telegram 2FA password; each operation identifies its account or bot. It exposes Streamable HTTP with Bearer authentication for chat search, messages, attachments, drafts, updates, and sending. Reach for it when an agent needs controlled Telegram access across multiple accounts under operator-managed consent and permissions.

Use cases

  • Search Telegram folders and message history with an agent
  • Send scheduled or idempotent messages from selected accounts
  • Manage drafts, replies, reactions, and forwarded messages
  • Retrieve Telegram attachments for an approved workflow
  • Restrict agents to specific accounts, bots, and chats

Key features

  • Multi-account Telegram sessions with QR and 2FA onboarding
  • Optional BotFather bot connections
  • Streamable HTTP with Bearer authentication
  • Scoped agent tokens and identity or chat allowlists
  • Chat, folder, thread, attachment, and global search
  • Local semantic indexing with configurable storage rules

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 48d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · tg-account-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit4d agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.

How TG multi Account MCP works

What TG multi-account MCP does

TG multi-account MCP provides an MCP interface to Telegram user accounts and optionally connected bots. It is designed for agent operations rather than interactive Telegram use. Agents can discover accounts and bots, search chats and message history, inspect folders and discussion threads, retrieve attachments, follow updates, create drafts, and send or modify messages.

The service supports multiple independent user sessions. Each account has its own onboarding flow and local session, while bots are added separately using BotFather tokens. Account and bot actions require an explicit stable identifier, so the sender is not chosen implicitly.

Messaging capabilities include sending, editing, scheduling, forwarding, reactions, replies, and idempotency keys. Chat lookup supports Cyrillic and Latin transliteration matching. The service also includes project memory and local semantic indexing with a configurable embedding provider, along with separate text and attachment storage rules for RAG workflows.

How it works

Run the service locally or deploy it with Docker Compose and Caddy-managed HTTPS. The MCP endpoint uses Streamable HTTP and accepts a Bearer token. A generated administrative token can create narrower agent tokens with read, send, or admin scopes, account and bot restrictions, and chat allowlists. Agent token hashes are retained, while the plaintext token is shown only once.

The local web dashboard handles account management, including reconnecting, disabling, or deleting an account and its session. It also supports bot enrollment, searchable and paginated chat tables, RAG and S3 rule editing, and queue monitoring. Operations metadata is recorded without message text, passwords, queries, or tokens.

Setup and configuration

Python 3.12+, uv, and a Telegram api_id and api_hash are required. Install the published package with uv tool install tg-account-mcp, run tg-mcp setup, then start the service with tg-mcp serve. The setup command collects Telegram API credentials in the terminal and creates an MCP access token.

Open the local dashboard, scan its QR code from Telegram’s device-linking screen, enter the cloud password if Telegram 2FA is enabled, and assign a local display name. Repeat the wizard for additional accounts. Add bots independently through the dashboard.

The default state location is ~/.local/share/tg-mcp; use --state-dir or TG_MCP_STATE_DIR to change it. Configure clients with the /mcp URL and an Authorization: Bearer header. Clients that require OAuth and cannot set a Bearer header are not supported.

Tools and capabilities

Initial discovery can use get_capabilities, list_accounts, and list_bots. The broader tool set covers:

  • Chat, folder, message, topic, reply-thread, mention, attachment, and global search
  • Folder message retrieval with date ranges and IANA time zones
  • Sending, editing, scheduling, forwarding, reactions, drafts, and idempotent requests
  • Account and bot selection using stable IDs
  • Scoped token creation and revocation
  • Local semantic indexing, project memory, and configurable RAG or S3 rules
  • Queue speed, backlog, ETA, filtering, and pagination monitoring

A Codex plugin adds authenticated service discovery and workflows for chat resolution, summaries, pagination, attachments, drafts, and idempotent sending.

Limitations and notes

Telegram sessions can access their associated accounts, so protect the state directory and MCP tokens. Use separate agent tokens with only the permissions and identities each agent needs. Chat-limited tokens cannot use aggregate inbox, folder, or global-search tools because those tools may expose neighboring chats.

Operators must use their own Telegram API credentials and obtain informed, continuing consent before processing messages or files with AI systems. The integration is unofficial and is not affiliated with Telegram. A direct LAN configuration can bypass Bearer authentication for clients in configured private CIDR ranges, granting full administrative MCP access to those devices; it should not be exposed beyond a trusted network.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about TG multi Account MCP

TG multi-account MCP is an MCP server that connects AI agents to selected Telegram user accounts and optional bots. Its main tools cover account and bot discovery, chat and message search, folders, threads, attachments, drafts, updates, sending, editing, scheduling, forwarding, reactions, and scoped access control through a self-hosted Streamable HTTP service.

Install it with `uv tool install tg-account-mcp`, then run `tg-mcp setup` and `tg-mcp serve`. Python 3.12+, uv, and Telegram `api_id` and `api_hash` credentials are required. The setup flow creates an MCP access token, after which accounts can be linked through the local web dashboard.

Connect an account through the local dashboard by scanning its QR code from Telegram’s device-linking screen, entering the Telegram cloud password when 2FA is enabled, and choosing a local display name. Repeat the wizard for each additional user account; bots are added separately with BotFather tokens.

Create a separate agent token with `create_agent_token` and assign a `read`, `send`, or `admin` scope plus permitted account, bot, and chat IDs. Revoke it with `revoke_agent_token`. The administrative token is generated during setup, and agent token plaintext is returned only once.

Yes. The repository includes a Codex plugin with authenticated automatic service discovery and workflows for chat resolution, summaries, pagination, attachments, drafts, and idempotent sending. Set `TG_MCP_URL` for a specific HTTPS endpoint or provide `TG_MCP_TOKEN` when Codex runs under a different OS user or on another machine.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTG multi Account MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/tg-multi-account-mcp?style=directory)](https://allmcps.com/mcp/tg-multi-account-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/tg-multi-account-mcp"><img src="https://allmcps.com/api/badge/tg-multi-account-mcp?style=directory" alt="TG multi Account MCP on AllMCPs" /></a>