1. Conduid
  2. Communication
  3. Tg MCP
MCP server · Communication

Tg MCP

MCP server that connects AI assistants to Telegram via MTProto API. Let AI read your messages, send replies, manage chats — all through natural language.

Unclaimed MIT last commit 10 months ago comms
53Fair

Scored 7 days ago · breakdown

About Tg MCP

Tg MCP is an MCP server published by ogk-code in the Communication category: mCP server that connects AI assistants to Telegram via MTProto API. Let AI read your messages, send replies, manage chats — all through natural language.

The repository has 1 stars and 0 forks, with the last commit 10 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/ogk-code/tg-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (10)

auth_logoutLogout and clear session

Parameters not published.

auth_send_codeSend login code to phone

Parameters not published.

auth_statusCheck authorization status

Parameters not published.

auth_submit_codeSubmit code (with optional 2FA password)

Parameters not published.

delete_chatDelete a chat/dialog

Parameters not published.

get_chats_overviewGet all chats with recent messages in one request

Parameters not published.

get_messagesGet messages from a specific chat

Parameters not published.

leave_channelLeave a channel or group

Parameters not published.

list_chatsGet list of dialogs with unread counts

Parameters not published.

send_messageSend a message to a chat

Parameters not published.

Ask AI

✦

Ask AI about Tg MCP

Powered by Claude · Grounded in docs

I know everything about Tg MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 15 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

tg-mcp

MCP server that connects AI assistants to Telegram via MTProto API.

Built with gotd/td and go-sdk.

Features

  • Authentication: Login with phone number and 2FA support
  • Messages: Send and read messages
  • Chats: List dialogs, get chat overview with recent messages
  • Management: Leave channels/groups, delete chats

Available Tools

Tool Description
auth_status Check authorization status
auth_send_code Send login code to phone
auth_submit_code Submit code (with optional 2FA password)
auth_logout Logout and clear session
list_chats Get list of dialogs with unread counts
get_chats_overview Get all chats with recent messages in one request
get_messages Get messages from a specific chat
send_message Send a message to a chat
leave_channel Leave a channel or group
delete_chat Delete a chat/dialog

Installation

Prerequisites

  1. Go 1.21+
  2. Telegram API credentials from https://my.telegram.org/apps

Build

git clone https://github.com/yourusername/tg-mcp.git
cd tg-mcp
go build -o tg-mcp .

Cross-compile for Windows:

GOOS=windows GOARCH=amd64 go build -o tg-mcp.exe .

Configuration

Claude Desktop

Add to claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "telegram": {
      "command": "/path/to/tg-mcp",
      "args": [],
      "env": {
        "TG_APP_ID": "your_app_id",
        "TG_APP_HASH": "your_app_hash"
      }
    }
  }
}

Windows example:

{
  "mcpServers": {
    "telegram": {
      "command": "C:\\Users\\YourName\\tg-mcp.exe",
      "args": [],
      "env": {
        "TG_APP_ID": "your_app_id",
        "TG_APP_HASH": "your_app_hash"
      }
    }
  }
}

Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "telegram": {
      "type": "stdio",
      "command": "/path/to/tg-mcp",
      "env": {
        "TG_APP_ID": "your_app_id",
        "TG_APP_HASH": "your_app_hash"
      }
    }
  }
}

Open WebUI (via mcpo)

Use mcpo to expose as OpenAPI:

pip install mcpo
TG_APP_ID=your_id TG_APP_HASH=your_hash mcpo --port 8000 -- /path/to/tg-mcp

Then add http://localhost:8000 as OpenAPI server in Open WebUI.

Environment Variables

Variable Required Description
TG_APP_ID Yes Telegram API ID
TG_APP_HASH Yes Telegram API Hash
TG_SESSION_FILE No Custom session file path (default: ~/.tg-mcp-session.json)

Usage

After configuring, restart your MCP client (Claude Desktop, Claude Code, etc.).

First-time Authorization

  1. Use auth_send_code with your phone number
  2. You'll receive a code in Telegram
  3. Use auth_submit_code with the code (and password if 2FA is enabled)
  4. Done! Session is saved for future use

Example Prompts

  • "Show me my recent Telegram chats"
  • "Send a message to @username saying hello"
  • "What are my unread messages?"
  • "Leave the channel @spamchannel"

Security

  • Session file (~/.tg-mcp-session.json) contains your auth key — keep it private!
  • APP_ID/APP_HASH are not sensitive — they identify the app, not your account
  • Uses MTProto (user API), not Bot API — full account access

License

MIT

README fetched from the repository 15 hours ago. The original is authoritative.

Questions

About Tg MCP

How do I install Tg MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Tg MCP safe to use with an AI agent?

Its trust score is 53 out of 100 (fair). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Tg MCP still maintained?

The last commit was 10 months ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.