mcp-telegram

MCP Server for Telegram

GitHub Stars

127

User Rating

Not Rated

Favorites

0

Views

607

Forks

14

Issues

6

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.10 or higher
uv (install via official guide)

Installation

Installation

Prerequisites

Python: 3.10 or higher
uv: Install via the [official uv guide](https://github.com/astral-sh/uv#installation).

Installation Steps

Install the mcp-telegram CLI tool:
bash
uv tool install mcp-telegram

Configuration

Configuration

Basic Configuration

Setting Up Credentials

First, authenticate with your Telegram account:
bash
mcp-telegram login
This command will prompt you for your API ID, API Hash, phone number, verification code, and 2FA password. Your credentials are securely stored in the session file. > WARNING: Keep your API credentials private and never share them publicly.

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Command Line Usage

bash
mcp-telegram --help # See all commands

Programmatic Usage

python
import requests

def call_mcp_tool(tool_name, params):
    response = requests.post(
        'http://localhost:3000/mcp/call',
        json={
            'tool': tool_name,
            'parameters': params
        }
    )
    return response.json()

Usage example

result = call_mcp_tool('analyze', { 'input': 'sample data', 'options': {'format': 'json'} })

Use Cases

Building a system where AI agents provide automated responses via Telegram.
Developing a chatbot that analyzes user messages and generates appropriate replies.
Creating an application that downloads media files from Telegram for processing.
Developing a tool that searches specific chats in Telegram and provides relevant information.