Labsco
naakaarafr logo

MCP Chatbot

β˜… 2

from naakaarafr

An intelligent chatbot for automating tasks like browser control, web searches, and travel planning.

πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys

MCP Chatbot πŸ€–

MCP Chatbot - Intelligent automation through Model Context Protocol integration. Features browser automation, web search, and travel planning with robust error handling. Uses Google Gemini LLM and gracefully handles server failures for reliable operation.

GitHub Repository: https://github.com/naakaarafr/MCP-Chatbot

A powerful chatbot built with Model Context Protocol (MCP) that provides intelligent automation through browser control, web search, and travel planning capabilities.

Overview

This chatbot leverages the Model Context Protocol to integrate multiple specialized servers, creating a unified interface for web automation, search, and travel-related tasks. It uses Google's Gemini model as the underlying LLM and can gracefully handle server failures by testing each MCP server individually.

Features

🌐 Browser Automation (Playwright MCP)

  • Navigate to websites
  • Take screenshots
  • Click elements and interact with web pages
  • Automate web-based tasks

πŸ” Web Search (DuckDuckGo MCP)

  • Perform web searches
  • Get real-time information
  • Research topics and find answers

🏠 Travel Planning (Airbnb MCP)

  • Search for accommodations
  • Find hotels and rentals
  • Get travel recommendations

πŸ›‘οΈ Robust Error Handling

  • Individual server testing on startup
  • Graceful degradation when servers fail
  • Fallback responses in limited mode
  • Clear error reporting

Architecture

Core Components

  1. MCPChatbot Class: Main chatbot orchestrator

    • Initializes and manages MCP servers
    • Handles user interactions
    • Provides fallback responses
  2. Server Testing: Individual server validation

    • Tests each MCP server on startup
    • Reports working and failed servers
    • Continues operation with available servers
  3. Agent Integration: LangChain + MCP integration

    • Uses Google Gemini 2.0 Flash as the LLM
    • Integrates with MCP client for tool access
    • Supports up to 20 reasoning steps

Error Handling

The chatbot implements robust error handling:

  • Server Failures: Individual server testing prevents total failure
  • Limited Mode: Provides basic responses when no servers are available
  • Graceful Degradation: Continues operation with partial functionality
  • User Feedback: Clear error messages and status reporting

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with various MCP servers
  5. Submit a pull request

License

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

Please check individual MCP server licenses for their respective terms.

Support

For issues related to:

  • MCP Protocol: Check the official MCP documentation
  • Specific MCP Servers: Refer to individual server documentation
  • LangChain Integration: See LangChain documentation
  • Google Gemini: Check Google AI documentation

Acknowledgments

  • Model Context Protocol (MCP) team for the innovative protocol
  • Playwright team for browser automation capabilities
  • LangChain team for the integration framework
  • Google for providing Gemini AI models