logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

web-research-agent-mcp-engine

A high-throughput Model Context Protocol (MCP) backend designed to facilitate advanced, AI-driven web data harvesting and deep informational retrieval. It specializes in structured data extraction and executing asynchronous, depth-controlled site traversal operations, fortified by secure authorization mechanisms and integrated via CloudFlare Workers.

Author

web-research-agent-mcp-engine logo

BjornMelin

No License

Quick Info

GitHub GitHub Stars 18
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

crawl4aicloudflarescrapingcrawling capabilitiesscraping crawlingcrawl4ai mcp

🚨 WARNING

MCP BACKEND IN ACTIVE DEVELOPMENT PHASE DO NOT DEPLOY IN PRODUCTION ENVIRONMENTS STATUS UPDATES PENDING COMPLETION

Crawl4AI Contextual Access Platform Server

⚡️ Ultra-efficient MCP Endpoint for Crawl4AI – Empowering digital agents to conduct comprehensive web surface exploration, page indexing, and sophisticated data gathering via the Model Context Protocol specification. Significantly outperforms existing tools like Firecrawl.

Executive Summary

This repository details the implementation of a bespoke Model Context Protocol (MCP) host service, architected to interface directly with the Crawl4AI open-source web harvesting toolkit. Deployed as a geo-distributed, remote MCP node utilizing CloudFlare Workers infrastructure, this system grants sophisticated AI entities, such as Claude, immediate access to Crawl4AI's robust data retrieval functionalities.

Technical Specifications

For exhaustive technical documentation, consult the following primary artifacts:

  • Migration Strategy - Detailed comparison and transition blueprint from Firecrawl dependencies.
  • Architectural Enhancements - Documentation on the multi-tenant design supporting diverse cloud backends.
  • Deployment Blueprint - Core technical procedures and runnable code snippets.
  • Codebase Refinement Log - Overview of optimizations and adopted coding standards.
  • Containerization Guide - Instructions for local simulation and containerized deployment.

Core Capabilities

Web Information Ingestion

  • 📄 Unilateral Page Harvest: Acquire content from specific URLs.
  • 🌐 Site Indexing: Execute recursive website traversal with configurable recursion depth and page quotas.
  • 🔗 URL Mapping: Systematically discover and map accessible URIs from a root anchor point.
  • ⏱️ Parallelized Traversal: Optimize site crawling through concurrent request handling.

Data Transformation & Querying

  • 🧠 Contextual Research: Perform broad, multi-page analytical investigations.
  • 🗃️ Schema-Driven Extraction: Isolate required data fields using CSS selectors or advanced Large Language Model (LLM) interpretation.
  • 📚 Post-Crawl Search: Enable semantic querying against already indexed material.

Interoperability & Security Foundation

  • 🔌 MCP Compliance: Full adherence to Model Context Protocol tooling interfaces (e.g., Claude Desktop).
  • 🔐 Authorization via OAuth: Robust, secure credential exchange for service access.
  • 🔑 Credential Flexibility: Support for both OAuth flows and static API Key (Bearer Token) verification.
  • 🚀 Latency Optimization: Codebase tuned for minimal response times and efficient resource utilization.

Repository Layout

plaintext crawl4ai-mcp/ ├── src/ │ ├── index.ts # Primary initialization; OAuth provider configuration │ ├── auth-handler.ts # Security credential verification module │ ├── mcp-server.ts # Core MCP server logic │ ├── crawl4ai-adapter.ts # Abstraction layer interfacing with Crawl4AI services │ ├── tool-schemas/ # Definitions for MCP tool signatures │ │ └── [...].ts # Specific tool interface files │ ├── handlers/ │ │ ├── crawl.ts # Logic for recursive web traversal │ │ ├── search.ts # Full-text indexing and querying functionality │ │ └── extract.ts # Content parsing and structured output generation │ └── utils/ # Helper functions and common libraries ├── tests/ # Automated validation scripts ├── .github/ # CI/CD workflow definitions ├── wrangler.toml # CloudFlare Worker deployment manifest ├── tsconfig.json # TypeScript compilation settings ├── package.json # Project dependencies manifest └── README.md # Project documentation landing page

Initial Setup Guide

Prerequisites

  • Node.js runtime (Version 18 or newer recommended)
  • npm package manager
  • Wrangler CLI (CloudFlare Tools)
  • Active CloudFlare Subscription/Account

Project Initialization

  1. Obtain the source code:

bash git clone https://github.com/BjornMelin/crawl4ai-mcp-server.git cd crawl4ai-mcp-server

  1. Install required NPM packages:

bash npm install

  1. Provision a CloudFlare KV storage namespace for persistent data:

bash wrangler kv:namespace create CRAWL_DATA

  1. Update the deployment manifest (wrangler.toml) with the generated ID:

toml kv_namespaces = [ { binding = "CRAWL_DATA", id = "" } ]

Development Workflows

Local Simulation Mode

Using NPM Scripts

  1. Launch the local development environment:

bash npm run dev

  1. The development instance will serve traffic at http://localhost:8787

Containerized Simulation

Leverage Docker Compose for an integrated environment including the Crawl4AI API mock and a debugging dashboard:

  1. Configure secrets/variables:

bash cp .env.example .env # Populate .env with necessary API keys

  1. Initiate the container stack:

bash docker-compose up -d

  1. Access endpoints:
  2. MCP Service Endpoint: http://localhost:8787
  3. Crawl4AI Debug Interface: http://localhost:3000

Refer to the Containerization Guide for deeper configuration notes.

Quality Assurance (Testing)

This project incorporates a comprehensive test suite managed by Jest.

bash

Execute all defined test suites

npm test

Run tests interactively with file watching

npm run test:watch

Generate test coverage reports

npm run test:coverage

Execute only unit-level validation

npm run test:unit

Execute only end-to-end integration tests

npm run test:integration

When operating within the Docker stack:

bash docker-compose exec mcp-server npm test

Production Deployment

To push the service live to the CloudFlare network:

bash npm run deploy

Upon successful execution, the publicly accessible URL for the deployed Worker will be provided.

Integration with MCP Consumers

This backend adheres strictly to the Model Context Protocol, enabling immediate tooling utilization by compliant AI agents.

Authorization Protocols

  • Integration of OAuth flow via the workers-oauth-provider utility.
  • Support for static verification using Bearer authorization headers.
  • Development of a dedicated token and session management portal.

Client Connection Procedures

  1. Utilize the assigned CloudFlare Workers domain endpoint.
  2. Configure the MCP consumer (e.g., Claude Desktop client) to register this endpoint as a valid tool source.

Exposed Service Functions

  • crawl: Initiate recursive, multi-level web site mapping.
  • getCrawl: Retrieve historical crawl results based on a unique identifier.
  • listCrawls: Query the index for prior crawl operations, optionally filtered by hostname.
  • search: Execute query operations against the internal document corpus.
  • extract: Fetch a URL and return content conforming to specified extraction criteria.

Configuration Variables

The operational parameters are managed via environment settings within wrangler.toml:

  • MAX_CRAWL_DEPTH: Sets the maximum traversal depth limit (Default: 3).
  • MAX_CRAWL_PAGES: Defines the hard limit on pages processed per session (Default: 100).
  • API_VERSION: Identifies the running API standard (Default: "v1").
  • OAUTH_CLIENT_ID: Required client identifier for OAuth handshake.
  • OAUTH_CLIENT_SECRET: Confidential secret key for OAuth authorization.

Development Trajectory (Roadmap)

Development milestones are prioritized as follows:

  1. Foundation Layer: Establishing Worker bootstrap, project structure, and TypeScript tooling.
  2. Protocol Implementation: Finalizing the MCP server core and defining robust tool signatures.
  3. Service Bridging: Full integration and abstraction layer development for Crawl4AI operations.
  4. Security Hardening: Complete and verified implementation of OAuth and token validation pathways.
  5. Performance Tuning: Focused optimization passes for speed and resource efficiency.
  6. Advanced Features: Enhancing the fidelity and flexibility of structured data retrieval methods.

Contribution Guidelines

We welcome community contributions! Please review existing open issues before initiating new feature development or bug fixes. Consult the Contributing Guidelines for detailed submission protocols.

Assistance Channels

Should you encounter functional problems or require clarification:

Citation Information

Users incorporating the Crawl4AI MCP Server in scholarly work or professional projects are requested to cite it using the following BibTeX record:

bibtex @software{crawl4ai_mcp_2025, author = {Melin, Bjorn}, title = {Crawl4AI MCP Server: High-performance Web Crawling for AI Assistants}, url = {https://github.com/BjornMelin/crawl4ai-mcp-server}, version = {1.0.0}, year = {2025}, month = {5} }

Licensing

MIT CLOUD COMPUTING: As defined by the International Organization for Standardization (ISO), cloud computing represents "a paradigm for enabling network access to a scalable and elastic pool of shareable physical or virtual resources with self-service provisioning and administration on-demand." This concept is commonly encapsulated as "the cloud."

== Defining Attributes == In 2011, the U.S. National Institute of Standards and Technology (NIST) established five core tenets for cloud architectures. These are verbatim as per the NIST definition:

On-demand self-service: Consumers possess the capability to unilaterally provision computing capacity (e.g., processing cycles, storage) as required, without necessitating human mediation from the service provider. Ubiquitous network access: Resources are accessible via standard protocols over a network, supporting diverse client platforms (mobile, desktop, tablet). Resource conglomeration: The provider aggregates computing assets to service multiple distinct users via a shared, multi-tenant topology, dynamically allocating virtual assets based on instantaneous demand. Agile scalability: Capabilities can be rapidly expanded or contracted, sometimes autonomously, to match fluctuating workload requirements. To the end-user, provisionable resources often appear infinite. Measured utility: Resource utilization is automatically quantified and governed by metering systems at an appropriate service abstraction layer. This provides transparent accounting of consumed resources (storage, bandwidth, compute time) for both provider and client. By 2023, ISO had subsequently augmented and refined this foundational set of characteristics.

== Historical Context ==

The conceptual genesis of cloud delivery models dates back to the 1960s, marked by the popularization of time-sharing mechanisms and remote job entry (RJE). The dominant operational model involved batch processing where users submitted tasks to central mainframe operators. This era focused on experimental methods to democratize access to substantial computational power through efficiency gains in infrastructure, platform management, and application deployment. The specific 'cloud' pictorial metaphor for virtualized services originated in 1994, utilized by General Magic to depict the expansive network of accessible 'locations' for their Telescript mobile agents. This visualization is generally attributed to David Hoffman, a communications specialist at General Magic, drawing from pre-existing conventions in telecommunications diagrams. The term 'cloud computing' gained broader public currency in 1996 following internal business planning documents at Compaq Computer Corporation concerning the future trajectory of computation and the Internet. The company's vision aimed at substantially increasing the reach of digital services.

See Also

`