feat: add batch scrape tools with maxConcurrency support (ENG-2756)#78
Closed
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Closed
feat: add batch scrape tools with maxConcurrency support (ENG-2756)#78devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
- Add BATCH_SCRAPE_TOOL definition with maxConcurrency parameter - Add CHECK_BATCH_STATUS_TOOL for monitoring batch operations - Implement request handlers for both new tools - Register tools in ListToolsRequestSchema handler - Follow existing patterns from SCRAPE_TOOL and CHECK_CRAWL_STATUS_TOOL Fixes ENG-2756 Co-Authored-By: Nick <nicolascamara29@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The TypeScript compiler no longer requires error suppression for the origin property in the batch scrape options, so removing the unused directive to fix CI build failure. Co-Authored-By: Nick <nicolascamara29@gmail.com>
Contributor
Author
|
Closing due to inactivity for more than 30 days. Configure here. |
|
why was this closed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add batch scrape tools with maxConcurrency support (ENG-2756)
Summary
This PR implements two new MCP tools to support batch scraping operations with concurrency control:
firecrawl_batch_scrape: Initiates batch scraping of multiple URLs with configurablemaxConcurrencyparameterfirecrawl_check_batch_status: Monitors the progress and status of batch scrape jobsThe implementation follows existing patterns from
SCRAPE_TOOLandCHECK_CRAWL_STATUS_TOOL, exposing the underlying Firecrawl JavaScript SDK's batch scraping capabilities through the MCP server interface.Key changes:
maxConcurrencyparameterasyncBatchScrapeUrlsandcheckBatchScrapeStatusSDK methodsisBatchScrapeOptionsfor input validationListToolsRequestSchemahandlerReview & Testing Checklist for Human
firecrawl_check_batch_statuscorrectly returns job progress and results@ts-expect-errorcomments are acceptable for maxConcurrency and origin parametersRecommended test plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD Client["MCP Client"] Server["src/index.ts<br/>MCP Server"] SDK["Firecrawl JS SDK<br/>asyncBatchScrapeUrls()"] API["Firecrawl API<br/>/v1/batch/scrape"] Client -->|firecrawl_batch_scrape| Server Client -->|firecrawl_check_batch_status| Server Server -->|batchScrapeUrls| SDK Server -->|checkBatchScrapeStatus| SDK SDK -->|HTTP POST| API Server:::major-edit SDK:::context API:::context Client:::context subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
@ts-expect-errorformaxConcurrencyparameter since it's not officially inScrapeParamstype but is accepted by the underlying APIasyncBatchScrapeUrlsinstead ofbatchScrapeUrlsto return job ID immediately rather than waiting for completion