This MCP Firecrawl Server provides tools for scraping websites and extracting structured data using Firecrawl's APIs. It supports both basic content scraping and advanced data extraction based on custom schemas.
To set up the MCP Firecrawl Server on your system:
Install dependencies:
npm install
Create a .env
file in the root directory with the following variables:
FIRECRAWL_API_TOKEN=your_token_here
SENTRY_DSN=your_sentry_dsn_here
FIRECRAWL_API_TOKEN
(required): Your Firecrawl API tokenSENTRY_DSN
(optional): Sentry DSN for error tracking and performance monitoringStart the server:
npm start
Alternatively, you can set environment variables directly when running the server:
FIRECRAWL_API_TOKEN=your_token_here npm start
The server provides two main tools:
This tool scrapes a website and returns its content in the requested formats.
Parameters:
url
(string, required): The URL of the website to scrapeformats
(array of strings, optional): Array of desired output formats. Supported formats are:
"markdown"
(default)"html"
"text"
Example usage with MCP Inspector:
# Basic usage (defaults to markdown)
mcp-inspector --tool scrape-website --args '{
"url": "https://example.com"
}'
# Multiple formats
mcp-inspector --tool scrape-website --args '{
"url": "https://example.com",
"formats": ["markdown", "html", "text"]
}'
This tool extracts structured data from websites based on a provided prompt and schema.
Parameters:
urls
(array of strings, required): Array of URLs to extract data fromprompt
(string, required): The prompt describing what data to extractschema
(object, required): Schema definition for the data to extractThe schema definition should be an object where keys are field names and values are types. Supported types are:
"string"
: For text fields"boolean"
: For true/false fields"number"
: For numeric fields["type"]
where type is one of the aboveExample usage with MCP Inspector:
# Basic example extracting company information
mcp-inspector --tool extract-data --args '{
"urls": ["https://example.com"],
"prompt": "Extract the company mission, whether it supports SSO, and whether it is open source.",
"schema": {
"company_mission": "string",
"supports_sso": "boolean",
"is_open_source": "boolean"
}
}'
# Complex example with nested data
mcp-inspector --tool extract-data --args '{
"urls": ["https://example.com/products", "https://example.com/pricing"],
"prompt": "Extract product information including name, price, and features.",
"schema": {
"products": [{
"name": "string",
"price": "number",
"features": ["string"]
}]
}
}'
If you encounter issues:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.