Sponsored by Deepsite.site

MCP Telegram AI Assistant

Created By
falahgs8 months ago
Content

MCP Telegram AI Assistant

A professional Model Context Protocol (MCP) server that leverages Google's Gemini AI to provide intelligent responses through Telegram. Perfect for students, educators, researchers, and professionals who need quick, intelligent assistance.

Developer: Falah.G.Salieh (Iraq) © 2025

🎥 Demo

Demo

🎯 Key Features Demonstrated

✨ Real-time AI Processing🌍 Multi-language Support
📝 Smart Content Generation🔄 Automatic Response Storage
🎨 Professional Formatting📱 Instant Telegram Delivery

🌟 Key Features

  • Intelligent Content Generation: Powered by Google's Gemini AI for high-quality responses
  • Real-time Telegram Integration: Instant access to AI capabilities through Telegram
  • Multi-language Support: Works with multiple languages including RTL languages (Arabic, etc.)
  • Automatic Response Storage: All generated content is saved for future reference
  • Professional Output Formatting: Clean, well-formatted responses in both Telegram and saved files

🎯 Benefits for Different Users

For Students

  • Quick research assistance
  • Help with understanding complex topics
  • Study material generation
  • Question answering and explanations

For Educators

  • Teaching material preparation
  • Example generation
  • Concept explanations
  • Course content organization

For Researchers

  • Literature review assistance
  • Research summarization
  • Hypothesis generation
  • Data interpretation help

🚀 Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • A Telegram Bot Token (from @BotFather)
  • Google Gemini API Key

Telegram Bot Setup Guide

  1. Create a New Bot:

    • Open Telegram and search for @BotFather
    • Send /newbot command to BotFather
    • Follow the prompts:
      • Enter a display name for your bot
      • Choose a username ending in 'bot' (e.g., 'my_ai_assistant_bot')
    • Save the API token provided by BotFather (looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
  2. Get Your Chat ID:

    • Open Telegram and search for @userinfobot
    • Send any message to this bot
    • It will reply with your Chat ID (a number like 123456789)
    • Save this number for your configuration
  3. Initialize Your Bot:

    • Search for your new bot using its username
    • Start a chat with your bot
    • Send the /start command
    • Your bot is now ready to receive commands
  4. Configure Environment Variables:

    • Create a .env file in your project root
    • Add your bot token and chat ID:
      TELEGRAM_BOT_TOKEN=your_bot_token_here
      TELEGRAM_CHAT_ID=your_chat_id_here
      GEMINI_API_KEY=your_gemini_api_key
      

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/mcp-telegram-ai-assistant.git
cd mcp-telegram-ai-assistant
  1. Install dependencies:
npm install
  1. Build and start the server:
npm run build
npm start

💡 Usage

MCP Tool Usage

The server provides two powerful tools for AI-powered communication:

  1. generate-thinking:

    • Purpose: Generates AI responses using Gemini and manages delivery
    • Features:
      • Intelligent content generation
      • Automatic response storage
      • Optional Telegram delivery
    • Example Usage:
      {
        "name": "generate-thinking",
        "arguments": {
          "prompt": "Explain the concept of quantum entanglement",
          "sendToTelegram": true
        }
      }
      
  2. send-telegram:

    • Purpose: Direct message delivery to Telegram
    • Features:
      • Markdown formatting support
      • Multi-language compatibility
      • Error handling
    • Example Usage:
      {
        "name": "send-telegram",
        "arguments": {
          "message": "Your research summary is ready!",
          "parseMode": "Markdown"
        }
      }
      

📁 Project Structure

mcp-telegram-ai-assistant/
├── src/
│   └── index.ts         # Main server code
├── dist/               # Compiled JavaScript
├── output/            # Generated responses
├── .env               # Environment variables
└── package.json       # Project dependencies

🔧 Configuration

Environment Variables

  • GEMINI_API_KEY: Your Google Gemini API key
  • TELEGRAM_BOT_TOKEN: Your Telegram bot token
  • TELEGRAM_CHAT_ID: Your Telegram chat ID

Customization

You can customize the server by modifying:

  • Response formatting in src/index.ts
  • Output directory in the configuration
  • Message templates for different use cases

📚 Best Practices

  1. For Students:

    • Be specific in your prompts
    • Use follow-up questions for clarity
    • Save important responses for later reference
  2. For Educators:

    • Structure prompts for clear explanations
    • Use the bot to generate examples
    • Save responses for course material
  3. For Researchers:

    • Use detailed prompts for specific topics
    • Combine multiple responses for comprehensive analysis
    • Keep track of generated content with timestamps

🔒 Security

  • Environment variables for sensitive data
  • Secure file storage for responses
  • Rate limiting on requests
  • Error handling and logging

👨‍💻 Developer

Name: Falah.G.Salieh
Country: Iraq
Year: 2025
Project: MCP Telegram AI Assistant

🤝 Contributing

Contributions are welcome! Please feel free to submit pull requests.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed with ❤️ by Falah.G.Salieh | Iraq © 2025

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor