daraz-mcp

daraz-mcp

Enables searching Daraz.pk products with smart cheapest detection and category support using documented API patterns.

Category
Visit Server

README

Daraz MCP Server - Clean & Fast

A streamlined Model Context Protocol (MCP) server for searching Daraz.pk products. Built using documented Daraz API patterns for maximum reliability and performance.

✨ Features

  • šŸŽÆ Simple & Clean: Just 2 tools instead of 6 confusing ones
  • šŸ“” Official API Patterns: Uses documented mods.listItems structure and ajax=true endpoints
  • šŸ’ø Smart Cheapest Search: Auto-detects "cheapest" queries and searches extensively
  • 🚫 No Cache: Always fresh results, no .db files created
  • šŸ”„ Multi-method: JSON API primary, Playwright browser fallback
  • šŸŽØ Beautiful Output: Human-readable results with clickable links
  • ⚔ Fast: Optimized using officially documented endpoints

šŸ› ļø Tools Available

1. search_daraz - The Main Search Tool

Smart search that handles everything automatically:

# Regular search
search_daraz("wireless mouse")

# Auto-detects cheapest requests  
search_daraz("cheapest wireless mouse")  # Searches 15 pages, sorts by price

# Explicit cheapest mode
search_daraz("mouse", cheapest=True)

# Price filtering
search_daraz("laptops", max_price=50000)

# Category search (uses documented category endpoints)
search_daraz("TV", category="televisions")

Features:

  • Auto-detects "cheapest" in query and switches to extensive search mode
  • Searches 15 pages for cheapest queries vs 5 for regular
  • Sorts results by price for cheapest queries
  • Returns formatted, clickable results

2. product_details - Get Product Info

product_details("https://www.daraz.pk/products/product-url")

šŸ“” API Implementation

This server uses officially documented Daraz.pk endpoints:

Search Endpoint

GET https://www.daraz.pk/catalog/
    ?ajax=true
    &q=query
    &page=1
    &_keyori=ss

Category Endpoint

GET https://www.daraz.pk/{category}/
    ?ajax=true
    &page=1
    &q=search_within_category

Response Structure: data.mods.listItems[] contains product array

šŸš€ Quick Setup

  1. Install dependencies:
pip install fastmcp requests beautifulsoup4 playwright
  1. Add to LM Studio mcp.json:
{
  "mcpServers": {
    "daraz-search": {
      "command": "C:\\path\\to\\python.exe",
      "args": ["C:\\path\\to\\server_merged.py"]
    }
  }
}
  1. Test in LM Studio:
    • "Find cheapest Nothing phone case"
    • "Search for wireless mice under 2000 PKR"
    • "Show me gaming laptops"

šŸŽÆ Improvements from Previous Version

Before (Confusing):

āŒ 6 different tools: search_daraz, search_daraz_structured, search_daraz_formatted, search_cheapest_daraz, search_most_expensive_daraz, product_details āŒ Cache causing stale results
āŒ AI couldn't decide which tool to use

After (Clean):

āœ… 2 simple tools: search_daraz (smart), product_details āœ… No cache - always fresh results āœ… Auto-detection of user intent āœ… Uses documented API patterns

šŸ“Š Search Behavior

Query Type Pages Searched Results Sorting
Regular search 5 pages Up to 10 As found
"Cheapest" query 15 pages 1 item Price (lowest first)
With cheapest=True 15 pages 1 item Price (lowest first)
With max_price 5 pages Filtered As found

šŸ”§ No Cache = Always Fresh

  • āœ… No .db files created
  • āœ… Every search hits Daraz API fresh
  • āœ… Latest prices and stock status
  • āœ… No stale cached results

šŸ›”ļø Anti-Bot Protection

  • User-Agent rotation (5 different browsers)
  • Random delays between requests (1.0-2.5s)
  • Proper headers and referrers
  • Graceful fallback to browser automation

šŸ“– Usage Examples

For Users in LM Studio:

  • "Find me the cheapest Nothing phone 1 case"
  • "Search for wireless mice under 1500 PKR"
  • "What are some good gaming laptops?"
  • "Show me TVs in the television category"

For Developers:

# The AI will automatically choose the right parameters
search_daraz("cheapest phone cases")  # cheapest=True, max_results=1
search_daraz("phone cases")           # regular search, max_results=10
search_daraz("cases", max_price=500)  # price filtering

šŸŽ‰ Ready to Use

This server is production-ready and uses officially documented Daraz.pk API patterns for maximum reliability. No seller account required - works with public endpoints only.

Start LM Studio, add the MCP server, and start shopping! šŸ›ļø

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