Telegram MCP Server

Telegram MCP Server

telegram_mcp•bykdoronin

A Model Context Protocol server that lets AI agents and other MCP clients interact with the Telegram API.

License: Not specified•Runtime: Awaiting documentation review•Category: communication social

WHAT IT DOES

  • •Retrieves a list of user dialogs (chats), optionally limited by count.
  • •Fetches messages from a specified chat with an optional limit.
  • •Sends a message to a specified chat.
  • •Executes an arbitrary Telegram API method with optional parameters.

BEST FOR

  • •Having an AI assistant list recent Telegram chats and messages for a session.
  • •Sending Telegram messages to a chat on behalf of a user through an AI workflow.

ABOUT TELEGRAM_MCP

Telegram MCP Server is cataloged as an MCP server attributed to kdoronin. A Model Context Protocol server that lets AI agents and other MCP clients interact with the Telegram API. It is categorized under communication social. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Telegram MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How is a Telegram session authorized on first use?

The server requests a confirmation code in the console, and if two-factor authentication is enabled, a Telegram password as well; the session is then saved for subsequent requests.

What does the executeMethod tool do?

It executes an arbitrary Telegram API method with optional parameters and should be used with caution.

Upstream README

View this exact version on GitHub

README.md · 9d8ee0b36ef9 · Fetched 2026-11-13 10:24:27 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Telegram MCP Server

English version | Русская версия

Server for working with Telegram API through Model Context Protocol (MCP). Allows AI agents and other MCP clients to interact with Telegram.

Requirements

  • Node.js 14+ (or higher)
  • npm
  • API ID and API Hash from Telegram

Installation

  1. Clone the repository:

    git clone https://github.com/kdoronin/telegram_mcp
    cd telegram-mcp
    
  2. Install dependencies:

    npm install
    

    (This will install the necessary packages: gramjs, @modelcontextprotocol/sdk, zod, etc.)

  3. Create and configure the .env file:

    # Copy the example .env file
    cp .env.example .env
    

    Edit the .env file and specify your API_ID and API_HASH.

  4. Get API ID and API Hash:

    • Go to my.telegram.org
    • Log in to your account
    • Navigate to "API development tools"
    • Create a new application
    • Copy api_id and api_hash to your .env file

Running

Important note about running

The main server file mcp-server.js is located in the project root, which allows running it without path issues.

npm run mcp    # Run from the project root directory

Option 2: Direct node execution

# Run from the project root directory
node mcp-server.js

Option 3: As an executable file

# From the project root
./mcp-server.js

Option 4: After global installation

npm install -g .   # Install the package globally
telegram-mcp       # Run the globally installed package

Integration with MCP clients

Configuration in Cursor

  1. Open Cursor settings
  2. Go to Features -> MCP Servers
  3. Click "Add new MCP server"
  4. Configure the server:
    • Name: telegram (or any other)
    • Type: command
    • Command: node /full/path/to/project/mcp-server.js
    • Alternatively: npx telegram-mcp (after global installation)

Configuration in Claude Desktop

  1. Open Claude Desktop settings
  2. Go to Tools -> MCP
  3. Click "Add New Server"
  4. Configure the server:
    • Name: telegram (or any other)
    • Type: command
    • Command: node /full/path/to/project/mcp-server.js
    • Alternatively: npx telegram-mcp (after global installation)

Checking functionality

When the server starts:

  1. It will load settings from the .env file
  2. Check for saved sessions
  3. If there are no sessions, it will offer to create a new one (you will need to enter a phone number and confirmation code)

Available Tools

The MCP server provides the following tools:

  • getDialogs: Gets a list of user dialogs (chats).
    • Parameters: session (string, required), limit (integer, optional, default: 100).
  • getMessages: Gets messages from the specified chat.
    • Parameters: session (string, required), chatId (string, required), limit (integer, optional, default: 100).
  • sendMessage: Sends a message to the specified chat.
    • Parameters: session (string, required), chatId (string, required), message (string, required).
  • executeMethod: Executes an arbitrary Telegram API method (use with caution).
    • Parameters: session (string, required), method (string, required), params (object, optional).

Note: The session parameter is usually the user's phone number in international format (e.g., +79001234567).

Usage examples in prompts

Using the telegram.getDialogs tool for session +79001234567, show me the last 5 chats.
With telegram.sendMessage for session +79001234567, send the message "Hello from my AI assistant!" to chat with ID 'username_or_chat_id'.

Authorization

When using a session (phone number) for the first time, the server will request a confirmation code in the console where it is running. Enter the code received from Telegram to authorize the session.

If you have two-factor authentication (2FA) enabled, you will also need to enter your Telegram password. If the password is entered incorrectly, the system will prompt you to enter it again (up to 3 attempts).

After successful authorization, the session will be saved to a file inside the sessions/ directory and will be used for subsequent requests.

Session file structure

Sessions are stored in the sessions/ directory as JSON files named after the phone number (e.g., +79001234567.json). Each file contains:

  • A session string (encrypted authorization token)
  • A timestamp of creation/update

Troubleshooting

  1. Error "Your API ID or Hash cannot be empty or undefined"

    • Check that the .env file is in the project root
    • Make sure API_ID and API_HASH are correctly specified in it
    • Run the server from the project root directory
  2. Server doesn't see the saved session

    • Check the execution path (should be from the project root)
    • Check for the session file in the sessions/ directory
    • Try running with npm run mcp
  3. Authorization error

    • If you entered an incorrect 2FA password, the system will prompt you to re-enter it
    • If all attempts are exhausted, delete the session file and try again

Security

  • Do not share your API ID and API Hash with third parties.
  • Run the server in a trusted environment.
  • Session files contain sensitive data. Store them in a secure location and do not share them.
  • The executeMethod tool allows executing any Telegram API methods. Use it with caution, as it can perform destructive actions.

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Telegram MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/telegram_mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related communication social MCP Servers

Alternative and complementary servers in the same category

View all in communication social →

An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.

52
Communication

Pidgeon provides an MCP server and an email inbox API that gives AI agents their own addresses for sending, awaiting, and replying to email.

Repository stats unavailable
Communication