ecommerce-insight-mcp

ecommerce-insight-mcp

An MCP server that scrapes e-commerce product and category pages into structured JSON, enabling Claude to build presentations, market analyses, and competitive product comparisons. Currently optimized for Trendyol.

Category
Visit Server

README

E-Commerce Presentation & Insights MCP Server

English | Türkçe

An MCP server for Claude Desktop that scrapes e-commerce product pages and category links to generate structured presentation payloads, product comparisons, and market insights.


English

A Model Context Protocol (MCP) server built with Python (FastMCP) that lets Claude Desktop scrape and clean e-commerce product and category pages into structured JSON, enabling Claude to build presentation slides, market analysis reports, and competitive product comparisons.

Features

1. extract_product_presentation_data(url: str) Fetches a single product page and returns:

  • Page title (<title>)
  • Product images — up to 6 <img> tags whose src contains cdn.dsmcdn.com, product, images, or mnresize; protocol-relative URLs (//...) are normalized to https:
  • Clean text with script, style, header, footer, nav, noscript tags stripped, lines shorter than 3 characters removed, capped at the first 150 lines

2. get_category_presentation_data(url: str) Fetches a category/listing page and returns:

  • Page title
  • Up to 8 unique products from links whose href contains -p- or /product/, with link text longer than 10 characters (name + full URL)

Both tools return {"error": "Hata oluştu: ..."} on failure instead of raising an exception.

Known Limitations

This version is optimized for Trendyol, not a generic e-commerce scraper:

  • The image filter relies on cdn.dsmcdn.com (Trendyol's CDN) — it may not find product images on other sites.
  • Relative (/-prefixed) links in get_category_presentation_data are hardcoded to resolve against https://www.trendyol.com{href} — this will produce incorrect URLs on other sites.
  • Uses a single fixed User-Agent; sites with bot protection may reject requests.
  • No robots.txt check or rate limiting between requests.

Adapt these parts before using it on Hepsiburada or other platforms.

Requirements

Dependencies (requirements.txt):

fastmcp
httpx
beautifulsoup4

Installation

git clone https://github.com/odrdgi-create/ecommerce-insight-mcp.git
cd ecommerce-insight-mcp
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

Claude Desktop Setup

Add the following block to your Claude Desktop config file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "ecommerce-insight": {
      "command": "python",
      "args": ["/full/path/to/ecommerce-insight-mcp/ecommerce_mcp.py"]
    }
  }
}

If using a venv, point "command" to the venv's Python binary (e.g. /full/path/to/ecommerce-insight-mcp/venv/bin/python).

Save the file and restart Claude Desktop. The "E-Commerce HTML Summarizer" server should appear in the tools list.

Usage Example

Ask Claude something like:

"Analyze this product page for a presentation: https://www.trendyol.com/..."

Claude calls extract_product_presentation_data and receives:

{
  "type": "single_product_presentation",
  "url": "https://www.trendyol.com/...",
  "title": "Product Name",
  "product_images": ["https://cdn.dsmcdn.com/..."],
  "extracted_content": "Clean product description, specs, etc..."
}

For a category page:

"Compare the featured products in this category: https://www.trendyol.com/..."

{
  "type": "category_showcase_presentation",
  "category_title": "Category Name",
  "category_url": "https://www.trendyol.com/...",
  "top_products": [
    {"name": "Product 1", "url": "https://www.trendyol.com/..."}
  ]
}

Project Structure

ecommerce-insight-mcp/
├── ecommerce_mcp.py     # MCP server and tool definitions
├── requirements.txt     # Python dependencies
├── .gitignore
└── README.md

Roadmap (suggested)

  • [ ] Platform-agnostic scraping (separate parsers for Hepsiburada, N11, etc.)
  • [ ] Dynamic relative-URL resolution based on target domain
  • [ ] robots.txt compliance and request throttling
  • [ ] Unit tests
  • [ ] Pin dependency versions in requirements.txt

License

Not specified — consider adding an open-source license (e.g. MIT).


Türkçe

Python (FastMCP) ile yazılmış bir Model Context Protocol (MCP) sunucusu. Claude Desktop'ın e-ticaret ürün ve kategori sayfalarındaki ham HTML'i temizleyip yapılandırılmış JSON verisine dönüştürmesini sağlar; bu sayede Claude sunum slaytları, pazar analizi raporları ve rakip ürün karşılaştırmaları üretebilir.

Özellikler

1. extract_product_presentation_data(url: str) Tek bir ürün sayfasını çeker ve şunları döndürür:

  • Sayfa başlığı (<title>)
  • Ürün görselleri — cdn.dsmcdn.com, product, images, mnresize gibi anahtar kelimeleri içeren <img> etiketlerinden en fazla 6 tanesi, protokolsüz (//...) linkler otomatik https: ile tamamlanır
  • script, style, header, footer, nav, noscript etiketleri ayıklanmış, 3 karakterden uzun satırlarla sınırlı, ilk 150 satıra kırpılmış temiz metin

2. get_category_presentation_data(url: str) Bir kategori/liste sayfasını çeker ve şunları döndürür:

  • Sayfa başlığı
  • href içinde -p- veya /product/ geçen linklerden, metni 10 karakterden uzun olan ve tekrar etmeyen ilk 8 ürün (isim + tam URL)

Her iki tool da hata durumunda {"error": "Hata oluştu: ..."} formatında JSON döndürür, exception fırlatmaz.

Bilinen Sınırlamalar

Bu sürüm Trendyol'a göre optimize edilmiştir, genel bir e-ticaret scraper'ı değildir:

  • Görsel filtresi cdn.dsmcdn.com (Trendyol CDN'i) anahtar kelimesine dayanır — başka sitelerde ürün görseli bulamayabilir.
  • get_category_presentation_data içinde relative (/ ile başlayan) linkler otomatik olarak https://www.trendyol.com{href} ile tamamlanır — başka bir sitede relative link gelirse hatalı URL üretir.
  • Tek bir sabit User-Agent kullanılır; bot koruması olan sitelerde istek reddedilebilir.
  • robots.txt kontrolü veya istekler arası gecikme (rate limiting) yoktur.

Hepsiburada veya diğer platformlarda kullanmadan önce bu kısımları platforma göre uyarlamanız gerekir.

Gereksinimler

Bağımlılıklar (requirements.txt):

fastmcp
httpx
beautifulsoup4

Kurulum

git clone https://github.com/odrdgi-create/ecommerce-insight-mcp.git
cd ecommerce-insight-mcp
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

Claude Desktop Entegrasyonu

Claude Desktop'ın konfigürasyon dosyasına (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json) aşağıdaki bloğu ekleyin:

{
  "mcpServers": {
    "ecommerce-insight": {
      "command": "python",
      "args": ["/tam/yol/ecommerce-insight-mcp/ecommerce_mcp.py"]
    }
  }
}

venv kullanıyorsanız "command" alanına venv içindeki Python'un tam yolunu (örn. /tam/yol/ecommerce-insight-mcp/venv/bin/python) yazın.

Dosyayı kaydedip Claude Desktop'ı yeniden başlatın. Araç çubuğunda "E-Commerce HTML Summarizer" sunucusunu görmelisiniz.

Kullanım Örneği

Claude'a şu şekilde bir istekte bulunabilirsiniz:

"Şu ürün sayfasını analiz edip sunum için özetler misin: https://www.trendyol.com/..."

Claude, extract_product_presentation_data tool'unu çağırır ve şuna benzer bir payload alır:

{
  "type": "single_product_presentation",
  "url": "https://www.trendyol.com/...",
  "title": "Ürün Adı",
  "product_images": ["https://cdn.dsmcdn.com/..."],
  "extracted_content": "Ürün özellikleri, açıklama vb. temiz metin..."
}

Kategori sayfası için:

"Bu kategorideki öne çıkan ürünleri karşılaştır: https://www.trendyol.com/..."

{
  "type": "category_showcase_presentation",
  "category_title": "Kategori Adı",
  "category_url": "https://www.trendyol.com/...",
  "top_products": [
    {"name": "Ürün 1", "url": "https://www.trendyol.com/..."}
  ]
}

Proje Yapısı

ecommerce-insight-mcp/
├── ecommerce_mcp.py     # MCP sunucu ve iki tool tanımı
├── requirements.txt     # Python bağımlılıkları
├── .gitignore
└── README.md

Yol Haritası (öneri)

  • [ ] Platform-agnostik hale getirme (Hepsiburada, N11 vb. için ayrı parser'lar)
  • [ ] Relative URL tamamlamayı hedef domain'e göre dinamikleştirme
  • [ ] robots.txt kontrolü ve istekler arası gecikme
  • [ ] Birim testleri
  • [ ] requirements.txt içinde sürüm pinleme

Lisans

Belirtilmemiş — bir açık kaynak lisansı (örn. MIT) eklemeniz önerilir.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured