How mabudalam/quickcrawl works
1. What this repository is
Quickcrawl is a multi-entrypoint web scraping system written primarily in Go. The core product is a scraping/crawling service that can be used through an HTTP API, a CLI, an MCP server for AI agents, and language SDKs/wrappers.
2. Core backend boundary
The main application logic lives under internal/. This is the shared engine used by all interfaces:
- internal/api for HTTP request handling
- internal/crawler for crawl and URL mapping
- internal/renderer for fetch/render decisions
- internal/extractor for content cleanup and formatting
- internal/search for DuckDuckGo search
- internal/mcp for agent-tool exposure
- internal/common, internal/config, internal/types, internal/utils for shared contracts and helpers
3. Primary request flows
All front doors eventually call the same backend pipeline:
- Client submits a scrape/crawl/map/search request
- API or MCP layer validates and normalizes it
- Renderer fetches the page content, either directly over HTTP or through a browser
- Extractor converts the fetched document into requested outputs such as markdown, HTML, plain text, links, or structured JSON
- Response is returned to the caller, or in the crawl case persisted/managed as an async job
4. Rendering architecture
The renderer is a distinct subsystem because page acquisition is not always a simple HTTP GET. The repo supports an adaptive path:
- HTTP fetch first for speed
- JavaScript rendering when needed
- Browser-backed rendering through LightPanda or Chrome DevTools Protocol over WebSocket
- Detection logic decides when a page looks like a SPA or requires browser execution
This renderer boundary is a key architectural distinction: content acquisition is decoupled from extraction.
5. Extraction pipeline
internal/extractor is responsible for turning raw fetched content into consumable formats. It includes:
- Markdown conversion
- Plain-text extraction
- HTML/raw HTML handling
- Link extraction
- PDF and plaintext support
- Chunking and filtering strategies for LLM-style structured extraction
The extraction layer also supports schema-driven JSON output, so it sits between web content and AI/structured consumers.
6. Crawler and mapper
internal/crawler implements site traversal and discovery. The repo’s crawl flow is BFS-oriented with controls for depth, page count, concurrency, and rate limiting. It also integrates:
- robots.txt handling
- sitemap parsing
- URL normalization and deduplication
- asynchronous crawl job management for start/status/cancel operations
Mapping is the lighter-weight variant that discovers URLs without full content extraction.
7. Search subsystem
internal/search/duckduckgo.go provides web search integration. In the architecture, search is not a separate product; it is another input path that can optionally trigger scraping of results. This makes it useful for agent workflows where query, discovery, and content retrieval are chained together.
8. Interfaces and entrypoints
There are multiple independent entrypoints built on the same core:
- cmd/server runs the HTTP API server
- cmd/mcp runs the MCP stdio server
- cli/ builds the standalone command-line tool with subcommands for scrape, crawl, map, and search
This separation matters for architecture diagrams: the “app” is really a shared engine exposed through different transports.
9. SDKs and external consumers
The repo also ships client-facing wrappers:
- python/ contains a Python SDK that can run locally via bundled binary or connect to a remote API
- npm/ contains a Node wrapper for MCP usage
These are integration layers, not alternative implementations. They expand distribution and usage surfaces while relying on the Go core.
10. Playground and observability UI
playground/ is a separate Next.js frontend used to exercise the backend and inspect responses. It has its own API routes for debug/flush operations and a client library for talking to the service. Architecturally, it is a consumer of the server rather than part of the backend runtime.
11. Configuration, deployment, and packaging
The system is configured through quickcrawl.toml and environment variables, with config covering server, crawler, renderer, and LLM extraction settings. Deployment artifacts include:
- infra/Dockerfile.server and infra/Dockerfile.playground
- install.sh for local installation
- goreleaser config and release scripts for binary packaging
This indicates the project is designed to ship as a single Go binary plus optional UI/container artifacts.
12. Non-production supporting systems
bench/ contains benchmark datasets and result scripts, and tests are distributed across core packages, especially renderer, crawler, and extractor. These directories are useful for validating the behavior of the acquisition/extraction pipeline but are not part of the runtime architecture.
Main entry points: api HTTP API · main.go API server · renderer Renderer · crawler Crawler
Components 16
Go core
Shared scraping engine and backend subsystems
- HTTP API · Routing, middleware, and handlers for HTTP requests
internal/api - Crawler · BFS crawl, map, robots, sitemap, and async job control
internal/crawler - Renderer · Adaptive fetch path across HTTP, browser, and detection
internal/renderer - Extractor · Converts fetched documents into markdown, text, HTML, links, or structured output
internal/extractor - Search · DuckDuckGo-backed query discovery for later scraping
internal/search/duckduckgo.go - MCP bridge · Exposes core actions as MCP tools
internal/mcp - Contracts · Common types, config, constants, errors, and utilities
internal/types
Entrypoints
Independent runtimes that expose the core
- API server · HTTP server process for the public API
cmd/server/main.go - MCP server · stdio MCP process for agent tools
cmd/mcp/main.go - CLI · Command-line interface with scrape, crawl, map, and search commands
cli/main.go
Consumers
Client libraries and UI that use the service
- Playground · Interactive frontend for debugging and inspecting responses
playground - Python SDK · Python client that can use a local binary or remote API
python/src/quickcrawl - Node wrapper · Node package for MCP usage
npm
Support
Packaging, deployment, and benchmarking
- Config · TOML and environment-based configuration for server, crawler, renderer, and extraction
quickcrawl.toml - Build & deploy · Dockerfiles, installer, and release tooling
infra - Benchmarks · Benchmark datasets, scripts, and result artifacts
bench
Connections 36
- API server → HTTP API: hosts · Runs the HTTP API layer
- API server → Renderer: uses · Delegates page acquisition to the renderer
- API server → Extractor: uses · Formats responses through the extractor
- API server → Crawler: uses · Handles crawl and map operations through the crawler
- API server → Search: uses · Supports search-driven discovery requests
- API server → Contracts: shares · Relies on shared contracts and helpers
- MCP server → MCP bridge: hosts · Runs the MCP tool server
- MCP server → Renderer: uses · Acquires content for agent tools
- MCP server → Extractor: uses · Produces tool outputs from fetched content
- MCP server → Contracts: shares · Uses shared request and response models
- CLI → Renderer: uses · Scrape command reaches the acquisition pipeline
- CLI → Extractor: uses · CLI formats content through the extractor
- CLI → Crawler: uses · Crawl and map commands use site traversal
- CLI → Search: uses · Search command invokes discovery
- HTTP API → Renderer: calls · Fetches pages through adaptive rendering
- HTTP API → Extractor: calls · Transforms content into output formats
- HTTP API → Crawler: calls · Starts and manages crawl/map jobs
- HTTP API → Search: calls · Supports search-based workflows
- HTTP API → Contracts: shares · Uses shared contracts, config, and utilities
- Crawler → Renderer: depends on · Crawl and scrape paths need page acquisition
- Crawler → Contracts: shares · Uses shared job and URL models
- Renderer → Contracts: shares · Uses shared fetch and render types
- Extractor → Contracts: shares · Uses shared extraction types and schemas
- MCP bridge → HTTP API: bridges · Tool adapter maps agent calls onto core operations
- Playground → HTTP API: consumes · Debug UI talks to the backend service
- Python SDK → API server: connects to · Can call the remote HTTP service or use a bundled binary
- Node wrapper → MCP server: wraps · Provides a Node client around MCP usage
- HTTP API → Config: reads · Loads runtime configuration
- Crawler → Config: reads · Uses crawl-specific limits and settings
- Renderer → Config: reads · Uses renderer and browser settings
- Extractor → Config: reads · Uses extraction and LLM-related settings
- Build & deploy → API server: packages · Builds server container and release artifacts
- Build & deploy → Playground: packages · Builds playground container image
- Benchmarks → Crawler: evaluates · Benchmark data measures crawl and scrape behavior
- Benchmarks → Renderer: evaluates · Benchmarks acquisition quality and speed
- Benchmarks → Extractor: evaluates · Benchmarks extraction outputs and formats