agents-sdk-telegram
Telegram bot using OpenAI Agents SDK and MCP Server.
Documentation
Weather Bot with OpenAI Agents SDK
A Telegram bot that provides real-time weather information using OpenAI's Agents SDK and Model Context Protocol (MCP). The bot can fetch current weather conditions for cities worldwide using natural language queries, powered by GPT-4o-mini model.
Features
- Real-time weather data using Open-Meteo API
- Natural language processing with OpenAI Agents SDK (GPT-4o-mini)
- Simple MCP server implementation for weather data retrieval
- Telegram-native message formatting
- Easy-to-use interface with simple weather queries
Technology Stack
- Python 3.11+
- OpenAI Agents SDK
- Model Context Protocol (MCP)
- python-telegram-bot
- Open-Meteo API (no API key required)
Quick Start
1. Clone the repository:
git clone https://github.com/esakrissa/agents-sdk-telegram.git
cd agents-sdk-telegram2. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate3. Install dependencies:
pip install -r requirements.txt4. Create a .env file in the project root:
TELEGRAM_BOT_TOKEN=your_bot_token_here
OPENAI_API_KEY=your_openai_api_key_here5. Run the bot:
python main.pyUsage
Simply send a message to the bot asking about weather in any city:
what's the weather in Ubud?The bot will respond with current weather conditions including:
- Temperature
- Weather conditions
- Wind speed
Architecture
OpenAI Agents SDK Integration
The bot uses OpenAI's Agents SDK with GPT-4o-mini model to process natural language queries and generate human-like responses. The Agent is configured with specific instructions for handling weather-related queries and maintaining conversation context.
Model Context Protocol (MCP)
The project implements a simple MCP server (`weather_mcp.py`) that provides the `get_weather` tool. This demonstrates how to:
- Create custom MCP tools
- Handle tool requests and responses
- Integrate external APIs (Open-Meteo) with MCP
License
MIT © Esa Krissa
Frequently asked questions
What is agents-sdk-telegram?
agents-sdk-telegram is Telegram bot using OpenAI Agents SDK and MCP Server.
How do I install agents-sdk-telegram?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is agents-sdk-telegram open source?
Yes — it is hosted on GitHub at https://github.com/esakrissa/agents-sdk-telegram and has 5 stars.
Related MCP tools
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
🔥 MaxKB is an open-source platform for building enterprise-grade agents. MaxKB 是强大易用的开源企业级智能体平台。 for the Model Context Protocol. Enhance AI assistants with po
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP