Leafly Strain Scraper MCP server

Extracts structured cannabis strain data from Leafly.com using regex and extraction techniques to collect 66 data points including cannabinoids, terpenes, effects, and flavors for researchers and industry professionals.
Back to servers
Setup instructions
Provider
Aditya Khetarpal
Release date
Mar 08, 2025
Language
TypeScript
Stats
1 star

The Model Context Protocol (MCP) server is a specialized software that offers different implementations for various use cases, including data scraping, code analysis, AI model integration, and JSON manipulation. This tool helps integrate these functionalities into applications using a standardized protocol.

Leafly Cannabis Strain Data Scraper

This specialized MCP server collects structured cannabis strain data from Leafly.com following a standardized schema.

Installation Requirements

Installation Steps

  1. Clone the repository:

    git clone <repository-url>
    cd firecrawl-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Set up environment variables:

    # Copy the example .env file
    cp .env.example .env
    
    # Edit the .env file and add your Firecrawl API key
    nano .env
    
  4. Build the project:

    npm run build
    

Setting Up Your API Key

There are two ways to set your Firecrawl API key:

  1. Using an environment variable:

    export FIRECRAWL_API_KEY=your_api_key_here
    
  2. Using a .env file:

    FIRECRAWL_API_KEY=your_api_key_here
    

Using the Leafly Scraper

As a Firecrawl MCP Tool

Once integrated with the Firecrawl MCP server:

{
  "name": "firecrawl_leafly_strain",
  "arguments": {
    "strains": ["Blue Dream", "OG Kush", "Sour Diesel"],
    "exportFormat": "csv"
  }
}

Using the Extract Tool Directly

For LLM-powered extraction:

{
  "name": "firecrawl_extract",
  "arguments": {
    "urls": ["https://www.leafly.com/strains/blue-dream"],
    "schema": {
      "type": "object",
      "properties": {
        "strain_name": { "type": "string" },
        "thc_percentage": { "type": "number" },
        "cbd_percentage": { "type": "number" },
        "effects": { "type": "string" },
        "flavors": { "type": "string" },
        "medical": { "type": "string" },
        "terpenes": { "type": "object" }
      }
    },
    "prompt": "Extract comprehensive cannabis strain data from this Leafly page."
  }
}

Using the CLI Script

# Set the Firecrawl API key (required)
export FIRECRAWL_API_KEY=your_api_key_here

# Using npm scripts
npm run scrape-leafly -- output.csv "Blue Dream,OG Kush,Sour Diesel"

# Or running directly
node dist/leafly-scraper-cli.js output.csv "Blue Dream,OG Kush,Sour Diesel"

Troubleshooting TypeScript Errors

If you encounter TypeScript compilation errors:

  1. Ensure all dependencies are installed:

    npm install
    
  2. Install TypeScript if needed:

    npm install -g typescript
    
  3. Fix module errors by installing type definitions:

    npm install --save-dev @types/node
    

Python Codebase MCP Server

This server provides code analysis capabilities and file system access for codebase navigation.

Installation

  1. Ensure Python 3.7+ is installed
  2. Install dependencies:
    pip install mcp-python-sdk watchdog
    

Running the Server

python mcp_server.py

Available Tools

  • search_function: Find function definitions
  • search_code: Search for text across code files
  • get_project_structure: Generate project structure tree
  • analyze_dependencies: Analyze project dependencies
  • find_components: Discover React/React Native components

DeepSeek R1 Extended MCP Server

This server provides access to DeepSeek AI models for text generation and document processing.

Installation

  1. Ensure Node.js 14+ is installed

  2. Install dependencies:

    npm install @modelcontextprotocol/sdk openai dotenv
    
  3. Set up API key:

    echo "DEEPSEEK_API_KEY=your_api_key_here" > .env
    

Running the Server

node deepseek_mcp.js

Available Tools

  • deepseek_r1: Generate text using DeepSeek R1 model
  • deepseek_summarize: Summarize text
  • deepseek_stream: Stream text generation
  • deepseek_multi: Generate text using different models
  • deepseek_document: Process documents (summarize, extract entities, analyze)

JSON Manager MCP Server

This server provides advanced JSON querying and manipulation capabilities.

Installation

  1. Ensure Node.js 14+ is installed
  2. Install dependencies:
    npm install @modelcontextprotocol/sdk node-fetch jsonpath
    

Running the Server

node json_mcp.js

Available Tools

  • query: Query JSON data using JSONPath expressions
  • filter: Filter JSON data based on conditions
  • save_query: Save query results to a file
  • compare_json: Compare two JSON datasets

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "firecrawl-leafly-strain" '{"command":"npx","args":["-y","@modelcontextprotocol/cli","serve","firecrawl-mcp-server"],"env":{"FIRECRAWL_API_KEY":"${FIRECRAWL_API_KEY}"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "firecrawl-leafly-strain": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/cli",
                "serve",
                "firecrawl-mcp-server"
            ],
            "env": {
                "FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "firecrawl-leafly-strain": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/cli",
                "serve",
                "firecrawl-mcp-server"
            ],
            "env": {
                "FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later