MCP Server (Recommended)
The fastest way to use ScrapeGraphAI in Cursor is via the MCP Server. This lets Cursor’s AI agent call ScrapeGraphAI tools directly without writing any code. See the MCP Server setup for Cursor guide for full instructions.Manual integration
If you prefer to write code directly, use the Python or JavaScript SDK.Python
Install the SDK:Cmd+K or open the chat with Cmd+L:
Write a Python function using scrapegraph_py that extracts the title, author, and date from any blog post URL.Cursor will generate:
JavaScript
Install the SDK:Write a JavaScript function using scrapegraph-js that extracts product details from an e-commerce page.
Tips for using Cursor with ScrapeGraphAI
- Paste error messages into the Cursor chat to get instant fix suggestions.
- Ask Cursor to add output schemas (
output_schemawith Pydantic or Zod) to get strongly-typed results. - Use
@docsin Cursor chat to reference the ScrapeGraphAI docs directly while coding.
Store your API key in a
.env file and load it via python-dotenv or process.env — never hardcode it in your source files.