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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选