Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AIFire in da houseCheck it out free

mcp-web-search-tool

MCP.Pizza Chef: gabrimatic

The mcp-web-search-tool is a Model Context Protocol server that enables AI models to perform real-time web searches using pluggable search providers like the Brave Search API. It delivers up-to-date information in a structured JSON format, supports smart query handling for context-aware responses, and allows easy switching between search engines. This server requires Node.js and an API key for integration, making it ideal for AI assistants needing current web data access.

Use This MCP server To

Provide AI models with real-time web search results Integrate multiple search engines via pluggable providers Return search results in structured JSON format Enable context-aware query handling for AI assistants Fetch up-to-date information for dynamic knowledge bases Support AI workflows requiring live internet data Automate information retrieval from the web for chatbots

README

MCP Web Search Tool

A powerful Model Context Protocol (MCP) server providing real-time web search capabilities through pluggable search providers. Currently integrated with the Brave Search API.

Claude Desktop Example

✨ Features

  • Real-Time Information Access: Enables AI assistants to retrieve up-to-date information from the web
  • Pluggable Search Providers: Modular architecture allows for easy switching between different search engines
  • Structured Output Format: Returns search results in a clean, consistent JSON format
  • Smart Query Handling: Automatically categorizes queries and provides AI assistants with context-aware guidance

πŸ“‹ Requirements

  • Node.js: v16.x or newer
  • npm: v7.x or newer
  • Brave Search API Key: Required for accessing the Brave Search API

πŸš€ Installation

  1. Clone the Repository:

    git clone https://github.com/gabrimatic/mcp-web-search-tool.git
    cd mcp-web-search-tool
  2. Install Dependencies:

    npm install
  3. Configure Environment Variables: Create a .env file in the project root:

    BRAVE_API_KEY=your_api_key_here
    MAX_RESULTS=10 # Optional: Default is 10
    REQUEST_TIMEOUT=10000 # Optional: Default is 10000ms
    
  4. Build the Project:

    npm run build

πŸ’» Usage

Starting the Server

npm start

Testing the Server

node test-server.js

Integration with Claude Desktop App (optional)

One of the most exciting aspects of this project is its seamless integration with the Claude Desktop app. This integration allows users to ask Claude questions that require real-time information, and Claude will automatically use the web search tool to provide up-to-date answers.

Configuration

  1. Create a claude_desktop_config.json file:

    {
      "mcpServers": {
        "mcp-web-search": {
          "command": "node",
          "args": [
            "/path/to/your/mcp-web-search-tool/build/index.js"
          ]
        }
      }
    }
  2. Launch Claude Desktop with your configuration file.

  3. Ask Claude questions requiring real-time information, and it will automatically use the web search tool.

πŸŽ₯ YouTube Video

Watch Claude in action using the MCP Web Search Tool for real-time AI browsing!

πŸ“Ί Claude + MCP Web Search – Live Demo

Example Queries:

  • "What are analysts saying about the MVP race after tonight’s NBA games?"
  • "What are the latest news about artificial intelligence?"
  • "What's the weather like in New York today?"
  • "How is the stock market performing right now?"

πŸ› οΈ Available Tools

Web Search

  • Tool Name: web_search
  • Description: Search the web for REAL-TIME information
  • Necessarily For: Weather, current events, sports scores, stock market updates
  • Parameters:
    • search_term (string): The search term to look up
    • provider (string, optional): Search provider (defaults to Brave)

Query Categories

The tool automatically categorizes queries into:

  • Weather information
  • Current events and news
  • Sports scores and results
  • Stock market and financial data
  • Time-sensitive information
  • General information seeking

πŸ“œ License

MIT License

πŸ‘¨β€πŸ’» Developer

By Hossein Yousefpour

Β© All rights reserved.

πŸ“ Medium Article

Read more about the MCP Web Search Tool, its capabilities, and how it enhances AI-driven web search in our detailed Medium article: πŸ“– Deep Dive into MCP Web Search Tool

β˜• Support

Buy Me A Book

mcp-web-search-tool FAQ

How do I set up the mcp-web-search-tool server?
Clone the repository, install Node.js v16+ and npm v7+, then configure your Brave Search API key to start the server.
Can I use search providers other than Brave Search?
Yes, the server supports a modular architecture allowing easy integration of different search providers.
What format are the search results returned in?
Search results are returned in a clean, consistent JSON format for easy parsing by AI models.
Does the server handle query categorization?
Yes, it automatically categorizes queries to provide context-aware guidance to AI assistants.
What are the system requirements for running this server?
You need Node.js version 16 or newer, npm version 7 or newer, and a valid Brave Search API key.
Is this server compatible with multiple AI model providers?
Yes, it is designed to work with various AI models by providing standardized web search context.
How does the pluggable search provider architecture benefit me?
It allows you to switch or add search engines easily without changing the core server code.
Can this server provide real-time information to AI assistants?
Yes, it enables AI assistants to access up-to-date web information in real time.