Skip to main content

MCP server for Telegram - lets AI agents communicate with users via Telegram

Project description

Telegram MCP

MCP server that lets AI agents communicate with users via Telegram.

Installation

pip install telegram-mcp

Configuration

Add to your MCP client config (e.g., Antigravity, Claude Desktop):

{
  "telegram": {
    "command": "telegram-mcp",
    "env": {
      "TELEGRAM_CHAT_ID": "your-chat-id"
    }
  }
}

Get your chat ID: Message @userinfobot on Telegram.

That's it! No bot token needed - the client connects to our hosted server.

Tools

interact

Send a message or media to the user via Telegram.

# Simple text message
interact(message="Working on it...")

# Wait for reply
result = interact(message="What's next?", wait_for_reply=True)
print(result["reply"])

# Yes/No buttons
result = interact(message="Delete?", choices=["Yes", "No"], wait_for_reply=True)

# Send a photo with caption
interact(message="Here's the result:", media_type="photo", media_url="https://...")

# Send a document
interact(media_type="document", media_url="https://.../report.pdf")

Parameters:

  • message: Text to send (optional if sending media)
  • wait_for_reply: Block until user replies (default: False)
  • choices: Button labels for quick replies
  • media_type: "photo", "video", "audio", or "document"
  • media_url: URL of media to send

get_messages

Get recent conversation history.

result = get_messages(limit=10)

Self-Hosting

If you prefer to run your own server:

{
  "telegram": {
    "command": "telegram-mcp",
    "env": {
      "TELEGRAM_SERVER_URL": "https://your-server.com",
      "TELEGRAM_CHAT_ID": "your-chat-id"
    }
  }
}

See the GitHub repo for server setup.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_mcp-0.3.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegram_mcp-0.3.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file telegram_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: telegram_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for telegram_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6101c70d2c02da2c69297edcc556c07acd653b4e641521d9b6f0fef6cdadf480
MD5 7290e7169d9844be86c71422dd05f86b
BLAKE2b-256 d908d52cd52dfb14169470bb0a04752084077f6faf3d6597f92329aa73dcbc58

See more details on using hashes here.

File details

Details for the file telegram_mcp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: telegram_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for telegram_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0466963ecfde9754936868100fc8b458653c898073527dca6b20e2bee5208aaf
MD5 dfc4707943674afbaf72ab8ccc356fc4
BLAKE2b-256 be72bf1d5c2d362c4df2f95dc828bd8adb310f7ce7d37ee9d3f22d98169c283d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page