Skip to main content
Glama
alexandertsai

Telegram MCP Server

텔레그램 MCP 서버

이것은 클로드가 귀하의 Telegram 계정에 접근하여 메시지를 읽고 보낼 수 있도록 해주는 간단한 MCP 서버입니다.

기능

  1. get_chats : Telegram 채팅 목록을 가져옵니다

  2. send_message : 채팅방에 메시지 보내기

  3. get_message : 채팅에서 메시지를 가져와 읽지 않은 메시지를 인쇄합니다.

  4. mark_messages_read : 메시지를 읽음으로 표시

  5. get_conversation_context : 20개의 메시지를 가져와서 convostyle.txt 읽어 적절한 답변을 결정합니다.

Related MCP server: telegram-briefing-mcp

설정

권장 설정

1단계: Telegram API 자격 증명 가져오기

  1. https://my.telegram.org/apps 로 이동하세요

  2. 로그인하여 애플리케이션을 생성하세요(또는 기존 애플리케이션을 사용하세요). 참고: 애플리케이션의 종류는 중요하지 않습니다. 무엇이든 생성하세요. 유형에서 "웹"을 선택하세요.

  3. API IDAPI 해시를 기록해 두세요.

2단계: Python 환경 설정

필요한 패키지를 설치하세요(터미널을 열어서 설치하세요. Mac에서는 Command+Space를 누르고 '터미널'을 입력하거나, Windows에서는 Windows 키를 누르고 '터미널'을 입력하세요. 코드를 한 줄씩 복사해서 터미널에 붙여넣으세요). 먼저 Git을 설치했는지 확인하세요.

지엑스피1

가상 환경을 설정하세요. 가능하다면 pip3 대신 사용하세요.

# Set up virtual environment
pip install uv
uv venv
source .venv/bin/activate
# .venv\Scripts\activate for windows
uv add mcp-sdk telethon python-dotenv nest_asyncio

3단계: ID 추가

Mac(bash)의 경우:

가상 환경에서 다음을 실행합니다.

export TELEGRAM_PHONE=phone number with country code and no spaces
export TELEGRAM_API_ID=api_id
export TELEGRAM_API_HASH=api_hash

터미널에서 printenv 로 내보내졌는지 확인하세요.

Windows(PowerShell)의 경우:

가상 환경에서 다음을 실행하세요. 따옴표를 꼭 포함해야 합니다. 그렇지 않으면 PowerShell이 제대로 작동하지 않을 수 있습니다.

$env:TELEGRAM_PHONE="phone number with country code and no spaces"
$env:TELEGRAM_API_ID="api_id"
$env:TELEGRAM_API_HASH="api_hash"

PowerShell에서 gci env: 사용하여 내보냈는지 확인하세요.

4단계: 인증 실행

인증하려면 이 명령을 실행하세요. 2FA를 사용하는 경우 비밀번호를 입력할 때 터미널에 아무 텍스트도 표시되지 않습니다. 이는 정상입니다! 2FA 과정에서 오타를 내지 않도록 주의하세요. 오타가 발생하면 전체 프로세스가 다시 시작됩니다. 설치된 버전에 따라 python 또는 python3 사용하세요.

cd src/mcp_telegram
python3 telethon_auth.py

다음 사항을 요청드립니다.

  • 귀하의 전화번호 (국제 형식으로 + 표시) (공백을 남기지 마세요)

  • Telegram이 귀하의 계정으로 보내는 코드

  • 2FA 비밀번호(활성화된 경우)

이렇게 하면 홈 디렉토리에 세션 파일이 생성되므로 다시 인증할 필요가 없습니다.

5단계: Claude Desktop에 추가

Claude Desktop 구성을 편집하세요.

Claude 데스크톱을 열고 설정(cmd+,)으로 이동한 후 개발자 모드 > 구성 편집을 클릭합니다. claude)desktop_config.json 파일을 편집합니다. 개발자 모드가 활성화되어 있는지 확인하세요.

macOS : ~/Library/Application Support/Claude/claude_desktop_config.json
윈도우 : %APPDATA%\Claude\claude_desktop_config.json

이것을 설정에 추가하세요(실제 자격 증명으로 대체하세요). Command+s를 눌러 저장하세요. :

"mcpServers": {
      "telegram": {
      "command": "/your/path/to/python3",
      "args": ["/full/path/to/mcp-telegram/main.py"],
      "env": {
          "TELEGRAM_API_ID": "your_api_id_here",
          "TELEGRAM_API_HASH": "your_api_hash_here",
          "TELEGRAM_PHONE": "+65945678900"
          }
      }
  }

main.py: 전체 경로를 얻으려면 IDE나 데스크톱으로 가서 파일을 찾은 다음 마우스 오른쪽 버튼을 클릭하고 "경로 복사"를 클릭하세요.

python: 터미널에서 where.exe python (Windows) 또는 where python (Mac)을 실행하여 전체 경로를 확인하세요(필요한 경우 python3 으로 변경). Windows를 사용하는 경우 JSON 형식 때문에 경로의 백슬래시를 슬래시로 변경해야 할 수 있습니다(ctrl+f "\", ctrl+h 모두 "/"로 변경).

매우 중요:

  1. Python과 main.py 스크립트 모두에 대한 전체 절대 경로를 사용하세요.

  2. API 자격 증명을 1단계의 실제 값으로 바꾸세요.

  3. 전화번호를 국제 형식으로 설정하세요

6단계(선택 사항):

챗봇이 당신의 말과 비슷하게 반응하길 원한다면 src/mcp_telegram 에 있는 convostyle.txt 자유롭게 설정하세요.

바로 그것입니다!

Claude Desktop을 다시 시작하고(종료했다가 다시 열면) 이제 Claude에게 다음 작업을 요청할 수 있습니다.

  • 최근 Telegram 채팅을 보여주세요

  • 특정 채팅의 메시지 읽기

  • 특정 메시지를 "읽음"으로 표시

  • 자연스러운 음성으로 연락처나 그룹에 메시지를 보내세요

클로드에게 메시지를 보낼 때 "텔레그램"이라는 단어를 꼭 포함하세요. 그렇지 않으면 텔레그램이 이해하지 못할 수 있습니다. 예를 들어, "클로드, 읽지 않은 텔레그램 메시지가 있나요?"와 같이 질문할 수 있습니다.

맞춤형

Claude Desktop에서 사용자 이름을 클릭한 후 왼쪽 하단의 설정을 클릭하면 개인 설정을 통해 더욱 맞춤화된 답변을 받으실 수 있습니다. 예를 들어, "MCP를 사용하여 Telegram을 확인할 때 채널 무시"와 같은 설정을 할 수 있습니다.

성가신 문제 해결

가상 환경에서 다음을 실행해보세요.

ls -la ~/.mcp_telegram_*

그런 다음 세션 파일을 종료합니다(파일 경로를 앞에 rm을 붙여 복사하여 붙여넣기만 하면 됩니다).

rm /Users/username/.mcp_telegram_numberininternationalformat*

3단계를 다시 시도해 보세요.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    MCP server that enables Claude Code to interact with a personal Telegram account via MTProto, providing over 120 tools for messaging, media, chat management, and more.
    100
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A read-only Telegram MCP server that retrieves messages from your DMs, groups, and channels, enabling Claude to generate executive briefings from Telegram conversations.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Read-only MCP server for Telegram that enables reading messages and transcribing voice, audio, and video notes via the Telegram API for use with Codex and Claude Code.
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for sending and receiving Telegram messages via a bot, enabling AI assistants to interact directly through Telegram by sending messages, reading recent messages, and sending photos.
    58
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexandertsai/mcp-telegram'

If you have feedback or need assistance with the MCP directory API, please join our Discord server