Firecrawl MCP 工具和操作
Firecrawl MCP 的可用工具、运行行为和错误处理。
此处列出了 Firecrawl MCP 服务器提供的全部工具。工具是否可用取决于您的连接方式。
| 连接模式 | 工具可用性 |
|---|---|
| 托管账户 OAuth | 完整工具集,具体取决于套餐和功能可用性 |
| 托管 API 密钥 | 完整工具集,具体取决于套餐和功能可用性 |
| 托管免密钥 | 仅限 firecrawl_search、firecrawl_scrape 和 firecrawl_parse |
| 使用云端 API 密钥的本地 MCP | 由 API 支持的工具;直接解析本地文件需要自托管 API URL |
| 使用自托管 API 的本地 MCP | 由该部署中启用的服务支持的工具 |
部分可选工具可能因环境或团队策略而被禁用。请先参阅 连接 Firecrawl MCP,选择身份验证模式;有关当前的免密钥额度,请参见 限流。
使用高级选项从单个 URL 中抓取内容。
{
"name": "firecrawl_scrape",
"arguments": {
"url": "https://example.com",
"formats": ["markdown"],
"onlyMainContent": true,
"waitFor": 1000,
"mobile": false,
"includeTags": ["article", "main"],
"excludeTags": ["nav", "footer"],
"skipTlsVerification": false
}
}若要对个人身份信息进行脱敏,请在抓取工具的参数中添加 redactPII。
{
"name": "firecrawl_scrape",
"arguments": {
"url": "https://example.com/contact",
"formats": ["markdown"],
"redactPII": true
}
}扫描网站,发现其中所有已编入索引的 URL。
{
"name": "firecrawl_map",
"arguments": {
"url": "https://example.com",
"search": "blog",
"sitemap": "include",
"includeSubdomains": false,
"limit": 100,
"ignoreQueryParameters": true
}
}url:要映射的网站基础 URLsearch:用于筛选 URL 的可选搜索词sitemap:控制 sitemap 的使用方式:“include”、“skip”或“only”includeSubdomains:映射时是否包含子域名limit:返回的最大 URL 数量ignoreQueryParameters:映射时是否忽略查询参数
最适合: 在决定抓取哪些内容前发现网站中的 URL;查找网站的特定部分。 返回: 网站中找到的 URL 数组。
进行网页搜索,并可选择从搜索结果中提取内容。
{
"name": "firecrawl_search",
"arguments": {
"query": "your search query",
"limit": 5,
"location": "United States",
"tbs": "qdr:m",
"scrapeOptions": {
"formats": ["markdown"],
"onlyMainContent": true
}
}
}query:搜索查询字符串 (必填)limit:返回结果的最大数量location:搜索结果的地理位置tbs:基于时间的搜索筛选条件 (例如,qdr:d表示过去一天,qdr:w表示过去一周,qdr:m表示过去一个月)filter:附加搜索筛选条件sources:要搜索的来源类型数组 (web、images、news)scrapeOptions:用于抓取搜索结果页面的选项enterprise:企业选项数组 (default、anon、zdr)
使用 firecrawl_search 后,可提交结构化反馈。每个搜索 ID 的首次反馈提交可返还一个额度,但受团队每日上限限制。
{
"name": "firecrawl_search_feedback",
"arguments": {
"searchId": "search-id-from-firecrawl-search",
"rating": "good",
"valuableSources": [
{
"url": "https://docs.firecrawl.dev/mcp-server",
"reason": "Contains the current connection guidance."
}
]
}
}设置 FIRECRAWL_NO_SEARCH_FEEDBACK=1 可避免注册此可选工具。
为已完成的 抓取、解析、Map 或 搜索 任务提供简明的端点级反馈。请勿包含原始抓取或解析内容。
{
"name": "firecrawl_feedback",
"arguments": {
"endpoint": "scrape",
"jobId": "job-id",
"rating": "partial",
"issues": ["missing_markdown"],
"url": "https://example.com"
}
}使用 firecrawl_search_feedback 对搜索结果质量提供反馈。设置 FIRECRAWL_NO_ENDPOINT_FEEDBACK=1 可避免注册通用反馈工具。
将 PDF、DOCX、XLSX 或 HTML 等本地文件解析为干净、可供 LLM 使用的数据。
{
"name": "firecrawl_parse",
"arguments": {
"filePath": "/absolute/path/to/report.pdf",
"formats": ["markdown"]
}
}当你通过 FIRECRAWL_API_URL 在本地针对 Firecrawl API 实例运行 Firecrawl MCP 时,MCP 服务器可以直接读取 filePath,并将文件字节发送到 /v2/parse。
使用远程托管的 MCP 服务器时,托管服务器无法读取你机器上的文件。在这种情况下,firecrawl_parse 会采用两步交接流程,该流程同样适用于远程免密钥 URL:
- 使用
filePath调用firecrawl_parse。该工具会返回一条预填充的上传命令,以及包含uploadRef的nextToolCall。 - 在能够读取该文件的机器上运行上传命令,然后使用返回的
uploadRef再次调用firecrawl_parse。
上传命令会将文件字节发送到一个短时有效的签名上传目标,其中不包含你的 Firecrawl API 密钥。
filePath:要解析的本地文件路径。首次调用时使用。uploadRef:首次托管 MCP 调用返回的引用。上传成功后,第二次调用时使用。formats:输出格式。默认值为markdown。parsers:解析器控制选项,例如 PDF 解析选项。contentType:可选的文件 MIME 类型覆盖设置。declaredSizeBytes:可选的文件大小提示。文件大小上限为 50 MB。
最适合: 无法通过公开 URL 访问的本地或非公开文档。
不建议用于: 公开文档 URL。请改用 firecrawl_scrape;它会检测并解析 URL 中的文档。
使用高级选项启动异步爬取。
{
"name": "firecrawl_crawl",
"arguments": {
"url": "https://example.com",
"maxDiscoveryDepth": 2,
"limit": 100,
"allowExternalLinks": false,
"deduplicateSimilarURLs": true
}
}查看爬取任务的状态。
{
"name": "firecrawl_check_crawl_status",
"arguments": {
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}返回: 爬取任务的状态和进度,以及 (如有) 结果。
利用 LLM 从网页中提取结构化信息。支持云端 AI 和自托管 LLM。
{
"name": "firecrawl_extract",
"arguments": {
"urls": ["https://example.com/page1", "https://example.com/page2"],
"prompt": "Extract product information including name, price, and description",
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"price": { "type": "number" },
"description": { "type": "string" }
},
"required": ["name", "price"]
},
"allowExternalLinks": false,
"enableWebSearch": false,
"includeSubdomains": false
}
}响应示例:
{
"content": [
{
"type": "text",
"text": {
"name": "Example Product",
"price": 99.99,
"description": "This is an example product description"
}
}
],
"isError": false
}urls: 用于提取信息的 URL 数组prompt: 用于 LLM 提取的自定义 promptschema: 用于提取结构化数据的 JSON schemaallowExternalLinks: 允许从外部链接中提取信息enableWebSearch: 启用网页搜索以获取额外上下文includeSubdomains: 提取时包含子域名
使用自托管实例时,提取将使用您配置的 LLM。云 API 则使用 Firecrawl 托管的 LLM 服务。
自主网页调研代理,可根据你的查询自行浏览互联网、搜索信息、访问页面,并提取结构化数据。该操作以异步方式运行——会立即返回任务 ID,你可轮询 firecrawl_agent_status 检查任务何时完成并获取结果。
{
"name": "firecrawl_agent",
"arguments": {
"prompt": "Find the top 5 AI startups founded in 2024 and their funding amounts",
"schema": {
"type": "object",
"properties": {
"startups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"funding": { "type": "string" },
"founded": { "type": "string" }
}
}
}
}
}
}
}您还可以指定让代理重点关注的 URL:
{
"name": "firecrawl_agent",
"arguments": {
"urls": ["https://docs.firecrawl.dev", "https://firecrawl.dev/pricing"],
"prompt": "Compare the features and pricing information from these pages"
}
}prompt:所需数据的自然语言描述 (必填,最多 10,000 个字符)urls:可选的 URL 数组,用于让代理聚焦于特定页面schema:用于结构化输出的可选 JSON schema
最适合: 不清楚确切 URL 的复杂研究任务;多源数据收集;查找分散在网页各处的信息;从常规抓取无法处理的 JavaScript 密集型 SPA 中提取数据。
返回: 用于检查状态的任务 ID。使用 firecrawl_agent_status 轮询获取结果。
检查代理任务的状态,并在任务完成后获取结果。每隔 15~30 秒轮询一次,在判定请求失败前,至少持续轮询 2~3 分钟。
{
"name": "firecrawl_agent_status",
"arguments": {
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}id:firecrawl_agent返回的代理任务 ID (必填)
可能的状态:
processing:代理仍在调研中 -- 继续轮询completed:调研已完成 -- 响应中包含提取的数据failed:发生错误
**返回:**代理任务的状态、进度和结果 (如已完成) 。
在实时浏览器会话中与页面交互:点击按钮、填写表单、提取动态内容,或继续深入导航。
可使用以下两种定位模式之一:
- 传入
url,即可在一次 MCP 调用中打开新页面并与其交互。 - 传入之前
firecrawl_scrape调用返回的scrapeId,以复用已加载的页面。
不要同时传入 url 和 scrapeId。请提供 prompt 或 code 其中之一。scrapeOptions 仅可在 url 模式下使用。
URL 模式示例:
{
"name": "firecrawl_interact",
"arguments": {
"url": "https://example.com/products",
"prompt": "Click on the first product and tell me its price"
}
}复用抓取的示例:
{
"name": "firecrawl_interact",
"arguments": {
"scrapeId": "scrape-id-from-previous-scrape",
"prompt": "Click the Sign In button"
}
}url:要交互的页面;系统会为您打开会话。使用此项或scrapeId。scrapeId:此前调用firecrawl_scrape返回的抓取任务 ID。使用此项或url。prompt:描述要执行操作的自然语言指令。提供prompt或code。code:在浏览器会话中执行的代码。提供code或prompt。language:bash、python或node(可选,默认值为node,仅与code配合使用) 。timeout:执行超时时间 (秒) ,范围为 1–300 (可选,默认值为 30) 。scrapeOptions:仅在url模式下使用的可选抓取控制选项。
最适合: 在单个页面上执行多步骤工作流,例如搜索网站、点击搜索结果、填写表单,以及提取需要交互才能获取的数据。
返回: 包含输出和实时视图 URL 的交互结果。
停止已抓取页面的交互会话。完成交互后调用此工具以释放资源。
{
"name": "firecrawl_interact_stop",
"arguments": {
"scrapeId": "scrape-id-from-previous-scrape"
}
}scrapeId:要停止的会话对应的抓取 ID (必填)
**返回:**确认会话已停止。
使用只读研究工具进行文献综述、论文查阅、引文发现以及搜索公开的 GitHub 仓库。
| 工具 | 用途 |
|---|---|
firecrawl_research_search_papers | 搜索研究论文 |
firecrawl_research_inspect_paper | 查看单篇论文的元数据和详细信息 |
firecrawl_research_related_papers | 查找与指定论文相关的论文 |
firecrawl_research_read_paper | 阅读可用的论文内容 |
firecrawl_research_search_github | 搜索公开的 GitHub 仓库 |
这些工具不属于托管免密钥服务的一部分。
创建和管理定期网页监控。监控会按计划执行检查,将结果与保存的快照进行比较,并可通过 Webhook 或电子邮件发送通知。
{
"name": "firecrawl_monitor_create",
"arguments": {
"page": "https://example.com/pricing",
"goal": "Alert when pricing, packaging, or launch messaging changes."
}
}| 工具 | 用途 |
|---|---|
firecrawl_monitor_create | 创建页面监控或爬取监控 |
firecrawl_monitor_list | 列出监控 |
firecrawl_monitor_get | 获取单个监控 |
firecrawl_monitor_update | 更新监控 |
firecrawl_monitor_run | 立即触发检查 |
firecrawl_monitor_delete | 删除监控 |
firecrawl_monitor_checks | 列出指定监控的检查记录 |
firecrawl_monitor_check | 获取单个页面级检查及其差异 |
firecrawl_monitor_delete 会永久删除监控。MCP 客户端仅应在用户明确要求删除该监控时调用此工具。
服务器提供全面的日志记录,包括:
- 操作状态和进度
- 性能指标
- 额度使用情况监控
- 限流跟踪
- 错误情况
日志示例:
[INFO] Firecrawl MCP Server initialized successfully
[INFO] Starting scrape for URL: https://example.com
[INFO] Starting crawl for URL: https://example.com
[WARNING] Credit usage has reached warning threshold
[ERROR] Rate limit exceeded, retrying in 2s...服务器提供完善的错误处理机制:
- 自动重试瞬时错误
- 通过退避策略处理限流
- 提供详细的错误信息
- 额度使用警告
- 网络容错能力
错误响应示例:
{
"content": [
{
"type": "text",
"text": "Error: Rate limit exceeded. Retrying in 2 seconds..."
}
],
"isError": true
}