MCP Firecrawl 服务器
这是一个简单的 MCP 服务器,它提供使用 Firecrawl 的 API 来抓取网站和提取结构化数据的工具。
设置
安装依赖项:
在根目录中创建一个
.env
文件,其中包含以下变量:
FIRECRAWL_API_TOKEN
(必需):您的 Firecrawl API 令牌SENTRY_DSN
(可选):用于错误跟踪和性能监控的 Sentry DSN
启动服务器:
或者,您可以在运行服务器时直接设置环境变量:
特征
网站抓取:从各种格式的网站中提取内容
结构化数据提取:根据自定义模式提取特定数据点
错误跟踪:与 Sentry 集成,用于错误跟踪和性能监控
用法
该服务器公开了两个工具:
scrape-website
:具有多种格式选项的基本网站抓取extract-data
:基于提示和模式的结构化数据提取
工具:scrape-website
该工具抓取网站并以请求的格式返回其内容。
参数:
url
(字符串,必需):要抓取的网站的 URLformats
(字符串数组,可选):所需输出格式的数组。支持的格式包括:"markdown"
(默认)"html"
"text"
MCP Inspector 的使用示例:
工具:extract-data
该工具根据提供的提示和模式从网站提取结构化数据。
参数:
urls
(字符串数组,必需):从中提取数据的 URL 数组prompt
(字符串,必需):描述要提取什么数据的提示schema
(对象,必需):要提取的数据的模式定义
模式定义应该是一个对象,其中键是字段名称,值是类型。支持的类型包括:
"string"
:用于文本字段"boolean"
:用于真/假字段"number"
:用于数字字段数组:指定为
["type"]
其中 type 是上述之一对象:具有自己类型定义的嵌套对象
MCP Inspector 的使用示例:
如果抓取或提取失败,这两种工具都会返回适当的错误消息,并且如果配置的话,会自动将错误记录到 Sentry。
故障排除
如果您遇到问题:
验证您的 Firecrawl API 令牌是否有效
检查您尝试抓取的 URL 是否可访问
对于复杂的模式,确保它们遵循支持的格式
查看 Sentry 日志以获取详细的错误信息(如果已配置)
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
该服务器提供使用 Firecrawl 的 API 抓取网站并从中提取结构化数据的工具,支持多种格式的基本网站抓取和基于自定义模式的数据提取。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityProvides functionality to fetch web content in various formats, including HTML, JSON, plain text, and Markdown.Last updated -4376610MIT License
- AsecurityAlicenseAqualityA server that provides web scraping and intelligent content searching capabilities using the Firecrawl API, enabling AI agents to extract structured data from websites and perform content searches.Last updated -2MIT License
- AsecurityFlicenseAqualityProvides functionality to fetch web content in various formats, including HTML, JSON, plain text, and Markdown.Last updated -4104,1622
Oxylabs MCP Serverofficial
AsecurityAlicenseAqualityA scraper tool that leverages the Oxylabs Web Scraper API to fetch and process web content with flexible options for parsing and rendering pages, enabling efficient content extraction from complex websites.Last updated -266MIT License