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 to the user via Telegram.

# Status update
interact(message="Working on it...")

# Ask a question (blocks until user replies)
result = interact(message="What's next?", wait_for_reply=True)
print(result["reply"])

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

send_media

Send photos, videos, audio, or documents.

# Send a photo
send_media(media_type="photo", url="https://example.com/image.jpg", caption="Look!")

# Send a document
send_media(media_type="document", url="https://example.com/report.pdf")

# Types: "photo", "video", "audio", "document"

get_file_url

Get download URL for a file from its Telegram file_id.

# When user sends you a file, you get a file_id
result = get_file_url(file_id="AgACAgIAAxk...")
print(result["url"])  # Download URL

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.2.1.tar.gz (3.6 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.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telegram_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 3.6 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.2.1.tar.gz
Algorithm Hash digest
SHA256 b6aaa9703ca4e0f96a6581cde49d62d4df3487f7f2f2c01ff86ee5a9fbf12f01
MD5 6f7c415e81fdac3e91f360c893822148
BLAKE2b-256 5be0fc5d7b257ec90b2dd84151881366f8d8ceb1947afc70195de16117ee8b11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: telegram_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de8f57e418e6eda3308fd4252589a9891dccef3f0b27f888ccdb3fdb256fd323
MD5 c42b7d1af9e14de6993a6fcd1a4acfec
BLAKE2b-256 225e0d28da940fb81b55cd5cd014283405620e9c0f5db7803188bdd5221a5d11

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