MCP Coding Example – Building with Existing MCP Server

After getting knowledge about MCP Servers in the previous lessons, let’s now see Web Scraping with FireCrawl MCP Server on Windows. We will also work with Cursor to code with AI.

We will follow the steps below one by one:

  1. Download and Install Cursor
  2. Download and Install NodeJS
  3. Signup FireCrawl
  4. Generate a free API key from FireCrawl
  5. Open the Cursor and go to Settings
  6. Create new MCP Server
  7. mcp.json
  8. Cursor Chat
  9. Installed MCP Servers
  10. Activity Log

Let us begin with step 1:

Step 1: Download and Install Cursor

Go to the official website of Cursor, sign up, and download Cursor AI on Windows.

Click the “Download for Windows” button, as shown below. Download the exe file:

Download and Install Cursor to code with AI

After downloading the exe file, double-click and install the Cursor on Windows.

Step 2: Download and Install NodeJS

Go to the official website of NodeJS, sign up, and download NodeJS on Windows.

Step 3: Sign up for Firecrawl

After installing the cursor, go to https://firecrawl.dev/

Click the Sign up button and create a new account.

Go to firecrawl and create a new account

Verify your email ID, and a new account will be created on Firecrawl. You will be redirected to your Dashboard on Firecrawl:

Reaching the Firecrawl Dashboard

Step 4: Generate a free API key from firecrawl.dev

After signing up on the Firecrawls website, go to the API Keys tab on the left, copy the API key:

Generate a new API key from Firecrawl

Step 5: Open the Cursor and go to Settings

Follow the steps below:

Open Cursor Settings like this:

Go to Cursor Settings

Step 6: Create a new MCP Server

Now, click Tools & MCP, click New MCP Server:

Create a new MCP Server

Step 7: mcp.json

The mcp.json file will open:

Note: mcp.json is the configuration file that tells your AI client (such as Cursor) which MCP servers to load and how to connect to them. It’s the “control center” for your MCP ecosystem.

Add the command in mcp.json from https://docs.firecrawl.dev/mcp-server (for Windows):

cmd /c "set FIRECRAWL_API_KEY=your-api-key && npx -y firecrawl-mcp"

Command Reference: Official GitHub of Firecrawl: https://github.com/firecrawl/firecrawl-mcp-server

Here is the screenshot after entering the command with the API Key. We generated the API key in Step 2 from firecrawl.dev and added it here under FIRECRAWL_API_KEY:

mcp.json for MCP Server

Let us understand the command completely:

  1. mcpServers” (Root object)
    • Container for all server configurations
    • Required top-level property
  2. firecrawl” (Server identifier)
    • Unique name for this server
    • Used in logging and debugging
    • Can be anything descriptive
  3. command” (How to start the server)
    • cmd /c: Windows command processor
    • set FIRECRAWL_API_KEY=…: Set environment variable
    • &&: Run next command after first succeeds
    • npx -y firecrawl-mcp: Download and run FireCrawl MCP server

What happens when the Cursor starts:

  1. Cursor reads mcp.json
  2. Finds the firecrawl server configuration
  3. Executes the command in order:
    • cmd /c – Start Windows command processor
    • set FIRECRAWL_API_KEY=… – Set environment variable for this session
    • && – Wait for success, then continue
    • npx -y firecrawl-mcp – Download (if needed) and run FireCrawl MCP server
  4. Establishes the MCP protocol connection
  5. FireCrawl server is now available in Cursor chat!

Step 8: Cursor Chat

After the command is entered with the API key under mcp.json, let us reach the chat section of Cursor.

If you cannot find it, press the shortcut keys CTRL + L.  We are getting the titles of any 10 links from our website, Studyopedia.com:

Cursor Chat

Step 9: Installed MCP Servers

Now, under Cursor Settings -> Tools & MCP, our MCP Serverfirecrawl” is also visible:

Installed MCP Server

Step 10: Activity Log

We scraped the website more, and now our Activity Log looks like this on firecrawl.dev. On the left tab, click Activity Logs as shown below:

Activity Logs on Firecrawl

Step 11: Usage

Also, check the usage. For the free plan, 525 credits are available.

On the left tab, click Usage as shown below:

Credit Usage on Firecrawl

More on Scraping

Based on our MCP setup with FireCrawl, here are various types of questions we can ask in the Cursor CHAT tab for web scraping:

Basic Scraping Questions

  • “Scrape the main content from [website URL]”
  • “Extract all text from https://example.com”
  • “Get the latest articles from [news site URL]”
  • “Scrape product information from [e-commerce URL]”

Structured Data Extraction

  • “Extract all headings and paragraphs from [URL]”
  • “Scrape tables from [financial data URL]”
  • “Get all links from [website’s sitemap URL]”
  • “Extract metadata like title, description from [blog URL]”

Advanced Scraping Requests

  • “Scrape only the main article content, ignore navigation and ads from [news URL]”
  • “Extract specific data like prices, dates, or names from [URL]”
  • “Get all images and their alt text from [portfolio site URL]”
  • “Scrape data from multiple pages starting from [base URL]”

Technical Questions

  • “How do I handle JavaScript-rendered content with FireCrawl?”
  • “What’s the best way to scrape dynamic websites?”
  • “Can I scrape websites that require authentication?”
  • “How to handle rate limiting and respectful scraping?”

Project-Specific Questions

  • “Help me build a web scraper for [specific use case]”
  • “How to structure scraped data into JSON/CSV format?”
  • “What’s the best way to store and process scraped data?”
  • “How to schedule regular scraping tasks?”

Troubleshooting

  • “Why is my scraping returning empty results?”
  • “How to handle websites with anti-bot protection?”
  • “What to do when I get blocked by a website?”
  • “How to improve scraping accuracy for complex sites?”

Example Prompts to Start With:

  • “Scrape the latest tech news from Studyopedia.com “
  • “Extract product listings from an Amazon search results page”
  • “Get all blog post titles and summaries from a WordPress site”
  • “Scrape contact information from a company’s about page”

Remember to always:

  • Respect robots.txt files
  • Check website’s terms of service
  • Use appropriate delays between requests
  • Only scrape publicly available data

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Standard vs Custom MCP Servers
Traditional API Approach vs MCP
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment