Skip to main content
Glama
MWIE MCP Server

MWIE MCP Server

by tmolavi

Molavi Web Intelligence Engine (MWIE)

One Engine. Complete Web Intelligence.

License Python Tests FastAPI MCP Author

English | فارسی | Türkçe | Azərbaycan | العربية

🚀 Live Interactive Web Analyzer (100% Free & Model-Independent):
Test the engine live in your browser across all 5 supported languages:
🇮🇷 فارسی (Persian) • 🇬🇧 English • 🇹🇷 Türkçe • 🇦🇿 Azərbaycanca • 🇸🇦 العربية

Molavi Web Intelligence Explainer Video

Visual Architecture & Video Walkthrough — Watch High-Res Video or browse docs/assets/mwie-explainer.mp4


1. Project Introduction

Molavi Web Intelligence Engine (MWIE) is an open-source, self-hosted web intelligence platform designed for Technical SEO, Generative Engine Optimization (GEO), AI Search Indexing, and Autonomous AI Agents.

Modern search has fundamentally transitioned from simple keyword matching to generative AI engines (Perplexity, ChatGPT Search, Google Gemini Grounding). Existing web scrapers focus either only on raw HTML extraction or simple Markdown conversion without understanding semantic entity graphs, citations, or technical SEO health.

MWIE unifies high-throughput HTTP crawling, headless JavaScript rendering, resilient DOM parsing, technical SEO scorecards, and AI-readiness analysis into a modular engine accessible via REST API and native Model Context Protocol (MCP).


Related MCP server: google-seo-mcp

2. Core Features

  • Unified Multi-Adapter Extraction:

    • Native Async HTTP Adapter: Ultra-fast (sub-20ms) scraping with zero browser overhead.

    • Playwright Headless Browser Adapter: Renders client-side dynamic JavaScript single-page apps (SPAs).

    • Firecrawl Clean-Room Adapter: Decoupled REST adapter for self-hosted or cloud Firecrawl clusters.

  • Intelligent Evidence-Based Routing:

    • Automatically selects the optimal extraction backend based on page type, JavaScript requirements, and real-time performance telemetry.

    • Seamless automatic fallbacks to alternative adapters upon network or rendering anomalies.

  • Resilient Content & Markdown Generation:

    • Heuristic boilerplate noise removal (headers, footers, navigation, cookie banners).

    • Produces hierarchical, clean Markdown optimized for LLM prompts and RAG chunking.

  • Native Model Context Protocol (MCP) Server:

    • Exposes 12 native tools directly to AI agent platforms (Hermes, Hamzad, Claude Desktop, Cursor).

  • Cost & Resource Efficiency:

    • 100% self-hosted and open-source. Requires zero paid APIs to operate.


3. SEO-Native Intelligence Capabilities

Technical SEO is a first-class citizen inside MWIE:

  • Indexability & Crawl Control: Meta robots (noindex, nofollow), X-Robots-Tag, HTTP status code validation.

  • Metadata Auditing: Meta title and description length evaluation against search snippet thresholds.

  • Canonical Consistency: Rel canonical extraction and cross-check against target request URLs.

  • Heading Hierarchy: Deep analysis of H1-H6 tags, single H1 compliance, and semantic nesting.

  • Image Accessibility: Total image audit, alt text detection, and missing alt reporting.

  • Link Graph Intelligence: Separation and counting of internal vs external URLs.

  • Structured Data: Full Schema.org JSON-LD extraction, microdata detection, and schema type mapping.

  • Social Tags: Open Graph (og:*) and Twitter Cards (twitter:*) completeness analysis.

  • Internationalization: Hreflang tag parsing and target language validation.

  • Content-to-HTML Ratio: Diagnostic ratio calculation highlighting text density vs boilerplate code.

  • Weighted SEO Scorecard: Generates an objective 0–100 score accompanied by actionable diagnostic recommendations.


4. GEO-Native Intelligence Capabilities

Generative Engine Optimization (GEO) prepares content for generative discovery:

  • Brand & Entity Recognition: Extracts Brand, Organization, Person, and Product entities from JSON-LD and content text.

  • Citation Intelligence: Maps external references, source links, blockquote citations, and author attribution.

  • Answer-Oriented Q&A Extraction: Automatically discovers FAQPage structures and interrogative heading/answer pairs.

  • Semantic Content Chunking: Splits body copy into clean, token-estimated chunks tailored for vector embeddings and RAG pipelines.

  • AI-Readiness Scorecard: 0–100 score quantifying entity density, citation grounding, Q&A clarity, and chunkability for generative search engines.


5. Citation Evidence, Quote Density & Offer Transparency Probe

The Citation Evidence & Offer Transparency Probe (mwie.citations.citation_evidence_probe) audits whether a web page contains authoritative grounding for Generative AI engines and transparent commercial offerings:

  • Attributed Expert Quotations: Parses <blockquote>, <q>, and natural-language quotation patterns to count expert quotes and author/source attributions.

  • Verifiable Statistical Claims & Empirical Grounding: Detects precise percentages (84.5%), year-stamped figures/benchmarks (in 2024, by 2026), and outbound citations to primary research domains (.edu, .org, arxiv.org, doi.org, nih.gov, nature.com, ieee.org).

  • Commercial Offer Transparency: For commercial and service pages, detects explicit pricing tables, currency disclosures ($, €, ₺, تومان, USD, EUR, TRY), structured deliverables (checkmarked features, scope definitions), and SLA commitments.

  • Citability Scorecard & Remediation: Produces an objective evidence_citability_score (0–100) and up to 3 prioritized remediation tips.

Sample JSON Output (evidence_citability)

{
  "evidence_citability": {
    "evidence_citability_score": 88,
    "expert_quotes_count": 2,
    "expert_quotes": [
      {
        "quote": "Generative Search Optimization requires verifiable citation density and grounded empirical evidence.",
        "author": "Dr. Alex Smith",
        "source": "https://arxiv.org/abs/2301.00000",
        "element_type": "blockquote"
      }
    ],
    "statistical_claims_count": 3,
    "statistical_claims": [
      {
        "claim_text": "organic AI citation traffic increased by 84.5% across global brands",
        "claim_type": "percentage",
        "source_url": null
      },
      {
        "claim_text": "Primary research/authority citation (stanford.edu): Stanford AI Lab",
        "claim_type": "research_citation",
        "source_url": "https://stanford.edu/research/ai-search"
      }
    ],
    "research_links_count": 2,
    "research_domains": ["stanford.edu", "arxiv.org"],
    "offer_transparency": {
      "is_commercial_url": true,
      "has_pricing_table": true,
      "has_structured_deliverables": true,
      "detected_currencies": ["$", "USD"],
      "deliverables_count": 3,
      "transparency_score": 100
    },
    "remediation_tips": [
      "Embed attributed expert quotes (`<blockquote>`, `<q>`, or author citations) to elevate domain authority.",
      "Incorporate verifiable statistical claims, date-stamped figures, and primary research links (.edu, .org, arXiv, DOI)."
    ]
  }
}

🌐 Interactive Production Tool & Consulting Ecosystem:


6. Multi-Engine Shortlist & Branded-Query Defense Probe

The Multi-Engine Shortlist & Branded-Query Defense Probe (mwie.engines.multi_engine_probe) analyzes content against empirical findings across the three major AI engines:

  • ChatGPT (GPT-5.6) Readiness (0–100):

    • Entity Graph Stability: Validates Schema.org @graph networks (Organization, Person, Brand, Product, Service).

    • sameAs Disambiguation: Checks presence of verified profile links across Wikidata, Wikipedia, LinkedIn, GitHub, and Crunchbase.

    • Structured Brand/Product Facts: Evaluates key product attributes, <dl> definition lists, structured pricing tables, and schema offers.

  • Google AI Mode Readiness (0–100):

    • Conversational 3x-Long Query Coverage: Audits H2/H3 question headings and FAQPage schemas against conversational search queries in 5 languages (en, fa, ar, tr, az).

    • Top-30% Answer Clarity: Detects concise, self-contained definitional answer blocks in the opening 30% of content.

    • Branded Entity Defense: Checks canonical domain alignment, brand anchor in title & H1, preventing AI Overviews from prioritizing scrapers or competitor aggregators for branded searches.

  • Perplexity Readiness (0–100):

    • Statistical & Numeric Density: Audits high-density verifiable claims (percentages, year-stamped milestones, comparative metrics).

    • Outbound Primary Citations: Verifies references to academic papers, open standards, and primary research (.edu, .gov, arxiv.org, doi.org, w3.org).

    • Quote Extractability: Detects attributed <blockquote>, <q>, and self-contained 134–167 word semantic blocks.

  • Branded Defense Status: Determines whether the brand's entity narrative is securely controlled (defended, adequate, vulnerable).

Sample JSON Output (engine_matrix)

{
  "engine_matrix": {
    "chatgpt_score": 92,
    "google_ai_mode_score": 88,
    "perplexity_score": 95,
    "branded_defense_status": "defended",
    "chatgpt_breakdown": {
      "has_brand_schema": true,
      "has_graph_network": true,
      "same_as_count": 3,
      "disambiguation_profiles": [
        "https://www.wikidata.org/wiki/Q123456",
        "https://www.linkedin.com/in/taghimolavi",
        "https://github.com/tmolavi"
      ],
      "structured_facts_detected": 8,
      "brand_in_title": true,
      "brand_in_h1": true
    },
    "google_breakdown": {
      "conversational_questions_count": 4,
      "sample_question_headings": [
        "How does Google AI Mode evaluate conversational queries?",
        "What are the primary citation benchmarks in 2026?"
      ],
      "has_faq_schema": true,
      "has_direct_definition_top30": true,
      "has_concise_snippet_opening": true,
      "branded_defense_anchor": true
    },
    "perplexity_breakdown": {
      "statistical_claims_count": 6,
      "outbound_primary_citations_count": 3,
      "sample_primary_citations": [
        "https://arxiv.org/abs/2601.00000",
        "https://stanford.edu/research"
      ],
      "quote_blocks_count": 2,
      "optimal_length_passages_count": 3
    },
    "remediation_tips": [
      "Incorporate conversational question-based H2 headings and direct answer definitions in the top 30% of content to capture Google AI Mode queries."
    ]
  }
}

7. Architecture Overview

┌────────────────────────────────────────────────────────────────────────┐
│                        AI Agents & Client Apps                         │
│           (Hermes, Hamzad, Claude Desktop, Cursor, REST Clients)       │
└──────────────────┬─────────────────────────────────┬───────────────────┘
                   │ MCP (Stdio/SSE)                 │ REST API (HTTP)
┌──────────────────▼─────────────────────────────────▼───────────────────┐
│               Molavi Web Intelligence Engine (MWIE) Core               │
├────────────────────────────────────────────────────────────────────────┤
│ ┌──────────────────────────┐    ┌────────────────────────────────────┐ │
│ │  Intelligent Router      │    │  Request Queue & Robots Manager    │ │
│ └────────────┬─────────────┘    └────────────────────────────────────┘ │
│              │                                                         │
│ ┌────────────▼───────────────────────────────────────────────────────┐ │
│ │                   Unified Extraction Adapters                      │ │
│ │  • Native HTTP Adapter    • Playwright Adapter   • Firecrawl API   │ │
│ └────────────┬───────────────────────────────────────────────────────┘ │
│              │ Raw HTML                                                │
│ ┌────────────▼───────────────────────────────────────────────────────┐ │
│ │              Parsing & Content Cleaning Pipeline                   │ │
│ │  • Noise Stripper    • HTML Parser   • Markdown Generator          │ │
│ └────────────┬───────────────────────────────────────────────────────┘ │
│              │ Clean DOM & Text                                        │
│ ┌────────────▼────────────────────────┬──────────────────────────────┐ │
│ │    Technical SEO Analyzer           │     GEO & Entity Analyzer    │ │
│ │  • Canonical & Metadata             │  • Brand Entity Extraction   │ │
│ │  • Headings & Image Alts            │  • Citations & Author Map    │ │
│ │  • JSON-LD Structured Data          │  • Q&A Knowledge Blocks      │ │
│ │  • 0-100 Weighted Scorecard         │  • AI-Readiness Scorecard    │ │
│ └─────────────────────────────────────┴──────────────────────────────┘ │
│                                                                        │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │   Memory / Redis TTL Cache   •   SSRF Security & Allowlist Gates   │ │
│ └────────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘

6. Installation & Quick Start

Prerequisites

  • Python 3.10+

  • Linux, macOS, or Windows

Installation

git clone https://github.com/tmolavi/molavi-web-intelligence.git
cd molavi-web-intelligence
python3 -m pip install -e .

For development (including testing tools):

python3 -m pip install -e ".[dev]"

Quick Start via Python SDK

import asyncio
from mwie.crawler.engine import crawl_engine
from mwie.core.models import ExtractionOptions


async def main():
    options = ExtractionOptions(render_js=False, extract_seo=True, extract_geo=True)
    result = await crawl_engine.extract_single("https://molavi.pro", options)

    print(f"Title: {result.seo.meta_title}")
    print(f"SEO Score: {result.seo.seo_score}/100")
    print(f"AI Readiness: {result.geo.ai_readiness_score}/100")
    print(f"Entities: {[e.name for e in result.geo.entities]}")


asyncio.run(main())

7. REST API Usage

Start the REST API server:

uvicorn mwie.api.app:app --host 0.0.0.0 --port 8000

Visit interactive API documentation at: http://localhost:8000/docs

Example: Extract & Analyze URL

curl -X POST http://localhost:8000/api/v1/extract \
  -H "Content-Type: application/json" \
  -d '{"url": "https://molavi.pro"}'

Example: Technical SEO Audit

curl -X POST http://localhost:8000/api/v1/seo \
  -H "Content-Type: application/json" \
  -d '{"url": "https://molavi.pro"}'

Example: Compare Competitor Pages

curl -X POST http://localhost:8000/api/v1/compare \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://molavi.pro", "https://example.com"]}'

8. Composio OAuth & PostgreSQL Telemetry Enrichment

MWIE supports live search and traffic telemetry enrichment via Composio OAuth and PostgreSQL persistence with strict data privacy isolation.

Supported OAuth Integrations

  • Gmail: Verified lead owner identity and automated audit report delivery.

  • Google Search Console (GSC): Verified domain properties, top search queries, clicks, impressions, and CTR.

  • Google Analytics 4 (GA4): AI referral traffic telemetry (ChatGPT, Perplexity, Claude, Gemini sessions, AI referral ratio, dark attribution lift).

Endpoints

  • POST /api/auth/composio/connect: Initiates OAuth handshake via Composio for a client email and returns connection_url.

  • GET /api/auth/composio/callback: Validates connection and extracts verified Gmail profile, GSC analytics, and GA4 telemetry.

  • POST /api/audit/enriched: Merges DOM/Schema/MAVI score with live GSC/GA4 deltas and calculates longitudinal drift against previous PostgreSQL records.

PostgreSQL Privacy Architecture

Persistence is split across two strictly partitioned tables:

  • private_client_audits (Strictly Private CRM / Longitudinal Store):

    • Columns: id, lead_email, lead_name, composio_entity_id, domain, gsc_snapshot_json, ga4_snapshot_json, mavi_score, evidence_score, created_at.

    • Accessible only to authorized backend processes; never exposed to public endpoints.

  • anonymized_industry_benchmarks (Public Benchmark Pool - Zero PII):

    • Columns: id, industry_tag, mavi_score, rp_score, cs_score, es_score, evidence_score, ai_referral_ratio, bucket_month, created_at.

    • All emails, client names, domains, URLs, search query terms, and raw traffic volumes are strictly scrubbed before insertion.

Required Environment Variables

Set the following environment variables (never commit credentials to source control):

# PostgreSQL Database Connection URL
export DATABASE_URL="postgresql://user:password@localhost:5432/mwie_db"

# Composio API Key (Discoverable from Composio Dashboard or mcp_config.json)
export COMPOSIO_API_KEY="ck_live_..."

# Optional: Default redirect URL for Composio OAuth callback
export COMPOSIO_REDIRECT_URL="https://molavi.pro/tools/web-intelligence"

9. Model Context Protocol (MCP) Integration

MWIE provides a native Python MCP server exposing 12 tools for autonomous agents:

Tool Name

Description

crawl_url

Full extraction, SEO, and GEO audit on a single URL

crawl_domain

Multi-page recursive domain crawl

extract_page_content

Fast extraction of noise-free text and Markdown

analyze_seo

Technical SEO scorecard and recommendations

analyze_geo

Generative Engine Optimization audit and AI readiness

extract_entities

Extract brand, person, organization, and product entities

extract_structured_data

Extract Schema.org JSON-LD schemas

analyze_sitemap

Parse and discover URLs from sitemap.xml

compare_pages

Side-by-side competitor SEO and GEO comparison

batch_process_urls

Batch concurrent processing of URL lists

get_job_status

Engine health, cache state, and registered adapters

get_extraction_metadata

Real-time adapter latency and success metrics

Adding MWIE to Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "molavi-web-intelligence": {
      "command": "python3",
      "args": ["-m", "mwie.mcp.server"]
    }
  }
}

10. Docker Deployment

Deploy with Docker:

docker build -t molavi-web-intelligence .
docker run -p 8000:8000 molavi-web-intelligence

Or using Docker Compose:

docker compose up -d

11. Security & Responsible Crawling

MWIE includes strict built-in security features:

  • SSRF Protection: By default, RFC 1918 private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), localhost (127.0.0.1), and loopback addresses are strictly blocked.

  • Robots.txt Adherence: Automatically respects robots.txt disallow rules.

  • Domain Allowlists/Blocklists: Configurable in settings or via environment variables.


12. Empirical Benchmarks & PostgreSQL Telemetry

Empirical measurements on Linux ARM64 (100 iterations per component):

  • HTML Parsing & Noise Cleaning: 13.10 ms avg latency (76.4 ops/sec, ~4.7 MB peak RAM)

  • Markdown Generator: 2.56 ms avg latency (390.7 ops/sec, ~2.6 MB peak RAM)

  • Technical SEO Analyzer: 11.25 ms avg latency (88.9 ops/sec, ~2.4 MB peak RAM)

  • GEO & Entity Graph Engine: 8.56 ms avg latency (116.8 ops/sec, ~6.4 MB peak RAM)

Privacy-Preserving Industry Benchmark Pool

The web tool on molavi.pro provides an opt-in benchmark contribution mechanism where audit scores are recorded to the PostgreSQL anonymized_industry_benchmarks table with zero PII:

  • Stripped of emails, names, URLs, exact queries, and raw traffic counts.

  • Stores exclusively normalized dimensional scores (mavi_score, rp_score, cs_score, es_score, evidence_score, ai_referral_ratio) tagged by industry_tag and bucket_month.

  • Allows calculating live percentile distributions and longitudinal drift while maintaining strict privacy boundaries.


13. License & Attribution

  • Released under the Apache License 2.0. See LICENSE for terms.

  • Independent clean-room architecture developed by Taqi Molavi.

  • Third-party research references and licenses are documented in CREDITS.md and THIRD_PARTY_LICENSES.md.


14. Author & Ecosystem

Author: Taqi Molavi
Website: https://molavi.pro
Ecosystem Integrations: TM Molavi Agentic OS | TM Second Brain | Hermes Agent | Hamzad Digital Twins

Available Tools

12 tools
analyze_geoC

Run Generative Engine Optimization (GEO) audit: brand entities, citations, Q&A blocks, AI-readiness.

Inputs: url (required), render_js. Returns: result

analyze_seoC

Run a technical SEO audit: title, description, headings, images, canonical, schemas, and score.

Inputs: url (required), render_js. Returns: result

analyze_sitemapC

Discover and parse URLs from an XML sitemap or sitemap index.

Inputs: sitemap_url (required), max_urls. Returns: result

batch_process_urlsC

Process a batch of URLs concurrently and return summarized SEO/GEO metrics.

Inputs: urls (required), render_js. Returns: result

compare_pagesB

Compare multiple competitor pages side-by-side on SEO and GEO readiness.

Inputs: urls (required). Returns: result

crawl_domainC

Perform a recursive crawl of a domain up to max_pages and max_depth.

Inputs: url (required), max_depth, max_pages, render_js. Returns: result

crawl_urlC

Extract content, technical SEO, and GEO intelligence from a single URL.

Inputs: url (required), render_js. Returns: result

extract_entitiesC

Extract brand, organization, person, and product entities from a webpage.

Inputs: url (required). Returns: result

extract_page_contentB

Extract clean text and structured Markdown from a webpage, discarding web noise.

Inputs: url (required), render_js, generate_markdown. Returns: result

extract_structured_dataC

Extract all Schema.org JSON-LD structured data and detected schemas from a webpage.

Inputs: url (required). Returns: result

get_extraction_metadataB

Retrieve runtime performance telemetry and success metrics for all extraction adapters.

Inputs: no named parameters. Returns: result

get_job_statusC

Report engine status, version, memory cache entries, and health.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 12 tools

    Disambiguation3/5

    The core crawl/extract/analyze split is mostly clear, but crawl_url is described as extracting content plus SEO plus GEO, which directly overlaps extract_page_content, analyze_seo, and analyze_geo. An agent must guess whether to call the combined crawler or the single-purpose analyzers, and get_job_status vs get_extraction_metadata both look like status/telemetry calls with fuzzy boundaries.

    Naming Consistency4/5

    Nearly all tools follow a snake_case verb_noun pattern (crawl_url, extract_entities, analyze_seo, get_job_status). Minor deviations exist: analyze_sitemap actually discovers/parses rather than analyzes, and batch_process_urls uses a compound verb, but the set reads predictably.

    Tool Count5/5

    Twelve tools is well within a healthy range for a crawl + SEO/GEO auditing server. Each tool maps to a distinguishable capability (single crawl, recursive crawl, content extraction, SEO, GEO, entities, schema, sitemap, comparison, batch, two status tools) with no obvious filler.

    Completeness4/5

    Coverage is strong for discovery, extraction, and analysis, including batch and competitor comparison. Minor gaps: no report/export tool to persist audit results, and get_job_status implies long-running work but there is no job submission/result retrieval or cancellation counterpart.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to diagnose and fix technical SEO, content, and generative engine optimization issues by providing 72 tools that integrate Google Search Console, Google Analytics 4, PageSpeed Insights, structured data, llms.txt, WordPress, and GitHub.
      72
      32
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to crawl live websites, audit AEO readiness, generate Schema.org @graph JSON-LD, llms.txt, ai.txt, and robots.txt, inject structured data into HTML, validate optimizations, and retrieve framework-specific code snippets.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to run SEO audits and reporting over a user's own Search Console, Google Analytics, Bing, and keyword/competitor provider data, including page/index status, traffic comparisons, backlinks, and local crawl/internal-link analysis.
      3,493 npm
      648
      Apache 2.0