T
Telebot Agent MCP
by @whofik
MCP server by whofik
Created 3/27/2026
Updated about 4 hours ago
README
Repository documentation and setup instructions
Telegraf Gemini MCP Bot
Telegram bot dengan AI (Gemini/OpenRouter) dan MCP (Model Context Protocol) system yang memungkinkan AI untuk execute function secara otomatis.
Features
- 🤖 AI-Powered - Menggunakan Gemini API atau OpenRouter API
- 🔧 MCP System - 19 tools yang bisa dipanggil oleh AI
- 🎬 Auto Send Media - Kirim video, foto, file dari URL
- 💾 Database - SQLite untuk menyimpan sessions, users, logs
- 🔐 Approval System - User baru butuh persetujuan owner
- 🔄 Function Calling - AI bisa call function secara otomatis
- 📊 Multi-Platform - Support Gemini dan OpenRouter
MCP Tools
AI Functions
sendVideoByUrl(url, caption)- Kirim video dari URLsendPhotoByUrl(url, caption)- Kirim foto dari URLsendFileByUrl(url, caption)- Kirim file dari URLdeleteFileByPath(path)- Hapus filewriteFileByPath(path, content)- Tulis filereadFileByPath(path)- Baca filelistDirectory(path)- List isi folderexecuteCommand(command)- Execute shell commandrunJavaScript(code)- Execute JavaScript code
MCP Tools
calculator- Perhitungan matematikaweather- Info cuacatime- Waktu dan tanggalsearch- Pencarian informasicurl/fetch- HTTP request- Dan masih banyak lagi...
Installation
# Clone repository
git clone https://github.com/yourusername/telegraf-gemini-mcp-bot.git
cd telegraf-gemini-mcp-bot
# Install dependencies
npm install
Configuration
Edit settings.js:
global.token = "BOT_TOKEN_DARI_BOTFATHER"
global.ownid = "TELEGRAM_ID_ANDA" // angka
// Pilih platform: "gemini" atau "openrouter"
global.platfrom = "gemini"
// Gemini Configuration
global.gemini = {
apikey: "AIzaSy...", // Gemini API Key
model: "gemini-2.0-flash-exp"
}
// OpenRouter Configuration
global.openrouter = {
apikey: "sk-or-v1-..." // OpenRouter API Key
}
global.openrouter_config = {
model: "google/gemini-2.0-flash-exp",
temperature: 0.7,
max_tokens: 2000
}
Usage
Start Bot
npm start
Bot Commands
User Commands:
/start- Mulai bot/help- Tampilkan bantuan/reset- Reset sesi chat
Owner Commands:
/stats- Statistik bot/users- Daftar users/logs- Lihat logs/platform- Lihat/ganti platform/models- Daftar model OpenRouter/setmodel- Ganti model
Examples
Chat dengan AI:
hai
Execute Command:
exec ls -la
Curl API dan Kirim Video:
curl https://api.example.com/video
ambil video nya kirim ke sini
Execute JavaScript:
console.log("Hello World")
Write File:
tulis file test.txt isi nya hello world
Read File:
baca file package.json
Function Calling
AI bisa call function secara otomatis dengan format:
[CALL: functionName("param1" "param2")]
Contoh response AI:
Oke udah saya curl API nya Dapet video TikTok nih Saya kirim ya
[CALL: sendVideoByUrl("https://example.com/video.mp4" "Video TikTok dari API")]
Project Structure
telegraf-gemini-mcp-bot/
├── index.js # Entry point
├── settings.js # Configuration
├── agent.js # Main bot logic
├── package.json # Dependencies
├── database/
│ ├── manager.js # Database manager
│ └── bot.json # Database file
├── lib/
│ ├── connector.js # MCP connector
│ ├── logic.js # AI logic
│ └── function.js # AI functions
└── temp/ # Temporary files
Getting API Keys
Telegram Bot Token
- Chat dengan @BotFather
- Kirim
/newbot - Ikuti instruksi
- Copy token
Gemini API Key
- Buka Google AI Studio
- Login dengan Google account
- Create API key
- Copy key
OpenRouter API Key
- Buka OpenRouter
- Login/Register
- Create new key
- Copy key
Owner ID
Dapatkan Telegram ID anda:
- Chat dengan @userinfobot
- Bot akan reply dengan ID anda
- Copy ID (angka)
License
ISC
Support
Jika ada masalah atau pertanyaan, silakan buat issue di GitHub.
Credits
- Telegraf - Telegram bot framework
- Gemini API - AI model
- OpenRouter - Multi-provider AI
Quick Setup
Installation guide for this server
Install Package (if required)
npx @modelcontextprotocol/server-telebot-agent-mcp
Cursor configuration (mcp.json)
{
"mcpServers": {
"whofik-telebot-agent-mcp": {
"command": "npx",
"args": [
"whofik-telebot-agent-mcp"
]
}
}
}