Skip to content

Conversation

MAVRICK-1
Copy link
Contributor

@MAVRICK-1 MAVRICK-1 commented Sep 17, 2025

Add Context Limit Support for MCP Compatibility

Summary

Adds maxResponseSize parameter to all MCP tools to limit response size for better MCP compatibility.

Changes

  • Added optional maxResponseSize parameter to all tools (scrape, map, search, crawl, check_crawl_status, extract)
  • Enhanced asText() function with intelligent truncation
  • Added clear truncation message when limit exceeded
  • Updated tool descriptions and README documentation
Screenshot from 2025-09-17 15-15-29

Usage

{
  "name": "firecrawl_scrape",
  "arguments": {
    "url": "https://example.com",
    "maxResponseSize": 2000
  }
}

Benefits

  • Prevents MCP context overflow issues
  • Fully backward compatible (parameter is optional)
  • Works with all existing integrations
  • Clear user feedback when truncation occurs

Testing

✅ Tested with Claude Desktop - truncation works correctly
✅ Backward compatibility confirmed
✅ All tools support the new parameter

Fixes firecrawl/firecrawl#2165

- Add maxResponseSize parameter to all tools (scrape, map, search, crawl, check_crawl_status, extract)
- Implement intelligent content truncation in asText function
- Add truncation message when content exceeds specified limit
- Update tool descriptions with usage examples
- Add comprehensive documentation in README
- Maintain full backward compatibility
- Addresses GitHub issue #2165 for  bounty
@MAVRICK-1
Copy link
Contributor Author

cc @nickscamara can you pls review my Pr

@MAVRICK-1 MAVRICK-1 changed the title Add context limit support for MCP compatibility Add context limit support for MCP compatibility - [Add Context Limit Support for MCP] Sep 18, 2025
@nickscamara nickscamara requested review from nickscamara, rafaelsideguide and tomkosm and removed request for nickscamara and rafaelsideguide September 25, 2025 20:23
Copy link
Member

@nickscamara nickscamara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MAVRICK-1, this looks good. We are gonna be merging soon and issue your bounty!

@MAVRICK-1
Copy link
Contributor Author

Thanx my paypal email is mavrickrishi@gmail.com

@nickscamara
Copy link
Member

Thank you. Please allow 7 days for payment to go through. ccing @ericciarla for processing.

@nickscamara nickscamara merged commit 0e2d053 into firecrawl:main Sep 26, 2025
nickscamara added a commit that referenced this pull request Sep 26, 2025
@nickscamara
Copy link
Member

Hey @MAVRICK-1 we just realized that you are outputting as text. We actually cannot output as text. Has to be json. We just reverted the pr and are awaiting for a fix.

@nickscamara
Copy link
Member

Please re-open a pr with the fix if possible. Just trim the markdown of the scrapes and it should be fine. Once that's in we will issue the reward.

@MAVRICK-1
Copy link
Contributor Author

Okay fixing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Context Limit Support for MCP
2 participants