Web Search

Provides real-time web search results via Tavily API to enhance AI system responses.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "memohib-web_search_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "path/Web_Search_MCP",
        "run",
        "main.py"
      ],
      "env": {
        "TAVILY_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You run a Web_Search_MCP server that adds real-time web search capabilities to your AI workflows. It exposes a single tool, search_web, which queries Tavily's web API and returns structured results that your AI system can consume to improve answers with fresh, sourced information.

How to use

To use this MCP server, invoke the search_web tool from your MCP client and provide a query string. The tool returns a JSON string containing a status, an array of search results, and a timestamp. Each result includes a title, URL, content snippet, a relevancy score, and the raw content when available. Use the results to present up-to-date information, cite sources, or drive follow-up questions for the AI system.

Typical usage patterns include:

  • Submit a query related to current events to fetch the latest sources and summaries.
  • Retrieve detailed results to surface raw content alongside links for citation.
  • Rely on the timestamp to determine the freshness of the data.

How to install

Prerequisites you must have before starting the server include Python 3.8 or newer and access to the Tavily API with a valid API key. You also need the uv package manager to initialize and run the server.

  1. Create the project directory and initialize the project with uv
  2. Create the necessary project files
  3. Activate the virtual environment
  4. Copy the application code and environment configuration into the project files
  5. Install required packages via uv
uv init Web_Search_MCP

# After this runs, you should see pyproject.toml and a virtual environment created in the directory.

# Create the following files manually:
# - Web_Search_MCP/main.py
# - Web_Search_MCP/.env

# Activate the virtual environment (paths may vary by OS)
# On Windows:
Web_Search_MCP/.venv/Scripts/activate
# On Unix-like systems:
Web_Search_MCP/.venv/bin/activate

# Install dependencies
uv add "mcp[cli]" python-dotenv langchain-community tavily-python

Additional content

Configuration and runtime details are included here to ensure you can run the MCP server smoothly and securely.

Environment variable for API key:

  • TAVILY_API_KEY: Your Tavily API key used to authorize web search requests. Keep this value secret.

Note on usage with Claude desktop (for discovery and launching): the runtime can be configured to start via a JSON-like MCP entry, which specifies the command and arguments to launch the server.

{
  "mcpServers": {
    "Mcp_Demo": {
      "command": "uv",
      "args": [
        "--directory",
        "path/Web_Search_MCP",
        "run",
        "main.py"
      ]
    }
  }
}

Notes

This server exposes a single tool named search_web. When you deploy, you can scale the number of concurrent requests as needed since the search tool is designed for asynchronous processing.

Available tools

search_web

Web search tool that accepts a query string and returns a JSON-formatted string with status, results, and timestamp. Each result includes title, url, content, score, and raw_content when available.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational