Telegram MCP Server
Allows bidirectional communication with Telegram, enabling sending messages, receiving instructions, and managing tasks with notifications.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Telegram MCP ServerCheck if I sent any instructions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Telegram MCP Server for Claude Code
A bidirectional Telegram bridge that allows Claude Code to communicate with you via Telegram. Built on the Model Context Protocol (MCP).
Features
Send messages from Claude Code to your Telegram
Receive instructions — send Telegram messages that Claude Code can read
Task tracking — create, update, and monitor tasks with Telegram notifications
Persistent storage — all messages and tasks stored in SQLite
Webhook-based — no polling, instant message delivery
Related MCP server: mcp-telegram-claudecode
Architecture
You (Telegram) ←→ Telegram Bot API ←→ Webhook Server (Express, port 3100) ←→ SQLite DB
↕
Claude Code ←→ MCP Server (stdio) ←→ SQLite DBTwo processes share the same SQLite database:
Webhook Server — receives your Telegram messages via bot webhook
MCP Server — spawned by Claude Code via stdio, reads/writes the same DB
Prerequisites
Node.js 18+
A Telegram bot (create one via @BotFather)
Your Telegram chat ID (use @userinfobot to find it)
A publicly accessible URL for the webhook (e.g., via reverse proxy or tunnel)
Installation
git clone https://github.com/xmart2k/telegram-mcp.git
cd telegram-mcp
npm install
npm run buildConfiguration
Copy the example environment file and fill in your values:
cp .env.example .envEdit .env:
TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
TELEGRAM_CHAT_ID=your_telegram_chat_id
WEBHOOK_PORT=3100
WEBHOOK_HOST=0.0.0.0
DB_PATH=/path/to/data/telegram-mcp.dbClaude Code Setup
Add the MCP server to your Claude Code configuration (.mcp.json in your project or ~/.claude/settings.json globally):
{
"mcpServers": {
"telegram-pm": {
"command": "node",
"args": ["/path/to/telegram-mcp/dist/mcp-server.js"],
"env": {
"TELEGRAM_BOT_TOKEN": "your_bot_token",
"TELEGRAM_CHAT_ID": "your_chat_id",
"DB_PATH": "/path/to/telegram-mcp/data/telegram-mcp.db"
}
}
}
}Running the Webhook Server
Start the webhook server to receive Telegram messages:
# Development
npm run dev:webhook
# Production
npm run start:webhookSystemd Service (optional)
For production, install as a systemd service:
# Edit telegram-webhook.service to match your paths
sudo cp telegram-webhook.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now telegram-webhookRegister the Webhook
After the server is running and accessible via a public URL, register the webhook with Telegram (one-time setup):
curl -X POST http://localhost:3100/webhook/setup \
-H "Content-Type: application/json" \
-d '{"url": "https://your-domain.com/webhook"}'Verify webhook status:
curl http://localhost:3100/webhook/infoMCP Tools
Tool | Description |
| Send a Telegram message to you |
| Check for pending messages from you |
| Mark a specific instruction as processed |
| Mark all pending instructions as processed |
| Create a tracked task with optional notification |
| Update task status with optional notification |
| Get status and history of a task |
| List all non-completed tasks |
| List all tasks including completed |
Usage Examples
Once configured, Claude Code can use the tools naturally:
"Send me a message on Telegram saying the deploy is done" — uses
send_message"Check if I sent any instructions" — uses
get_instructions"Create a task BUG-42 to fix the login issue" — uses
create_task"Mark BUG-42 as completed" — uses
update_task_status
You can also send messages from Telegram to Claude Code — they'll be queued and available via get_instructions.
API Endpoints (Webhook Server)
Method | Path | Description |
|
| Telegram bot updates (configured automatically) |
|
| Register webhook URL with Telegram |
|
| Current webhook status |
|
| Health check |
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Run a Telegram channel from your AI agent. Posts go out through your own bot, not your account.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects Claude Code sessions to Telegram, enabling AI-powered code assistance and file management directly from Telegram chats.89MIT
- AlicenseAqualityCmaintenanceEnables Claude Code to send and receive messages via Telegram for remote interaction and approval of sensitive operations.83 npm7MIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude Code to act as an autonomous Telegram agent with tools for replying, reacting, editing messages, searching history, and handling attachments. Includes a TUI watchdog for unattended operation.1AGPL 3.0
- AlicenseAqualityDmaintenanceEnables Claude to send questions via Telegram and receive answers from your phone, bypassing terminal popups.3MIT