hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Uses .ENV files to manage API keys and configuration settings for the WebSearch server.
Provides integration for repository management, allowing users to fork, clone, and contribute to the WebSearch project.
Supports output of crawled and extracted web content in Markdown format for improved readability and structure.
WebSearch - 高级网页搜索和内容提取工具
使用 Python 构建的强大的网络搜索和内容提取工具,利用 Firecrawl API 实现高级网络抓取、搜索和内容分析功能。
🚀 功能
- 高级网页搜索:使用可自定义的参数执行智能网页搜索
- 内容提取:使用自然语言提示从网页中提取特定信息
- 网络爬取:爬取具有可配置深度和限制的网站
- 网页抓取:抓取网页,支持多种输出格式
- MCP 集成:构建为模型上下文协议 (MCP) 服务器,实现无缝集成
📋 先决条件
- Python 3.8 或更高版本
- uv 包管理器
- Firecrawl API 密钥
- OpenAI API 密钥(可选,用于增强功能)
- Tavily API 密钥(可选,用于附加搜索功能)
🛠️ 安装
- 安装 uv:
- 克隆存储库:
- 使用 uv 创建并激活虚拟环境:
- 使用 uv 安装依赖项:
- 设置环境变量:
🎯 使用方法
使用 Claude 桌面版进行设置
您无需直接运行服务器,而是可以配置 Claude for Desktop 来访问 WebSearch 工具:
- 找到或创建您的 Claude for Desktop 配置文件:
- Windows:
%env:AppData%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- 将 WebSearch 服务器配置添加到
mcpServers
部分:
- 确保将目录路径替换为 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
文件,您可以将其用作模板:
- 复制示例文件:
- 使用您的 API 密钥编辑
.env
文件:
获取 API 密钥
- OpenAI API密钥:
- 访问OpenAI 平台
- 注册或登录
- 导航至 API 密钥部分
- 创建新的密钥
- Firecrawl API密钥:
- 访问Firecrawl 的网站
- 创建一个帐户
- 导航到您的仪表板
- 生成新的 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 用 ❤️ 制作
You must be authenticated.
构建为模型上下文协议 (MCP) 服务器,使用 Firecrawl API 提供高级网络搜索、内容提取、网络爬行和抓取功能。
- 🚀 Features
- 📋 Prerequisites
- 🛠️ Installation
- 🎯 Usage
- 📚 API Reference
- 🔧 Configuration
- 🤝 Contributing
- 📝 License
- 🙏 Acknowledgments
- 📬 Contact