Skip to main content
Glama
MCP Agent with Web Search Integration

MCP Agent with Web Search Integration

by swastikmaiti

MCP Model Context Protocol

🧩 MCP Agent with Web Search Integration

This project demonstrates how to build an intelligent AI assistant using LlamaIndex, FastMCP, and OpenAI's GPT-4o, enhanced with real-time web search capabilities via Serper API.

With this setup:

You can interact with an agent that answers your queries.

If needed, the agent fetches fresh data from the internet to provide accurate and up-to-date information.

Note:

This project uses uv (a faster Python package manager) instead of pip for dependency management.

Features

βœ… AI Assistant powered by OpenAI gpt-4o

βœ… Integrated with llama-index Function Agent

βœ… Real-time Web Search using Serper.dev

βœ… Async-first implementation for speed πŸš€

βœ… Custom MCP server and client communication

βœ… Clean streaming of tool calls and responses

🧩 Tech Stack

  • Python 3.11+

  • uv (Python dependency management)

  • FastMCP

  • LlamaIndex

  • OpenAI GPT-4o

  • HTTPx (for async HTTP requests)

  • Serper.dev API (Google Search API)

  • BeautifulSoup (Web scraping)

Related MCP server: Perplexity MCP Server

πŸ“– References

πŸš€ Running the Project

1. Start MCP Server

uv run mcp_server.py --server_type=sse

2. Start MCP Client

python mcp_client.py

3. Usage Example

You: Who is the CEO of OpenAI?
Agent: Sam Altman is the CEO of OpenAI. (retrieved from latest web search)

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Integrates Perplexity AI's chat capabilities with real-time web search, enabling users to ask questions and receive AI-powered answers with up-to-date information and citations from verified web sources.
      1
      72 npm
      1
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI-powered web searches using Google's Gemini 2.5 models with Google Search Grounding. Supports multiple Gemini models (Flash, Flash-Lite, Pro) with configurable thinking budget and web search capabilities.
      1
      17 npm
      2
      MIT