
电报
STDIOTelegram集成MCP服务器,让Claude读发消息
Telegram集成MCP服务器,让Claude读发消息
Connect Claude to your Telegram account to read and send messages.
get_chats - List your Telegram chats
get_messages - Read messages from a specific chat
mark_messages_read - Mark all unread messages in a chat as read
send_message - Send messages to any chat
get_conversation_context - Analyze chat style for natural responses
convostyle.txt
# Clone the repository git clone https://github.com/alexandertsai/mcp-telegram cd mcp-telegram # Set up Python environment pip install uv uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv sync
# Copy the example file cp .env.example .env # Edit .env and add your API credentials: # TELEGRAM_API_ID=your_api_id_here # TELEGRAM_API_HASH=your_api_hash_here
cd src/mcp_telegram python telethon_auth.py
Follow the prompts:
Find your Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{ "mcpServers": { "telegram": { "command": "/path/to/python", "args": ["/path/to/mcp-telegram/src/mcp_telegram/main.py"] } } }
To find paths:
which python
(Mac) or where.exe python
(Windows)Restart Claude Desktop.
After setup, you can ask Claude to:
Create src/mcp_telegram/convostyle.txt
to help Claude match your texting style:
I text casually with friends, formally with work contacts.
I use emojis sparingly and prefer short messages.
If authentication fails:
.env
.env
python telethon_auth.py
again.env
file or credentialsApache 2.0