WebSearch Tools MCP server

Integrates with web search APIs and crawling tools to enable internet-wide information retrieval, content extraction, and data mining capabilities for research and analysis tasks.
Back to servers
Setup instructions
Provider
m4s1t4
Release date
Mar 04, 2025
Language
Python
Stats
1 star

WebSearch is a powerful tool for advanced web search and content extraction built with Python. It leverages the Firecrawl API to provide intelligent web searching, content extraction, website crawling, and web scraping capabilities. The tool is designed as a Model Context Protocol (MCP) server for seamless integration with AI systems.

Prerequisites

Before installing WebSearch, make sure you have:

  • Python 3.8 or higher
  • uv package manager
  • Firecrawl API key
  • OpenAI API key (optional, for enhanced features)
  • Tavily API key (optional, for additional search capabilities)

Installation

Install uv

# On Windows (using pip)
pip install uv

# On Unix/MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh

# Add uv to PATH (Unix/MacOS)
export PATH="$HOME/.local/bin:$PATH"

# Add uv to PATH (Windows - add to Environment Variables)
# Add: %USERPROFILE%\.local\bin

Set up WebSearch

# Clone the repository
git clone https://github.com/yourusername/websearch.git
cd websearch

# Create virtual environment
uv venv

# Activate on Windows
.\.venv\Scripts\activate.ps1

# Activate on Unix/MacOS
source .venv/bin/activate

# Install dependencies
uv sync

Configure Environment Variables

# Create .env file
touch .env

# Add your API keys to the .env file
FIRECRAWL_API_KEY=your_firecrawl_api_key
OPENAI_API_KEY=your_openai_api_key

Usage

Setting Up With Claude for Desktop

You can configure Claude for Desktop to access the WebSearch tools:

  1. Locate or create your Claude for Desktop configuration file:

    • Windows: %env:AppData%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add the WebSearch server configuration to the mcpServers section:

{
  "mcpServers": {
    "websearch": {
      "command": "uv",
      "args": [
        "--directory",
        "D:\\ABSOLUTE\\PATH\\TO\\WebSearch",
        "run",
        "main.py"
      ]
    }
  }
}
  1. Replace the directory path with the absolute path to your WebSearch project folder
  2. Save the configuration file and restart Claude for Desktop
  3. The WebSearch tools will appear in the tools menu (hammer icon)

Available Tools

  • Search: Perform intelligent web searches
  • Extract Information: Extract specific data from web pages
  • Crawl Websites: Crawl websites with configurable depth
  • Scrape Content: Scrape web pages with support for various formats

API Reference

Search

  • Query parameter: query (str) - The search query
  • Returns: Search results in JSON format

Extract

  • Parameters:
    • urls (List[str]): List of URLs to extract information from
    • prompt (str): Instructions for extraction
    • enableWebSearch (bool): Enable supplementary web search
    • showSources (bool): Include source references
  • Returns: Extracted information in specified format

Crawl

  • Parameters:
    • url (str): Starting URL
    • maxDepth (int): Maximum crawl depth
    • limit (int): Maximum pages to crawl
  • Returns: Crawled content in markdown/HTML format

Scrape

  • Parameter: url (str) - Target URL
  • Returns: Scraped content with optional screenshots

Configuration

Environment Variables

Create and configure your .env file with required API keys:

# On Unix/MacOS
cp .env.example .env

# On Windows
copy .env.example .env

Edit the .env file:

# OpenAI API key - Required for AI-powered features
OPENAI_API_KEY=your_openai_api_key_here

# Firecrawl API key - Required for web scraping and searching
FIRECRAWL_API_KEY=your_firecrawl_api_key_here

Getting the API Keys

OpenAI API Key:

  • Visit OpenAI's platform
  • Sign up or log in
  • Navigate to API keys section
  • Create a new secret key

Firecrawl API Key:

  • Visit Firecrawl's website
  • Create an account
  • Navigate to your dashboard
  • Generate a new API key

Troubleshooting

If you encounter errors:

  • Ensure all required API keys are set in your .env file
  • Verify the API keys are valid and have not expired
  • Check that the .env file is in the root directory of the project
  • Make sure the environment variables are being loaded correctly

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "websearch" '{"command":"uv","args":["--directory","D:\\ABSOLUTE\\PATH\\TO\\WebSearch","run","main.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "websearch": {
            "command": "uv",
            "args": [
                "--directory",
                "D:\\ABSOLUTE\\PATH\\TO\\WebSearch",
                "run",
                "main.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "websearch": {
            "command": "uv",
            "args": [
                "--directory",
                "D:\\ABSOLUTE\\PATH\\TO\\WebSearch",
                "run",
                "main.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later