View as Markdown

Telegram Integration

Use Telegram as an actual user account via MTProto sessions, not the Bot API

The Telegram integration provides access to use Telegram as an actual user account via MTProto sessions, not the Bot API through the Integrate MCP server.

Installation

The Telegram integration is included with the SDK:

import { telegramIntegration } from "integrate-sdk/server";

Setup

Add Telegram to your server configuration. Provide credentials via environment variables or integration config:

import { createMCPServer, telegramIntegration } from "integrate-sdk/server";
 
export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    telegramIntegration({
      // See configuration options below
    }),
  ],
});

Client-Side Usage

import { client } from "integrate-sdk";
 
const result = await client.telegram.authSendCode({
  phone_number: "value",
});
 
console.log(result);

Environment Variables

  • TELEGRAM_API_KEY (when supported by this integration)

Configuration Options

export interface TelegramIntegrationOptions {
  /** Telegram application api_id from https://my.telegram.org/apps */
  apiId?: number | string;

Tools

telegram_auth_send_code

Auth send code

export type TelegramAuthSendCodeParams = TelegramAuthCredentialParams & {
    phone_number: string;

telegram_auth_sign_in

Auth sign in

export type TelegramAuthSignInParams = TelegramAuthCredentialParams & {
    phone_number: string;

telegram_auth_check_password

Auth check password

export type TelegramAuthCheckPasswordParams = TelegramAuthCredentialParams & {
    password: string;

telegram_get_me

Get me

export type TelegramGetMeParams = TelegramAuthCredentialParams;

telegram_resolve_username

Resolve username

export type TelegramResolveUsernameParams = TelegramAuthCredentialParams & {
    username: string;

telegram_list_dialogs

List dialogs

export type TelegramListDialogsParams = TelegramAuthCredentialParams & {
    limit?: number;

telegram_get_history

Get history

export type TelegramGetHistoryParams = TelegramAuthCredentialParams & TelegramPeerParams & {
    limit?: number;

telegram_search_messages

Search messages

export type TelegramSearchMessagesParams = TelegramAuthCredentialParams & TelegramPeerParams & {
    query: string;

telegram_send_message

Send message

export type TelegramSendMessageParams = TelegramAuthCredentialParams & TelegramPeerParams & {
    message: string;

Notes

  • Category: Communication
  • Authentication mode: API key