WebSearch
WebSearch - 高级网页搜索和内容提取工具
使用 Python 构建的强大的网络搜索和内容提取工具,利用 Firecrawl API 实现高级网络抓取、搜索和内容分析功能。
🚀 功能
高级网页搜索:使用可自定义的参数执行智能网页搜索
内容提取:使用自然语言提示从网页中提取特定信息
网络爬取:爬取具有可配置深度和限制的网站
网页抓取:抓取网页,支持多种输出格式
MCP 集成:构建为模型上下文协议 (MCP) 服务器,实现无缝集成
Related MCP server: Firecrawl MCP Server
📋 先决条件
Python 3.8 或更高版本
uv 包管理器
Firecrawl API 密钥
OpenAI API 密钥(可选,用于增强功能)
Tavily API 密钥(可选,用于附加搜索功能)
🛠️ 安装
安装 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克隆存储库:
git clone https://github.com/yourusername/websearch.git
cd websearch使用 uv 创建并激活虚拟环境:
# Create virtual environment
uv venv
# Activate on Windows
.\.venv\Scripts\activate.ps1
# Activate on Unix/MacOS
source .venv/bin/activate使用 uv 安装依赖项:
# Install from requirements.txt
uv sync设置环境变量:
# Create .env file
touch .env
# Add your API keys
FIRECRAWL_API_KEY=your_firecrawl_api_key
OPENAI_API_KEY=your_openai_api_key🎯 使用方法
使用 Claude 桌面版进行设置
您无需直接运行服务器,而是可以配置 Claude for Desktop 来访问 WebSearch 工具:
找到或创建您的 Claude for Desktop 配置文件:
Windows:
%env:AppData%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
将 WebSearch 服务器配置添加到
mcpServers部分:
{
"mcpServers": {
"websearch": {
"command": "uv",
"args": [
"--directory",
"D:\\ABSOLUTE\\PATH\\TO\\WebSearch",
"run",
"main.py"
]
}
}
}确保将目录路径替换为 WebSearch 项目文件夹的绝对路径。
保存配置文件并重新启动 Claude for Desktop。
配置完成后,WebSearch 工具将出现在 Claude for Desktop 的工具菜单(锤子图标)中。
可用工具
搜索
提取信息
抓取网站
抓取内容
📚 API 参考
搜索
query(str):搜索查询返回:JSON格式的搜索结果
提炼
urls(List[str]):从中提取信息的 URL 列表prompt(str): 提取说明enableWebSearch(bool): 启用补充网页搜索showSources(bool):包含源引用返回:以指定格式提取的信息
爬行
url(str): 起始 URLmaxDepth(int):最大爬行深度limit(int):抓取的最大页面数返回:以 markdown/HTML 格式抓取的内容
刮
url(str):目标 URL返回:带有可选屏幕截图的抓取内容
🔧 配置
环境变量
该工具需要特定的 API 密钥才能运行。我们提供了一个.env.example文件,您可以将其用作模板:
复制示例文件:
# On Unix/MacOS
cp .env.example .env
# On Windows
copy .env.example .env使用您的 API 密钥编辑
.env文件:
# 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获取 API 密钥
OpenAI API密钥:
注册或登录
导航至 API 密钥部分
创建新的密钥
Firecrawl API密钥:
创建一个帐户
导航到您的仪表板
生成新的 API 密钥
如果一切配置正确,您应该会收到包含搜索结果的 JSON 响应。
故障排除
如果遇到错误:
确保所有必需的 API 密钥都已在
.env文件中设置验证 API 密钥是否有效且未过期
检查
.env文件是否位于项目的根目录中确保环境变量正确加载
🤝 贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/AmazingFeature)提交您的更改(
git commit -m 'Add some AmazingFeature')推送到分支(
git push origin feature/AmazingFeature)打开拉取请求
📝 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
🙏 致谢
📬 联系方式
何塞·马丁·罗德里格斯·莫塔洛尼 - @m4s1t425 - jmrodriguezm13@gmail.com
使用 Python 和 Firecrawl 用 ❤️ 制作
Available Tools
4 toolscrawlB
Crawls a website starting from the specified URL and extracts content from multiple pages. Args: - url: The complete URL of the web page to start crawling from - maxDepth: The maximum depth level for crawling linked pages - limit: The maximum number of pages to crawl
Returns:
- Content extracted from the crawled pages in markdown and HTML format
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| maxDepth | Yes | ||
| limit | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool crawls and extracts content, implying it performs read operations, but lacks details on permissions, rate limits, potential impacts on target sites, or error handling. For a web crawling tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured: a concise opening sentence states the purpose, followed by a bulleted list for args and returns. Every sentence earns its place by delivering essential information without redundancy, making it easy to parse and front-loaded with key details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (web crawling with 3 parameters), no annotations, and no output schema, the description is moderately complete. It covers the basic purpose and parameters but lacks details on behavioral traits, error cases, or output format specifics beyond 'markdown and HTML format'. This is adequate for a minimal viable description but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose: 'url' as the starting point, 'maxDepth' for crawl depth, and 'limit' for page count. This compensates well for the schema's lack of descriptions, providing clear semantics for all three parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Crawls a website starting from the specified URL and extracts content from multiple pages.' It specifies the verb ('crawls'), resource ('website'), and scope ('extracts content from multiple pages'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'extract' or 'scrape', which likely have overlapping functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'extract' or 'scrape'. It mentions the tool's function but offers no context about prerequisites, exclusions, or comparative use cases. This leaves the agent without clear direction for tool selection among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extractB
Extracts specific information from a web page based on a prompt. Args: - url: The complete URL of the web page to extract information from - prompt: Instructions specifying what information to extract from the page - enabaleWebSearch: Whether to allow web searches to supplement the extraction - showSources: Whether to include source references in the response
Returns:
- Extracted information from the web page based on the prompt
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| prompt | Yes | ||
| enabaleWebSearch | Yes | ||
| showSources | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool extracts information and includes parameters for web search and source references, but doesn't describe what happens during extraction (e.g., rate limits, authentication needs, error conditions, or what 'extracted information' looks like). For a tool with 4 parameters and no annotations, this is insufficient behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement followed by parameter explanations and return value description. It's appropriately sized for a 4-parameter tool, though the 'Returns' section could be more specific. Every sentence adds value, and there's no unnecessary repetition or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 parameters, no annotations, no output schema), the description is moderately complete. It covers the basic purpose and parameters but lacks details about behavioral traits, error handling, and what the extracted information actually contains. Without an output schema, the return value description is vague ('Extracted information from the web page based on the prompt').
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description provides clear semantic explanations for all 4 parameters beyond what the input schema offers (which has 0% description coverage). It explains that 'url' is for the web page, 'prompt' specifies what to extract, 'enableWebSearch' allows supplemental searches, and 'showSources' includes references. This adds significant value over the bare schema, though it doesn't detail parameter interactions or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: extracting specific information from a web page based on a prompt. It specifies the verb ('extracts') and resource ('web page'), but doesn't explicitly differentiate from sibling tools like 'crawl', 'scrape', or 'search' beyond the extraction focus. The description is specific about the action but lacks sibling tool comparison.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'crawl', 'scrape', or 'search'. It doesn't mention prerequisites, use cases, or exclusions. The only implied usage is for extracting information from web pages, but with no context about when this is preferable to other tools on the server.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scrapeD
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchC
Performs web searches and retrieves up-to-date information from the internet. Args: - prompt: Specific query or topic to search for on the internet - limit: Maximum number of results to return (between 1 and 20)
Returns:
- Search results with relevant information about the requested topic
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving 'up-to-date information' and a limit on results, which adds some context. However, it doesn't cover critical aspects like rate limits, authentication needs, error handling, or what 'up-to-date' means (e.g., real-time vs. cached). For a tool with no annotations, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and appropriately sized, with a clear purpose statement followed by parameter and return sections. It uses bullet points for readability, and each sentence adds value without unnecessary fluff. However, the parameter mismatch slightly reduces efficiency, but overall it's concise and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and low schema coverage (0%), the description is incomplete. It provides basic purpose and some behavioral hints but lacks details on parameters (due to mismatch), error cases, or output structure. For a web search tool with potential complexity, this leaves the agent under-informed about how to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description lists two parameters (prompt and limit), but the input schema only has one parameter (query). This creates a contradiction, as 'prompt' in the description doesn't match 'query' in the schema. With 0% schema description coverage and mismatched parameters, the description fails to add meaningful semantics beyond the schema and actually misleads about the tool's inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Performs web searches and retrieves up-to-date information from the internet.' This specifies the verb ('performs web searches') and resource ('information from the internet'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like crawl, extract, or scrape, which likely have overlapping internet-related functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like crawl, extract, or scrape, nor does it specify scenarios where search is preferred over them. The usage context is implied (web searches for up-to-date information) but lacks explicit when/when-not instructions or comparisons.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
crawl - First observed
extract - First observed
scrape - First observed
search
TDQS
Scored across 4 tools
The tools have significant overlap and unclear boundaries. 'crawl' extracts content from multiple pages, 'extract' pulls specific info from a single page, and 'scrape' (with no description) is ambiguous—likely overlapping with both. 'search' is distinct for web searches, but the others could easily be confused for similar web content tasks.
All tool names follow a consistent, simple verb pattern (crawl, extract, scrape, search). They are short, clear, and uniformly styled without mixing conventions, making them predictable and easy to parse.
Four tools is reasonable for a web search domain, allowing coverage of crawling, extraction, scraping, and searching. It's slightly thin but manageable, as each tool addresses a core aspect of web data retrieval without being overly bloated.
There are notable gaps in the tool surface. The server covers basic retrieval (crawl, search) and extraction, but lacks update/delete operations (e.g., no tool to modify or clear cached data) and has a dead tool ('scrape' with no description), which limits functionality. However, agents can work around this for common web search tasks.
Related MCP Connectors
MCP server for Firecrawl — web search, scraping, and biomedical/arXiv paper search.
Firecrawl MCP — wraps the Firecrawl API (firecrawl.dev) for web
Scrape, crawl and search the web for AI agents via MCP.
Free web search for AI agents. No API key required. Hosted MCP in active development.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables web search, scraping, crawling, and content extraction through multiple engines including SearXNG, Firecrawl, and Tavily.4325 npm144MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to perform advanced web scraping, crawling, searching, and data extraction through the Firecrawl API.9117,089 npmMIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables web scraping, crawling, and content extraction capabilities through integration with Firecrawl.8117,089 npm2MIT
- FlicenseAqualityDmaintenanceA production-ready Model Context Protocol (MCP) server that integrates with the Firecrawl API to give AI assistants the power to scrape, crawl, and search the web.3-
Appeared in Searches
- Web search tools and methods that don't require API keys
- A server for searching research papers, Kaggle datasets, and websites for ML/AI model training data
- iPhone 16e camera review summary and table creation in Italian
- Web scraping and content extraction
- Web scraping tool for extracting content from SearXNG search results