Telegram MCP Server logo

Telegram MCP Server

by wolderufael

A powerful Telegram integration server that provides tools for managing contacts, sending messages, and retrieving channel information through MCP (Multi-Client Protocol). It allows you to interact with Telegram programmatically.

View on GitHub

Last updated: N/A

What is Telegram MCP Server?

The Telegram MCP Server is a server that allows you to manage Telegram contacts, send messages, and retrieve channel information using the Multi-Client Protocol (MCP). It provides a programmatic interface to interact with Telegram's features.

How to use Telegram MCP Server?

To use the server, you need to clone the repository, install the required dependencies (Python 3.8+, Node.js 14+), and set up your Telegram API credentials in a .env file. After that, you can integrate it with tools like Cursor or Claude Desktop by configuring the appropriate paths in their respective configuration files. The server provides functions like get_contacts(), send_message_by_identifier(), get_chat_history(), and get_channel_posts() to interact with Telegram.

Key features of Telegram MCP Server

  • Contact Management (get list, search, last interactions)

  • Messaging (send messages, get chat history, view last interactions)

  • Channel Features (get posts, search channels, view channel information, filter posts by date)

  • Error Handling (invalid credentials, network issues, rate limiting)

  • Integration with Cursor/Claude Desktop

Use cases of Telegram MCP Server

  • Automated messaging to Telegram contacts

  • Retrieving and analyzing Telegram channel content

  • Building custom Telegram bots and integrations

  • Managing Telegram contacts programmatically

  • Integrating Telegram functionality into other applications

FAQ from Telegram MCP Server

What are the prerequisites for running this server?

You need Python 3.8 or higher, Node.js 14 or higher, Telegram API credentials (api_id and api_hash), and a Telegram account.

How do I install the required dependencies?

Clone the repository, create a virtual environment, activate it, and run uv pip install.

How do I configure my Telegram API credentials?

Create a .env file in the project root with your TG_API_ID, TG_API_HASH, and phone number.

How do I integrate this server with Cursor or Claude Desktop?

Copy the provided JSON configuration, update the {{PATH}} values with the correct paths to uv and the source directory, and save the file as mcp.json in Cursor's configuration directory or claude_desktop_config.json in Claude's configuration directory.

What kind of error handling is included?

The server includes error handling for invalid credentials, network issues, rate limiting, invalid parameters, and permission errors.