MCP cover image
See in Github
2025-03-23

Télégramme Bot utilisant Openai Agents SDK et MCP Server.

1

Github Watches

1

Github Forks

1

Github Stars

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-telegram
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root:
TELEGRAM_BOT_TOKEN=your_bot_token_here
OPENAI_API_KEY=your_openai_api_key_here
  1. Run the bot:
python main.py

Usage

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • modelcontextprotocol
  • Serveurs de protocole de contexte modèle

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • n8n-io
  • Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

    Reviews

    3 (1)
    Avatar
    user_JYkK9jhA
    2025-04-17

    As a dedicated user of MCP applications, I found the agents-sdk-telegram by esakrissa to be an exceptional tool. It provides seamless integration with Telegram, making chatbot development straightforward and efficient. The comprehensive documentation and ease of use truly stand out. I highly recommend it for anyone looking to enhance their applications with Telegram's capabilities. Check it out on GitHub!