@@ -39,32 +39,60 @@ npm install -g mcp-server-firecrawl
3939
4040### Environment Variables
4141
42+ #### Required for Cloud API
43+
4244- ` FIRE_CRAWL_API_KEY ` : Your FireCrawl API key
4345 - Required when using cloud API (default)
4446 - Optional when using self-hosted instance with ` FIRE_CRAWL_API_URL `
4547- ` FIRE_CRAWL_API_URL ` (Optional): Custom API endpoint for self-hosted instances
4648 - Example: ` https://firecrawl.your-domain.com `
4749 - If not provided, the cloud API will be used (requires API key)
4850
51+ #### Optional Configuration
52+
53+ ##### Retry Configuration
54+
55+ - ` FIRE_CRAWL_RETRY_MAX_ATTEMPTS ` : Maximum number of retry attempts (default: 3)
56+ - ` FIRE_CRAWL_RETRY_INITIAL_DELAY ` : Initial delay in milliseconds before first retry (default: 1000)
57+ - ` FIRE_CRAWL_RETRY_MAX_DELAY ` : Maximum delay in milliseconds between retries (default: 10000)
58+ - ` FIRE_CRAWL_RETRY_BACKOFF_FACTOR ` : Exponential backoff multiplier (default: 2)
59+
60+ ##### Credit Usage Monitoring
61+
62+ - ` FIRE_CRAWL_CREDIT_WARNING_THRESHOLD ` : Credit usage warning threshold (default: 1000)
63+ - ` FIRE_CRAWL_CREDIT_CRITICAL_THRESHOLD ` : Credit usage critical threshold (default: 100)
64+
4965### Configuration Examples
5066
51- For cloud API usage (default) :
67+ For cloud API usage with custom retry and credit monitoring :
5268
5369``` bash
70+ # Required for cloud API
5471export FIRE_CRAWL_API_KEY=your-api-key
55- ```
5672
57- For self-hosted instance without authentication:
73+ # Optional retry configuration
74+ export FIRE_CRAWL_RETRY_MAX_ATTEMPTS=5 # Increase max retry attempts
75+ export FIRE_CRAWL_RETRY_INITIAL_DELAY=2000 # Start with 2s delay
76+ export FIRE_CRAWL_RETRY_MAX_DELAY=30000 # Maximum 30s delay
77+ export FIRE_CRAWL_RETRY_BACKOFF_FACTOR=3 # More aggressive backoff
5878
59- ``` bash
60- export FIRE_CRAWL_API_URL=https://firecrawl.your-domain.com
79+ # Optional credit monitoring
80+ export FIRE_CRAWL_CREDIT_WARNING_THRESHOLD=2000 # Warning at 2000 credits
81+ export FIRE_CRAWL_CREDIT_CRITICAL_THRESHOLD=500 # Critical at 500 credits
6182```
6283
63- For self-hosted instance with authentication :
84+ For self-hosted instance:
6485
6586``` bash
87+ # Required for self-hosted
6688export FIRE_CRAWL_API_URL=https://firecrawl.your-domain.com
67- export FIRE_CRAWL_API_KEY=your-api-key # Optional for authenticated self-hosted instances
89+
90+ # Optional authentication for self-hosted
91+ export FIRE_CRAWL_API_KEY=your-api-key # If your instance requires auth
92+
93+ # Custom retry configuration
94+ export FIRE_CRAWL_RETRY_MAX_ATTEMPTS=10
95+ export FIRE_CRAWL_RETRY_INITIAL_DELAY=500 # Start with faster retries
6896```
6997
7098### Usage with Claude Desktop
@@ -78,7 +106,15 @@ Add this to your `claude_desktop_config.json`:
78106 "command" : " npx" ,
79107 "args" : [" -y" , " mcp-server-firecrawl" ],
80108 "env" : {
81- "FIRE_CRAWL_API_KEY" : " YOUR_API_KEY_HERE"
109+ "FIRE_CRAWL_API_KEY" : " YOUR_API_KEY_HERE" ,
110+
111+ "FIRE_CRAWL_RETRY_MAX_ATTEMPTS" : " 5" ,
112+ "FIRE_CRAWL_RETRY_INITIAL_DELAY" : " 2000" ,
113+ "FIRE_CRAWL_RETRY_MAX_DELAY" : " 30000" ,
114+ "FIRE_CRAWL_RETRY_BACKOFF_FACTOR" : " 3" ,
115+
116+ "FIRE_CRAWL_CREDIT_WARNING_THRESHOLD" : " 2000" ,
117+ "FIRE_CRAWL_CREDIT_CRITICAL_THRESHOLD" : " 500"
82118 }
83119 }
84120 }
@@ -87,23 +123,42 @@ Add this to your `claude_desktop_config.json`:
87123
88124### System Configuration
89125
90- The server includes several configurable parameters:
126+ The server includes several configurable parameters that can be set via environment variables. Here are the default values if not configured :
91127
92128``` typescript
93129const CONFIG = {
94130 retry: {
95- maxAttempts: 3 ,
96- initialDelay: 1000 , // 1 second
97- maxDelay: 10000 , // 10 seconds
98- backoffFactor: 2 ,
131+ maxAttempts: 3 , // Number of retry attempts for rate-limited requests
132+ initialDelay: 1000 , // Initial delay before first retry (in milliseconds)
133+ maxDelay: 10000 , // Maximum delay between retries (in milliseconds)
134+ backoffFactor: 2 , // Multiplier for exponential backoff
99135 },
100136 credit: {
101- warningThreshold: 1000 ,
102- criticalThreshold: 100 ,
137+ warningThreshold: 1000 , // Warn when credit usage reaches this level
138+ criticalThreshold: 100 , // Critical alert when credit usage reaches this level
103139 },
104140};
105141```
106142
143+ These configurations control:
144+
145+ 1 . ** Retry Behavior**
146+
147+ - Automatically retries failed requests due to rate limits
148+ - Uses exponential backoff to avoid overwhelming the API
149+ - Example: With default settings, retries will be attempted at:
150+ - 1st retry: 1 second delay
151+ - 2nd retry: 2 seconds delay
152+ - 3rd retry: 4 seconds delay (capped at maxDelay)
153+
154+ 2 . ** Credit Usage Monitoring**
155+ - Tracks API credit consumption for cloud API usage
156+ - Provides warnings at specified thresholds
157+ - Helps prevent unexpected service interruption
158+ - Example: With default settings:
159+ - Warning at 1000 credits remaining
160+ - Critical alert at 100 credits remaining
161+
107162### Rate Limiting and Batch Processing
108163
109164The server utilizes FireCrawl's built-in rate limiting and batch processing capabilities:
0 commit comments