Cover image
Try Now
2025-03-20

3 years

Works with Finder

1

Github Watches

11

Github Forks

33

Github Stars

License: Apache 2.0 LinkedIn

Telegram MCP Server

A Telegram MCP (Model Context Protocol) server built using Python, Telethon, and MCP Python SDK. This MCP server provides simple tools for interacting with Telegram chats directly through MCP-compatible hosts, such as Claude for Desktop.

Tools Provided

  • get_chats: Retrieve a paginated list of your Telegram chats.
  • get_messages: Retrieve paginated messages from a specific chat.
  • send_message: Send a message to a specific chat.

Requirements

Installation and Setup

Clone the Repository

git clone https://github.com/chigwell/telegram-mcp
cd telegram-mcp

Create Environment File

Copy and rename .env.example to .env and fill it with your Telegram credentials obtained from https://my.telegram.org/apps:

cp .env.example .env

Your .env file should look like:

TELEGRAM_API_ID=your_api_id_here
TELEGRAM_API_HASH=your_api_hash_here
TELEGRAM_SESSION_NAME=your_session_name

Setup Python Environment

Use uv to set up the Python environment and install dependencies:

uv venv
source .venv/bin/activate
uv add "mcp[cli]" telethon python-dotenv nest_asyncio

Run the Server (First-time Auth)

The first time you run the server, Telethon will prompt you to enter a Telegram authentication code:

uv run main.py

Authenticate by entering the code sent to your Telegram client. This step is only required once.

Integrating with Claude for Desktop

macOS/Linux

Edit your Claude Desktop configuration:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

Add this MCP server configuration:

{
    "mcpServers": {
        "telegram-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE_PATH/telegram-mcp",
                "run",
                "main.py"
            ]
        }
    }
}

Ensure you replace /ABSOLUTE_PATH/telegram-mcp with your project's absolute path.

Windows

Edit your Claude Desktop configuration:

nano $env:AppData\Claude\claude_desktop_config.json

Add this MCP server configuration:

{
    "mcpServers": {
        "telegram-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "C:\\ABSOLUTE_PATH\\telegram-mcp",
                "run",
                "main.py"
            ]
        }
    }
}

Ensure you replace C:\ABSOLUTE_PATH\telegram-mcp with your project's absolute path.

Usage

Once integrated, your Telegram tools (get_chats, get_messages, and send_message) will become available within the Claude for Desktop UI or any other MCP-compatible client.

License

This project is licensed under the Apache 2.0 License.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • 1Panel-dev
  • 🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • GeyserMC
  • Une bibliothèque de communication avec un client / serveur Minecraft.

  • awslabs
  • Serveurs AWS MCP - Serveurs MCP spécialisés qui apportent les meilleures pratiques AWS directement à votre flux de travail de développement

  • appcypher
  • Serveurs MCP géniaux - une liste organisée de serveurs de protocole de contexte de modèle

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

    Reviews

    2 (1)
    Avatar
    user_XsVcbKny
    2025-04-17

    I have been using telegram-mcp and it has been a game-changer for me! Created by chigwell, this tool is incredibly useful for managing various tasks on Telegram efficiently. The setup was straightforward, and the functionality it offers has significantly improved my workflow. Highly recommend checking it out on GitHub: https://github.com/chigwell/telegram-mcp