Leafly Strain Scraper

by adi2355

1 stars
Not rated
GitHub

About

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.

Details

Author
adi2355
Repository
adi2355/MCP-Server-Collection
GitHub stars
1
License
MIT License
Categories
AI, Design, Developer Tools, Search, Infrastructure, API, Frontend, Security

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Leafly Strain Scraper
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 deepseek.py
    Environment
    • DEEPSEEK_API_KEY your_key_here

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

``bash

| Variable | Server | Required |
|:---------|:-------|:---------|
|
FIRECRAWL_API_KEY | Firecrawl Web Scraping | Yes |
|
DEEPSEEK_API_KEY` | DeepSeek R1 | Yes |

<br>

firecrawl_scrape

Scrape a single page with format selection (markdown, HTML, screenshots), custom actions, and content filtering.

firecrawl_map

Discover all URLs on a website and generate a site map.

firecrawl_crawl

Recursively crawl a website with depth and page limits.

firecrawl_batch_scrape

Scrape multiple URLs concurrently with queue-based processing.

firecrawl_check_batch_status

Poll the status of an in-progress batch scrape job.

firecrawl_check_crawl_status

Poll the status of an in-progress crawl job.

firecrawl_search

Search the web and return scraped content from results.

firecrawl_extract

LLM-powered structured data extraction using a caller-defined JSON schema.

firecrawl_deep_research

Multi-step research workflow that scrapes, synthesizes, and reports on a topic.

firecrawl_leafly_strain

Extract standardized cannabis strain data (cannabinoids, terpenes, effects, flavors, interactions).

search_function

Find function definitions across Python, JavaScript, and TypeScript files.

search_code

Full-text search across all code files in a directory tree.

get_project_structure

Generate a tree-view representation of the project directory.

analyze_dependencies

Parse and analyze project dependency manifests.

find_components

Discover React and React Native component definitions.

deepseek_r1

Generate text using the DeepSeek Reasoner model (optimized for complex reasoning).

deepseek_summarize

Condense text into a summary.

deepseek_stream

Stream text generation with chunked output.

deepseek_multi

Generate text using a caller-specified DeepSeek model variant.

deepseek_document

Process documents: summarize, extract entities, or analyze sentiment.

query

Query JSON data using JSONPath expressions with array operations.

filter

Filter JSON arrays by field conditions (equality, range, pattern matching).

save_query

Persist query results to disk for later retrieval.

compare_json

Diff two JSON datasets and report structural/value differences.

| Tool | Description |
|:-----|:------------|
| query | Query JSON data using JSONPath expressions with array operations |
| filter | Filter JSON arrays by field conditions (equality, range, pattern matching) |
| save_query | Persist query results to disk for later retrieval |
| compare_json | Diff two JSON datasets and report structural/value differences |

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "leafly strain scraper": {
            "env": {
                "DEEPSEEK_API_KEY": "your_key_here"
            },
            "args": [
                "deepseek.py"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "DEEPSEEK_API_KEY": "your_key_here"
    },
    "args": [
        "deepseek.py"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "DEEPSEEK_API_KEY": "your_key_here"
    },
    "args": [
        "deepseek.py"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "DEEPSEEK_API_KEY": "your_key_here"
    },
    "args": [
        "/c",
        "node",
        "deepseek.py"
    ],
    "command": "cmd"
}

<div align="center">
Terminal Top Panel
</div>

<br>

Overview

This repository contains a collection of purpose-built Model Context Protocol servers, each designed around a specific capability: web scraping and structured data extraction, codebase navigation and analysis, LLM-powered text generation, and JSON querying. Every server exposes its functionality as MCP tools and resources, making them composable building blocks for AI agent workflows.

The servers span two language ecosystems — TypeScript for the Firecrawl integration and DeepSeek/JSON servers, Python for the codebase analysis server — and follow the MCP SDK conventions for tool definitions, resource URIs, and transport configuration (stdio and HTTP).

<br>

Technology Stack

<table>
<tr>
<td><strong>Languages</strong></td>
<td>TypeScript Python JavaScript</td>
</tr>
<tr>
<td><strong>MCP Framework</strong></td>
<td>MCP SDK FastMCP</td>
</tr>
<tr>
<td><strong>Web Scraping</strong></td>
<td>Firecrawl LLM Extract</td>
</tr>
<tr>
<td><strong>AI Integration</strong></td>
<td>DeepSeek R1 OpenAI SDK</td>
</tr>
<tr>
<td><strong>Data & Querying</strong></td>
<td>JSONPath CSV</td>
</tr>
<tr>
<td><strong>Runtime</strong></td>
<td>Node.js Python 3.12+</td>
</tr>
<tr>
<td><strong>Tooling</strong></td>
<td>Jest ESLint Prettier Docker</td>
</tr>
</table>

<br>

Server Index

| Server | Language | Transport | Tools | Resources | Description |
|:-------|:---------|:----------|:------|:----------|:------------|
| Firecrawl Web Scraping | TypeScript | stdio | 10 | &mdash; | Web scraping, crawling, batch processing, LLM extraction, deep research, and cannabis strain data extraction |
| Codebase Analysis | Python | stdio | 6 | 4 | File system navigation, code search, project structure analysis, and real-time change monitoring |
| DeepSeek R1 | JavaScript | stdio | 5 | 5 | Text generation, summarization, streaming, multi-model support, and document processing via DeepSeek AI |
| JSON Manager | JavaScript | stdio / HTTP | 4 | 4 | JSONPath querying, advanced filtering, dataset comparison, and result caching |

<br>

---

Firecrawl Web Scraping Server

A comprehensive MCP server built on the Firecrawl platform for web scraping, content extraction, and structured data collection. Extends the base Firecrawl capabilities with a specialized cannabis strain data extraction pipeline that collects 66 standardized data points per strain from Leafly.com using dual extraction strategies: regex-based pattern matching and LLM-powered schema extraction.

Tools

| Tool | Description |
|:-----|:------------|
| firecrawl_scrape | Scrape a single page with format selection (markdown, HTML, screenshots), custom actions, and content filtering |
| firecrawl_map | Discover all URLs on a website and generate a site map |
| firecrawl_crawl | Recursively crawl a website with depth and page limits |
| firecrawl_batch_scrape | Scrape multiple URLs concurrently with queue-based processing |
| firecrawl_check_batch_status | Poll the status of an in-progress batch scrape job |
| firecrawl_check_crawl_status | Poll the status of an in-progress crawl job |
| firecrawl_search | Search the web and return scraped content from results |
| firecrawl_extract | LLM-powered structured data extraction using a caller-defined JSON schema |
| firecrawl_deep_research | Multi-step research workflow that scrapes, synthesizes, and reports on a topic |
| firecrawl_leafly_strain | Extract standardized cannabis strain data (cannabinoids, terpenes, effects, flavors, interactions) |

Strain Data Extraction Pipeline

The Leafly strain extractor is the most specialized component in this collection. It implements two complementary extraction strategies against the same data source:

Regex-based extraction parses raw HTML/markdown content with pattern-matching rules for cannabinoid percentages, terpene profiles, effect ratings, and flavor descriptors. This approach is deterministic and fast, but brittle against layout changes.

LLM-powered extraction uses Firecrawl's extract endpoint to send page content to an LLM with a structured JSON schema. This approach handles unstructured text, formatting variations, and missing data more gracefully, at the cost of API latency and token usage.

Both strategies normalize output to a consistent schema covering:

| Category | Fields |
|:---------|:-------|
| Cannabinoids | THC, CBD, CBG, CBN |
| Terpenes | Myrcene, Pinene, Caryophyllene, Limonene, Linalool, Terpinolene, Ocimene, Humulene |
| Medical Effects | Stress, Anxiety, Depression, Pain, Insomnia, Lack of Appetite, Nausea |
| User Effects | Happy, Euphoric, Creative, Relaxed, Uplifted, Energetic, Focused, Sleepy, Hungry, Talkative, Tingly, Giggly |
| Adverse Effects | Dry Mouth, Dry Eyes, Dizzy, Paranoid, Anxious |
| Flavors | Berry, Sweet, Earthy, Pungent, Pine, Vanilla, Minty, Skunky, Citrus, Spicy, Herbal, Diesel, Tropical, Fruity, Grape |
| Pharmacokinetics | Onset (minutes), Duration (hours) |
| Drug Interactions | Sedatives, Benzodiazepines, SSRIs, Opioid Analgesics, Anticonvulsants, Anticoagulants |

Normalization methodology: lab-tested data is prioritized. When exact values are unavailable, standardized normalization is applied (dominant terpene = 0.008, second = 0.005, third = 0.003). Effects and flavors are normalized to a 0.0&ndash;1.0 scale.

Quick Start

cd firecrawl-mcp-server
npm install
cp .env.example .env          # Add your FIRECRAWL_API_KEY
npm run build
npm start                     # Start the MCP server (stdio transport)
# CLI: extract strain data directly
npm run scrape-leafly -- output.csv "Blue Dream,OG Kush,Sour Diesel"

<br>

---

Codebase Analysis Server

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.