MT

muhammad18557/telegram-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

27 stars 9 forks 품질 58 트렌드 11

이로 인해 개인 전보 메시지를 검색하고 연락처를 검색하고 개인 또는 그룹에 메시지를 보냅니다.

개요

이것은 Telegram의 모델 Context Protocol (MCP) 서버입니다. 이로 인해 개인 전보 메시지를 검색하고 연락처를 검색하고 개인 또는 그룹에 메시지를 보냅니다. Telegram API를 통해 직접 연결할 수 있습니다. 모든 메시지는 SQLite 데이터베이스에 로컬로 저장되며 에이전트가 도구 (제어)를 통해 액세스 할 때 LLM (예 : Claude)에 전송됩니다. - Python 3.6+ - Anthropic Claude 데스크탑 앱(또는 커서) Python 가상 환경을 만들고 활성화하십시오. 의존성을 설치하십시오. 이것은 실행을 위해 둘 다 사용될 수 있는 환경이고. - https://my.telegram.org/auth로 이동 - "API 개발 도구"로 이동 - 새로운 응용 프로그램을 생성 - API ID 및 API 해시를 메모 telegram-bridge 디렉토리에 Navigate:

개요(AI 번역)

이것은 Telegram의 모델 Context Protocol (MCP) 서버입니다.

이로 인해 개인 전보 메시지를 검색하고 연락처를 검색하고 개인 또는 그룹에 메시지를 보냅니다.

Telegram API를 통해 개인 Telegram 계정에 직접 연결됩니다. 모든 메시지는 SQLite 데이터베이스에 로컬로 저장되며 에이전트가 도구 (제어)를 통해 액세스 할 때 LLM (예 : Claude)에 전송됩니다.

설치

# 필수품

  • 파이썬 3.6+
  • Anthropic Claude 데스크탑 앱 (또는 커서)

단계

  1. **이 저장소를 복제 **

Python 가상 환경을 만들고 활성화하세요:

의존성 설치:

Telegram Bridge 및 ** MCP 서버**를 실행할 수 있는 환경입니다.

  1. ** Telegram API 자격** 받기
  • [T0]로 이동
  • 로그인 및 "API 개발 도구"로 이동
  • 새 신청서 작성
  • API ID 및 API 해시 참고
  1. **텔레그램 브리지 **

telegram-bridge 디렉토리에 Navigate:

API 자격 증명을 환경 변수로 설정하십시오.

또는 `.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Telegram MCP Server

This is a Model Context Protocol (MCP) server for Telegram.

With this you can search your personal Telegram messages, search your contacts, and send messages to either individuals or groups.

It connects to your personal Telegram account directly via the Telegram API (using the Telethon library). All your messages are stored locally in a SQLite database and only sent to an LLM (such as Claude) when the agent accesses them through tools (which you control).

Installation

Prerequisites

  • Python 3.6+
  • Anthropic Claude Desktop app (or Cursor)

Steps

  1. Clone this repository

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

    Create a Python virtual environment and activate it:

    python3 -m venv myenv
    source myenv/bin/activate
    

    Install dependencies:

    pip install -r requirements.txt
    

    This is the environment that can be used both for running the Telegram bridge and the MCP server.

  2. Get your Telegram API credentials

  3. Run the Telegram bridge

    Navigate to the telegram-bridge directory:

    cd telegram-bridge
    

    Set up your API credentials as environment variables either by exporting them:

    export TELEGRAM_API_ID=your_api_id
    export TELEGRAM_API_HASH=your_api_hash
    

    Or by creating a .env file based on the provided .env.example:

    cp .env.example .env
    nano .env  # or use your preferred text editor
    

    Then update the values in the .env file:

    TELEGRAM_API_ID=your_api_id
    TELEGRAM_API_HASH=your_api_hash
    

    Run the Python application:

    python main.py
    

    The first time you run it, you will be prompted to enter your phone number and the verification code sent to your Telegram account.

  4. Connect to the MCP server

    First, update the run_telegram_server.sh script with your absolute repository path:

    # Open the script in your preferred editor
    nano run_telegram_server.sh
    
    # Update line 4 with your absolute path to the repository
    # Change this:
    BASE_DIR="/Users/muhammadabdullah/Desktop/mcp/telegram-mcp"
    # To your actual BASE_DIR path (get it by running `pwd` in the telegram-mcp directory)
    

    Then, configure the MCP server by creating a JSON configuration file with the following format. Use the BASE_DIR from above.

    {
      "mcpServers": {
        "telegram": {
          "command": "/bin/bash",
          "args": [
            "{{BASE_DIR}}/run_telegram_server.sh"
          ]
        }
      }
    }
    
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "telegram": { "command": "/bin/bash", "args": [ "{{BASE_DIR}}/run_telegram_server.sh" ] } } }