# mcp-telegram-agent

> mcp-telegram-agent is an open-source MCP server for communication. Telegram Bot API server that lets an AI agent send messages, files, polls and read replies. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Telegram
- **Repository:** https://github.com/a19901201/mcp-telegram-agent
- **MCP Registry name:** io.github.a19901201/mcp-telegram-agent
- **Categories:** [communication](https://ai-powered.com/categories/communication)
- **Listing updated:** 2026-11-23

## About

Everything runs through a Telegram bot token, so no personal account login, SMS code or session file is involved. The server is a Python package started with uvx, and it also installs a shorter command alias, tg-agent. It works with MCP clients such as Cline and Claude Desktop.

Outgoing tools cover text with Markdown or HTML, local documents, photos, videos and albums of two to ten files, plus polls, quizzes, locations, contact cards and dice. Messages can carry inline keyboards with URLs or callback data, or custom reply keyboards, and can be edited or deleted later. Every tool takes an optional chat_id, with TELEGRAM_DEFAULT_CHAT_ID as the fallback.

Receiving is opt-in. get_updates and wait_for_reply can fetch or long-poll text replies, button clicks and poll answers, but only after you set allowlists of chat or user IDs. The first get_updates call consumes all pending updates unless mark_read is false. Telegram only keeps a button callback valid for a few seconds, so button clicks are answered automatically by default.

## Features

- **Bot token only:** One token from BotFather is the only credential, so no personal Telegram session is exposed.
- **Rich message types:** Sends text, local documents, photos, videos, multi-file albums, polls, quizzes, locations, contacts and dice.
- **Inline and reply keyboards:** Messages can include inline buttons with URLs or callback data, or custom reply keyboards.
- **Message lifecycle:** Bot status such as typing or uploading can be shown, and sent messages can be edited or deleted.
- **Reply reading:** get_updates and wait_for_reply return text messages, button clicks and poll answers from allowlisted chats and users.
- **Any chat at runtime:** A chat_id on any call overrides the default, so one bot can write to users, groups and channels it belongs to.

## Good for

- Send a finished report or log file from a coding agent to your phone
- Ask a human to approve a step with inline buttons and wait for the answer
- Post build or job status updates to a group or channel
- Run a quick poll or quiz in a chat from an agent workflow
- Deliver generated images, audio or video to a Telegram chat

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mcp-telegram-agent -- uvx mcp-telegram-agent
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp-telegram-agent -- uvx mcp-telegram-agent
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp-telegram-agent]
command = "uvx"
args = ["mcp-telegram-agent"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user mcp-telegram-agent uvx -- mcp-telegram-agent

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-telegram-agent": {
      "command": "uvx",
      "args": [
        "mcp-telegram-agent"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 4 of 6 tools change data. From the server's own tool labels and tool names; not verified by us.

- `send_text_message` (name suggests: changes): Sends Markdown or HTML text with inline buttons or custom reply keyboards.
- `send_local_document` (name suggests: changes): Sends any local file such as PDF, CSV, code, logs or archives.
- `send_local_photo` (name suggests: changes): Sends image files with captions and inline buttons.
- `get_updates` (name suggests: reads): Fetches text replies, button clicks and poll answers from allowlisted chats.
- `wait_for_reply` (name suggests: changes): Long-polls for a user reply.
- `answer_callback_query` (name suggests: reads): Acknowledges a button press.

## FAQ

### What do I need to get started?

A bot token from @BotFather and a chat ID; the person must press Start on the bot before it can message them.

### Are all environment variables required?

No. All four are optional, and a missing one only produces an error when a tool call needs it.

### Can mcp-telegram-agent post to groups and channels?

Yes, if the bot is a member of the group, or an administrator of the channel.

### Why does get_updates return a setup hint?

Interactive receive is disabled until TELEGRAM_ALLOWED_CHAT_IDS or TELEGRAM_ALLOWED_USER_IDS is set.

### Does mcp-telegram-agent use my personal Telegram account?

No. It uses only the Bot API.

### Is mcp-telegram-agent free?

Yes. mcp-telegram-agent is open source, so you can use and self-host it for free.

### How do I add mcp-telegram-agent to Claude Code?

Run this command in your terminal: claude mcp add mcp-telegram-agent -- uvx mcp-telegram-agent

### What are the best alternatives to mcp-telegram-agent?

The closest alternatives to mcp-telegram-agent are TrendRadar, TryPost, Discord MCP, Gmail MCP and Getmitra.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [TrendRadar](https://ai-powered.com/mcp/trendradar): TrendRadar is an open-source MCP server for communication.
- [TryPost](https://ai-powered.com/mcp/trypost): TryPost is a paid MCP server for marketing and seo.
- [Discord MCP](https://ai-powered.com/mcp/discord-mcp): Discord MCP is an open-source MCP server for communication.
- [Gmail MCP](https://ai-powered.com/mcp/gmail-mcp-3): Gmail MCP is an open-source MCP server for communication.
- [Getmitra](https://ai-powered.com/mcp/getmitra): Getmitra is an MCP server for communication.
- [Valentina](https://ai-powered.com/mcp/valentina): Valentina is an MCP server for e-commerce.
- [Carla](https://ai-powered.com/mcp/carla): Carla is an MCP server for communication.
- [MCP for iCloud](https://ai-powered.com/mcp/mcp-for-icloud-2): MCP for iCloud is an MCP server for communication.

---
Source: https://ai-powered.com/mcp/mcp-telegram-agent
