Handles configuration through environment variables loaded from a .env file, managing API tokens and authentication details.
Implements a web API interface to access the agent's functionality, with interactive documentation available at /docs and /redoc endpoints.
References GitHub for project repository hosting, providing version control and collaboration features.
Provides external search capabilities through the search_engine tool that leverages Google for validation and complementary information.
Used as the WSGI HTTP server for production deployment, handling the scaling of worker processes for the web application.
Offers content extraction from web pages in Markdown format through the scrape_as_markdown tool for structured data processing.
Integrates with OpenAI's API for powering the agent's intelligence, requiring an API key for operation.
Supports deployment to Render cloud platform with included render.yaml file for automatic configuration and deployment options.
Agent MCP BrightData avec Exploration Itérative
Un agent intelligent utilisant le protocole MCP (Model Context Protocol) pour explorer et analyser des sites web de manière itérative et structurée.
🚀 Fonctionnalités
Exploration itérative : Méthodologie en 4 phases pour une recherche complète
Protection anti-doublons : Évite les appels redondants sur les mêmes URLs
Outils MCP : Utilise
scrape_as_markdown
,scrape_as_html
etsearch_engine
Gestion intelligente du contexte : Optimise l'utilisation de la mémoire
Interface conversationnelle : Interaction naturelle avec l'agent
📋 Prérequis
Python 3.8+
Compte BrightData avec API token
Clé API OpenAI
🛠️ Installation
Cloner le repository
Installer les dépendances
Configurer les variables d'environnement
⚙️ Configuration
Créez un fichier .env
avec vos clés API :
🎯 Utilisation
Démarrage de l'agent (mode console)
Démarrage de l'API web
L'API sera disponible sur http://localhost:8000
Documentation de l'API
Une fois l'API démarrée, visitez :
Documentation interactive :
http://localhost:8000/docs
Documentation alternative :
http://localhost:8000/redoc
Commandes disponibles
Exploration complète :
explore [URL] [sujet]
explore https://example.com aides logementRéinitialisation :
reset
,clear
, ounew
resetQuitter :
exit
ouquit
exit
🔍 Méthodologie d'Exploration
L'agent suit une méthodologie structurée en 4 phases :
Phase 1 : Navigation interne structurée
Analyse de la page d'accueil
Identification de la structure de navigation
Création d'une carte mentale du site
Phase 2 : Exploration approfondie
Suivi des chemins de navigation identifiés
Exploration en profondeur des sections pertinentes
Collecte d'informations détaillées
Phase 3 : Validation externe
Recherches externes spécifiques
Vérification de la cohérence des données
Identification d'informations complémentaires
Phase 4 : Recherche externe complémentaire
Validation finale par moteur de recherche
Complémentarité et validation finale
🛡️ Protection Anti-Doublons
Limite d'appels : 15 appels maximum par session
Vérification d'URLs : Évite les appels sur les mêmes pages
Instructions système : L'agent est programmé pour éviter les doublons
Compteur en temps réel : Affichage du nombre d'appels restants
📊 Outils Utilisés
scrape_as_markdown
: Extraction du contenu des pages webscrape_as_html
: Obtention du HTML brut si nécessairesearch_engine
: Recherches externes via Google
⚠️ Note : L'outil extract
n'est pas utilisé car il cause des erreurs.
🔧 Architecture
📝 Exemple d'Utilisation
🤝 Contribution
Les contributions sont les bienvenues ! N'hésitez pas à :
Fork le projet
Créer une branche pour votre fonctionnalité
Commiter vos changements
Pousser vers la branche
Ouvrir une Pull Request
📄 Licence
Ce projet est sous licence MIT. Voir le fichier LICENSE
pour plus de détails.
🆘 Support
Pour toute question ou problème :
Vérifiez que vos clés API sont correctement configurées
Assurez-vous que toutes les dépendances sont installées
Consultez les logs pour identifier les erreurs
Ouvrez une issue sur GitHub si le problème persiste
🚀 Déploiement sur Render
Configuration automatique
Le projet inclut un fichier render.yaml
pour un déploiement automatique.
Configuration manuelle
Type de service : Web Services
Build Command :
pip install -r requirements.txt
Start Command :
gunicorn app:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT
Variables d'environnement :
API_TOKEN
: Votre token BrightDataBROWSER_AUTH
: Votre authentification BrightDataWEB_UNLOCKER_ZONE
: Votre zone BrightDataOPENAI_API_KEY
: Votre clé API OpenAI
Endpoints disponibles
GET /
: Page d'accueilGET /health
: Statut de santéPOST /explore
: Exploration complète d'un sitePOST /search
: Recherche sur un sitePOST /scrape
: Scraping d'une pagePOST /chat
: Chat avec l'agent
🔄 Mise à Jour
Pour mettre à jour le projet :
Développé avec ❤️ pour l'exploration intelligente du web
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An intelligent agent using the Model Context Protocol to iteratively explore and analyze websites in a structured way, with built-in duplicate protection and conversational interface.
Related MCP Servers
- AsecurityAlicenseAqualityAI-driven browser automation server that implements the Model Context Protocol to enable natural language control of web browsers for tasks like navigation, form filling, and visual interaction.Last updated -12MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.Last updated -128517
- AsecurityAlicenseAqualityA Model Context Protocol server enabling AI assistants to scrape web content with high accuracy and flexibility, supporting multiple scraping modes and content formatting options.Last updated -4262MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that intelligently fetches and processes web content, transforming websites and documentation into clean, structured markdown with nested URL crawling capabilities.Last updated -2334