Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"telegram": {
"args": [
"mcp-remote",
"http://YOUR_SERVER_IP/mcp",
"--header",
"Authorization: Basic bWNwOllvdXJQYXNzd29yZA=="
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
MCP (Model Context Protocol) server for Telegram. Lets AI assistants (Claude, etc.) read and send Telegram messages on your behalf via MCP tools. Runs as a regular Telegram user — not a bot.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'mcp-remote' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
mcp-remote exposed to OS command injection via untrusted MCP server connections
mcp-remote is exposed to OS command injection when connecting to untrusted MCP servers due to crafted input from the authorization_endpoint response URL
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in communication
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
PubNub Model Context Protocol MCP Server for Cursor and Claude
Social layer for Claude Code - DMs, presence, discovery, and games between AI-assisted developers
MCP server for Voximplant API — call history, users, SMS. 3 tools.
MCP Security Weekly
Get CVE alerts and security updates for MCPTelegramServer and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
MCP (Model Context Protocol) server for Telegram. Lets AI assistants (Claude, etc.) read and send Telegram messages on your behalf via MCP tools. Runs as a regular Telegram user — not a bot.
Go to my.telegram.org → API development tools → create an app.
You'll get api_id and api_hash.
cp .env.example .env
Edit .env:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_PHONE=+79001234567
POSTGRES_PASSWORD=strong_password
REDIS_PASSWORD=strong_password
MCP_PASSWORD=strong_password
MCP_ADMIN_PASSWORD=strong_password
docker-compose up -d --build
On first start, TDLib needs a confirmation code sent to your phone. Pass it via environment variable — no interactive input needed:
# First run: TDLib sends code to your phone
docker-compose up app
# Wait for "AuthorizationStateWaitCode" in logs, then Ctrl+C
# Re-run with the code (and 2FA password if enabled)
docker-compose run --rm -e TELEGRAM_AUTH_CODE=12345 -e TELEGRAM_AUTH_PASSWORD=yourpassword app
# Wait for "TDLib: authorized successfully", then Ctrl+C
# Start in background — session is saved, no re-auth needed
docker-compose up -d app
Session is saved in a Docker volume — you won't need to re-authorize on restart.
curl -u mcp:your_mcp_password -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
Telegram (MTProto)
└── TDLib (tdlight-java)
└── TdLibTelegramClient
├── MCP Tools ──────────────── POST /mcp ← AI client (Claude, etc.)
│ get_dialogs
│ search_dialog
│ get_unread_messages
│ get_last_messages
│ send_message
│
└── TelegramUpdateListener
└── Redis Pub/Sub
└── WebSocketBroker
├── PostgreSQL (history)
└── STOMP /topic/messages → Admin UI
All requests: POST /mcp with HTTP Basic Auth.
curl -u mcp:password -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
Returns list of dialogs with unread counts.
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_dialogs",
"arguments": { "limit": 50 }
},
"id": 2
}
Response:
[
{ "chat_id": 123456, "type": "PRIVATE", "title": "Alice", "unread_count": 3 },
{ "chat_id": -1001234, "type": "SUPERGROUP", "title": "Dev Team", "unread_count": 0 }
]
Search dialogs by name.
{
"method": "tools/call",
"params": { "name": "search_dialog", "arguments": { "query": "Alice" } }
}
All unread messages across all dialogs.
{
"method": "tools/call",
"params": { "name": "get_unread_messages", "arguments": {} }
}
Last N messages from a dialog.
{
"method": "tools/call",
"params": {
"name": "get_last_messages",
"arguments": { "dialog_id": 123456, "count": 10 }
}
}
Send a message to a dialog.
{
"method": "tools/call",
"params": {
"name": "send_message",
"arguments": { "dialog_id": 123456, "text": "Hello!" }
}
}
Available at http://localhost:8080/admin (credentials: