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.
README
E-Commerce Presentation & Insights MCP Server
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 whosesrccontainscdn.dsmcdn.com,product,images, ormnresize; protocol-relative URLs (//...) are normalized tohttps: - Clean text with
script,style,header,footer,nav,noscripttags 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
hrefcontains-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 inget_category_presentation_dataare hardcoded to resolve againsthttps://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.txtcheck or rate limiting between requests.
Adapt these parts before using it on Hepsiburada or other platforms.
Requirements
- Python 3.10+
- Claude Desktop
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.txtcompliance 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,mnresizegibi anahtar kelimeleri içeren<img>etiketlerinden en fazla 6 tanesi, protokolsüz (//...) linkler otomatikhttps:ile tamamlanır script,style,header,footer,nav,noscriptetiketleri 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ığı
hrefiç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_dataiçinde relative (/ile başlayan) linkler otomatik olarakhttps://www.trendyol.com{href}ile tamamlanır — başka bir sitede relative link gelirse hatalı URL üretir.- Tek bir sabit
User-Agentkullanılır; bot koruması olan sitelerde istek reddedilebilir. robots.txtkontrolü 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
- Python 3.10+
- Claude Desktop
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"]
}
}
}
venvkullanı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.txtkontrolü ve istekler arası gecikme - [ ] Birim testleri
- [ ]
requirements.txtiçinde sürüm pinleme
Lisans
Belirtilmemiş — bir açık kaynak lisansı (örn. MIT) eklemeniz önerilir.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。