VS Code

VS Code logo

Setup Scrapfly MCP with any MCP-compatible VS Code extension. This guide covers the generic configuration pattern for connecting Scrapfly to VS Code-based AI assistants.

Code Editor Windows macOS Linux Official Website

Prerequisites

Before getting started, make sure you have the following:

  • Visual Studio Code installed
  • An MCP-compatible VS Code extension (Claude Code, Cline, Roo Code, etc.)
  • Node.js 18+ (for npx command)
  • Your Scrapfly API key (only if not using OAuth2)

Setup Instructions

This guide covers the generic pattern for connecting Scrapfly MCP to any MCP-compatible VS Code extension. Setup takes less than 5 minutes.

  1. Install an MCP-Compatible Extension

    First, install a VS Code extension that supports MCP (Model Context Protocol):

    Popular MCP-compatible extensions:

    • Claude Code - Official Anthropic extension
    • Cline - Autonomous AI coding assistant
    • Roo Code - AI pair programming extension
    • Or any other extension that supports MCP servers
    Tip: Check Extension Documentation

    Each MCP-compatible extension may have specific setup requirements. Check the extension's documentation for any additional prerequisites.

  2. Locate VS Code Settings File

    MCP servers are configured in VS Code's settings.json file. Choose your preferred access method:

    1. Press Ctrl+, (Windows/Linux) or ⌘+, (macOS)
    2. Search for "MCP Servers"
    3. Click "Edit in settings.json"
    1. Press Ctrl+Shift+P (Windows/Linux) or ⌘+Shift+P (macOS)
    2. Type "Preferences: Open User Settings (JSON)"
    3. Press Enter

    Windows:

    macOS:

    Linux:

    Tip: User vs Workspace Settings

    Use User Settings to make Scrapfly available in all VS Code projects. Use Workspace Settings to configure Scrapfly for a specific project only.

  3. Add Scrapfly MCP Server

    Select your preferred authentication method:

    How it works: Your MCP extension displays an OAuth2 URL. Click it to authorize in your browser - happens once, then managed automatically. See project-scoped setup for team collaboration.
    Sign up for free to get your API key.

    Advanced: Multiple MCP Servers

    You can configure multiple MCP servers in the same settings file:

  4. Reload VS Code Window

    Apply the MCP configuration by reloading:

    • Press Ctrl+Shift+P (Windows/Linux) or ⌘+Shift+P (macOS)
    • Type "Reload Window" and press Enter
    Alternative: Restart VS Code

    You can also completely close VS Code and reopen it to ensure all changes are applied.

  5. Verify the Integration

    Confirm Scrapfly MCP is working with your extension:

    1. Open your MCP-compatible extension's interface (sidebar, panel, or chat)
    2. Look for the hammer icon (🔨) or MCP tools indicator
    3. Try a test prompt: "Use Scrapfly to scrape https://news.ycombinator.com and show the top 5 posts"
    4. Your extension should call Scrapfly MCP tools and return the results
    Pro Tip: Most MCP-compatible extensions will automatically call the scraping_instruction_enhanced tool to get required authentication parameters before making scraping requests.

Example Prompts

Simple Page Scraping
Scrape https://news.ycombinator.com and show the top 5 post titles
Structured Data Extraction
Scrape https://web-scraping.dev/products and create a JSON array of product names and prices
Screenshot Capture
Take a full-page screenshot of https://scrapfly.io
Multi-Step Workflow
Scrape the Hacker News homepage, find the top post, then scrape that post's discussion page

Troubleshooting

Problem: Extension does not detect Scrapfly MCP tools

Solution:

  • Ensure npx is available: run npx --version in VS Code terminal
  • Check settings.json is valid JSON (VS Code will show syntax errors)
  • Reload the window: Ctrl+Shift+P → "Reload Window"
  • Check VS Code Output panel (View → Output) and select your extension from dropdown
  • Verify your extension supports MCP (check extension documentation)

View logs in VS Code:

  • Open Output panel: Ctrl+Shift+U (Windows/Linux) or ⌘+Shift+U (macOS)
  • Select your extension name from the dropdown in the top-right
  • Look for errors related to MCP server connection or npx command execution

Problem: Browser does not open for OAuth2 authentication

Solution:

  • Manually copy the OAuth2 URL from extension interface and paste it into your browser
  • Ensure you're logged into Scrapfly in your browser
  • Check that your default browser is set correctly
  • Try using API key authentication as a fallback

Problem: VS Code cannot find npx command

Solution:

  • Ensure Node.js 18+ is installed: run node --version in terminal
  • Verify npx is in your PATH: run npx --version
  • Restart VS Code after installing Node.js
  • On Windows, you may need to add Node.js to PATH manually

Problem: Issues when multiple MCP servers are configured

Solution:

  • Ensure each MCP server has a unique key in the mcpServers object
  • Check that there are no duplicate server names
  • Verify JSON syntax is correct (commas, brackets, quotes)
  • Try disabling other MCP servers temporarily to isolate the issue

Next Steps

Summary