MCP ExplorerExplorer

Mcp Ai Assistant

@Madhuvamsi-iitgon a year ago
1 GPL-3.0
FreeCommunity
AI Systems
AI Assistant using MCP servers for dynamic multi-source integration and stateful dialog.

Overview

What is Mcp Ai Assistant

MCP–AI-assistant- is an AI assistant project that utilizes MCP servers, LangChain, and Groq to provide dynamic, context-aware interactions through multiple data sources.

Use cases

Use cases include travel queries that combine data from Airbnb and DuckDuckGo, providing users with accurate and relevant information through a single chatbot interface.

How to use

Users can initialize the MCP client with a configuration file and set up the Groq LLM to start interacting with the AI assistant. Commands like ‘clear’ and ‘exit’ help manage session states.

Key features

Key features include multi-source integration, conversational memory for stateful dialogues, and a scalable, fault-tolerant design that ensures responsiveness and error handling.

Where to use

MCP–AI-assistant- can be used in various fields such as travel, customer service, and any domain requiring real-time data retrieval and conversational AI capabilities.

Content

Project: AI Assistant with MCP Servers (LangChain + Groq)

Technologies: MCP (Model Context Protocol), LangChain, Groq (Llama3-8B), Cursor IDE (MCP Host), Streamlit/Flask, MCP Servers (Playwright, Airbnb, DuckDuckGoSearch)

Key Features & Achievements

  1. MCP-Powered Multi-Source Integration

    • Built an AI assistant that dynamically connects to MCP servers (Playwright for web automation, Airbnb/DuckDuckGo for real-time data) via a configurable MCPClient.
    • Leveraged LangChain’s agent framework to orchestrate context-aware interactions between Groq’s LLM (llama3-8b-8192) and MCP services.
  2. Conversational Memory & Stateful Dialog

    • Implemented persistent conversation history (memory_enabled=True) to retain context across user queries, enabling coherent long-term interactions.
    • Added user commands (clear, exit) to manage session state dynamically.
  3. Scalable & Fault-Tolerant Design

    • Used asynchronous I/O (asyncio) for non-blocking MCP server calls, ensuring responsiveness.
    • Deployed error handling and session cleanup to gracefully manage API failures (client.close_sessions()).

Technical Highlights

  • MCP Protocol: Customized MCPAgent to route queries between LLM and external services (e.g., scrape data via Playwright, fetch listings from Airbnb).
  • Groq Optimization: Utilized Groq’s ultra-low-latency API for real-time inference.
  • Config-Driven: Server endpoints defined in browser_mcp.json for modularity.

Impact: Enabled accurate, multi-source responses (e.g., travel queries combining Airbnb data + DuckDuckGo search) with a single chatbot interface.


Code Snippet Summary

# 1. Initialize MCP client with servers (Playwright, Airbnb, etc.)
client = MCPClient.from_config_file("browser_mcp.json")  

# 2. Set up Groq's Llama3 LLM
llm = ChatGroq(model="llama3-8b-8192")  

# 3. Create agent with memory
agent = MCPAgent(llm=llm, memory_enabled=True, client=client)  

# 4. Run interactive chat loop
response = await agent.run(user_input)  # Fetches data from MCP servers + LLM

Why It Stands Out

  • Beyond RAG: Unlike static retrieval, your MCP agent actively pulls live data from diverse APIs/web sources.
  • User-Centric: Memory and session controls mimic commercial chatbots (e.g., ChatGPT).

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers