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.
Before installing WebSearch, make sure you have:
# 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
# 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
# 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
You can configure Claude for Desktop to access the WebSearch tools:
Locate or create your Claude for Desktop configuration file:
%env:AppData%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the WebSearch server configuration to the mcpServers section:
{
"mcpServers": {
"websearch": {
"command": "uv",
"args": [
"--directory",
"D:\\ABSOLUTE\\PATH\\TO\\WebSearch",
"run",
"main.py"
]
}
}
}
query
(str) - The search queryurls
(List[str]): List of URLs to extract information fromprompt
(str): Instructions for extractionenableWebSearch
(bool): Enable supplementary web searchshowSources
(bool): Include source referencesurl
(str): Starting URLmaxDepth
(int): Maximum crawl depthlimit
(int): Maximum pages to crawlurl
(str) - Target URLCreate 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
OpenAI API Key:
Firecrawl API Key:
If you encounter errors:
.env
file.env
file is in the root directory of the projectTo 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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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