by mendableai
A Model Context Protocol (MCP) server implementation that integrates with Firecrawl for web scraping capabilities.
Big thanks to @vrknetha, @knacklabs for the initial implementation!
Play around with our MCP Server on MCP.so's playground or on Klavis AI.
env FIRECRAWL_API_KEY=fc-YOUR_API_KEY npx -y firecrawl-mcp
npm install -g firecrawl-mcp
Configuring Cursor 🖥️
Note: Requires Cursor version 0.45.6+
For the most up-to-date configuration instructions, please refer to the official Cursor documentation on configuring MCP servers:
Cursor MCP Server Configuration Guide
To configure Firecrawl MCP in Cursor v0.48.6
### Running with SSE Local Mode
To run the server using Server-Sent Events (SSE) locally instead of the default stdio transport:
```bash
env SSE_LOCAL=true FIRECRAWL_API_KEY=fc-YOUR_API_KEY npx -y firecrawl-mcp
Use the url: http://localhost:3000/sse
To install Firecrawl for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mendableai/mcp-server-firecrawl --client claude
For one-click installation, click one of the install buttons below...
[](https://insiders.vscode.dev/redirect/mcp/install?name=firecrawl&inputs=[{"type":"promptString","id":"apiKey","description":"Firecrawl API Key","password":true}]&config={"command":"npx","args":["-y","firecrawl-mcp"],"env":{"FIRECRAWL_API_KEY":"${input:apiKey}"}}) [
](https://insiders.vscode.dev/redirect/mcp/install?name=firecrawl&inputs=[{"type":"promptString","id":"apiKey","description":"Firecrawl API Key","password":true}]&config={"command":"npx","args":["-y","firecrawl-mcp"],"env":{"FIRECRAWL_API_KEY":"${input:apiKey}"}}&quality=insiders)
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P
and typing Preferences: Open User Settings (JSON)
.
*Configuration content*
Optionally, you can add it to a file called .vscode/mcp.json
in your workspace. This will allow you to share the configuration with others:
*Configuration content*
FIRECRAWL_API_KEY
: Your Firecrawl API key
FIRECRAWL_API_URL
FIRECRAWL_API_URL
(Optional): Custom API endpoint for self-hosted instances
https://firecrawl.your-domain.com
FIRECRAWL_RETRY_MAX_ATTEMPTS
: Maximum number of retry attempts (default: 3)FIRECRAWL_RETRY_INITIAL_DELAY
: Initial delay in milliseconds before first retry (default: 1000)FIRECRAWL_RETRY_MAX_DELAY
: Maximum delay in milliseconds between retries (default: 10000)FIRECRAWL_RETRY_BACKOFF_FACTOR
: Exponential backoff multiplier (default: 2)FIRECRAWL_CREDIT_WARNING_THRESHOLD
: Credit usage warning threshold (default: 1000)FIRECRAWL_CREDIT_CRITICAL_THRESHOLD
: Credit usage critical threshold (default: 100)For cloud API usage with custom retry and credit monitoring:
# Required for cloud API export FIRECRAWL_API_KEY=your-api-key # Optional retry configuration export FIRECRAWL_RETRY_MAX_ATTEMPTS=5 # Increase max retry attempts export FIRECRAWL_RETRY_INITIAL_DELAY=2000 # Start with 2s delay export FIRECRAWL_RETRY_MAX_DELAY=30000 # Maximum 30s delay export FIRECRAWL_RETRY_BACKOFF_FACTOR=3 # More aggressive backoff # Optional credit monitoring export FIRECRAWL_CREDIT_WARNING_THRESHOLD=2000 # Warning at 2000 credits export FIRECRAWL_CREDIT_CRITICAL_THRESHOLD=500 # Critical at 500 credits
For self-hosted instance:
# Required for self-hosted export FIRECRAWL_API_URL=https://firecrawl.your-domain.com # Optional authentication for self-hosted export FIRECRAWL_API_KEY=your-api-key # If your instance requires auth # Custom retry configuration export FIRECRAWL_RETRY_MAX_ATTEMPTS=10 export FIRECRAWL_RETRY_INITIAL_DELAY=500 # Start with faster retries
Add this to your claude_desktop_config.json
:
*Configuration content*
The server includes several configurable parameters that can be set via environment variables. Here are the default values if not configured:
const CONFIG = { retry: { maxAttempts: 3, // Number of retry attempts for rate-limited requests initialDelay: 1000, // Initial delay before first retry (in milliseconds) maxDelay: 10000, // Maximum delay between retries (in milliseconds) backoffFactor: 2, // Multiplier for exponential backoff }, credit: { warningThreshold: 1000, // Warn when credit usage reaches this level criticalThreshold: 100, // Critical alert when credit usage reaches this level }, };
These configurations control:
Retry Behavior
Credit Usage Monitoring
The server utilizes Firecrawl's built-in rate limiting and batch processing capabilities:
Use this guide to select the right tool for your task:
Tool | Best for | Returns |
---|---|---|
scrape | Single page content | markdown/html |
batch_scrape | Multiple known URLs | markdown/html[] |
map | Discovering URLs on a site | URL[] |
crawl | Multi-page extraction (with limits) | markdown/html[] |
search | Web search for info | results[] |
extract | Structured data from pages | JSON |
firecrawl_scrape
)Scrape content from a single URL with advanced options.
Best for:
Not recommended for:
Common mistakes:
Prompt Example:
"Get the content of the page at https://example.com."
Usage Example:
*Configuration content*
Returns:
firecrawl_batch_scrape
)Scrape multiple URLs efficiently with built-in rate limiting and parallel processing.
Best for:
Not recommended for:
Common mistakes:
Prompt Example:
"Get the content of these three blog posts: [url1, url2, url3]."
Usage Example:
*Configuration content*
Returns:
*Configuration content*
firecrawl_check_batch_status
)Check the status of a batch operation.
*Configuration content*
firecrawl_map
)Map a website to discover all indexed URLs on the site.
Best for:
Not recommended for:
Common mistakes:
Prompt Example:
"List all URLs on example.com."
Usage Example:
*Configuration content*
Returns:
firecrawl_search
)Search the web and optionally extract content from search results.
Best for:
Not recommended for:
Common mistakes:
Usage Example:
*Configuration content*
Returns:
Prompt Example:
"Find the latest research papers on AI published in 2023."
firecrawl_crawl
)Starts an asynchronous crawl job on a website and extract content from all pages.
Best for:
Not recommended for:
Warning: Crawl responses can be very large and may exceed token limits. Limit the crawl depth and number of pages, or use map + batch_scrape for better control.
Common mistakes:
Prompt Example:
"Get all blog posts from the first two levels of example.com/blog."
Usage Example:
*Configuration content*
Returns:
*Configuration content*
firecrawl_check_crawl_status
)Check the status of a crawl job.
*Configuration content*
Returns:
firecrawl_extract
)Extract structured information from web pages using LLM capabilities. Supports both cloud AI and self-hosted LLM extraction.
Best for:
Not recommended for:
Arguments:
urls
: Array of URLs to extract information fromprompt
: Custom prompt for the LLM extractionsystemPrompt
: System prompt to guide the LLMschema
: JSON schema for structured data extractionallowExternalLinks
: Allow extraction from external linksenableWebSearch
: Enable web search for additional contextincludeSubdomains
: Include subdomains in extractionWhen using a self-hosted instance, the extraction will use your configured LLM. For cloud API, it uses Firecrawl's managed LLM service.
Prompt Example:
"Extract the product name, price, and description from these product pages."
Usage Example:
*Configuration content*
Returns:
*Configuration content*
The server includes comprehensive logging:
Example log messages:
[INFO] Firecrawl MCP Server initialized successfully
[INFO] Starting scrape for URL: https://example.com
[INFO] Batch operation queued with ID: batch_1
[WARNING] Credit usage has reached warning threshold
[ERROR] Rate limit exceeded, retrying in 2s...
The server provides robust error handling:
Example error response:
*Configuration content*
# Install dependencies npm install # Build npm run build # Run tests npm test
npm test
Thanks to @vrknetha, @cawstudios for the initial implementation!
Thanks to MCP.so and Klavis AI for hosting and @gstarwd, @xiangkaiz and @zihaolin96 for integrating our server.
MIT License - see LICENSE file for details
13 contributors
nickscamara
@nickscamara
vrknetha
@vrknetha
tomkosm
@tomkosm
calclavia
@calclavia
mogery
@mogery
xiangkaiz
@xiangkaiz
ftonato
@ftonato
burkeholland
@burkeholland
CodeDuckky
@CodeDuckky
ericciarla
@ericciarla
calebpeffer
@calebpeffer
punkpeye
@punkpeye
rafaelsideguide
@rafaelsideguide
devin-ai-integration[bot]
@devin-ai-integration