PriceHunt MCP Server

PriceHunt MCP Server

Enables searching and comparing products across Pakistani e-commerce platforms Daraz, Telemart, and iShopping, filtering by price and ratings.

Category
访问服务器

README

🛍️ PriceHunt

A Model Context Protocol (MCP) implementation that finds the lowest-priced products with good ratings (4+ stars) across major Pakistani e-commerce platforms including Daraz, Telemart, and iShopping.

MCP

Model Context Protocol (MCP) is a standardized protocol that enables AI applications to securely connect to external data sources and tools. It acts as a bridge between AI models (like Gemini) and various services, databases, APIs, and applications.

MCP Architecture Components:

  • MCP Servers - Provide specific tools, resources, or data to clients
  • MCP Clients - AI applications that want to access external resources
  • Transport Layer - Communication mechanism between clients and servers

🎯 Project Overview

This project demonstrates MCP implementation by creating:

  1. MCP Server: Provides three tools for scraping Pakistani e-commerce sites
  2. MCP Client: Uses LangChain + Google Gemini to orchestrate tool calls
  3. Streamlit Frontend: User-friendly web interface for product searches

Note: In this project both server and client run on the same host for learning purposes.

✨ Features

  • 🔍 Multi-Platform Search: Scrapes Daraz, Telemart, and iShopping simultaneously
  • Quality Filtering: Prioritizes products with 4+ star ratings
  • 💰 Price Search: Finds the lowest-priced genuine products
  • 🤖 AI-Powered: Uses Google Gemini for intelligent product matching
  • 💬 Chat Interface: Conversational UI with memory
  • 🚀 Async Processing: Non-blocking operations for better performance

<img width="1366" height="671" alt="PriceHunt" src="https://github.com/user-attachments/assets/19b36d89-77cc-4295-b9aa-44d51d098e0c" />

🏛️ MCP Architecture

This Project's MCP Implementation:

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Streamlit     │    │   MCP Client    │    │   MCP Server    │
│   Frontend      │◄──►│  (LangChain +   │◄──►│   (FastMCP)     │
│   (app.py)      │    │   Gemini)       │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                                        │
                                                        ▼
                                               ┌─────────────────┐
                                               │   E-commerce    │
                                               │   Websites      │
                                               │ • Daraz.pk      │
                                               │ • Telemart.pk   │
                                               │ • iShopping.pk  │
                                               └─────────────────┘

MCP Tools Defined:

  1. get_daraz_products(query) - Scrapes Daraz with 4+ rating filter
  2. get_telemart_products(query) - Scrapes Telemart search results
  3. get_ishopping_products(query) - Scrapes iShopping catalog

📁 Project Structure

PriceHunt-MCP/
├── project/             # Client-side code
│   └── app.py              # Streamlit web interface
|   └── mcp_client.py          # MCP Client with LangChain integration
|   └── mcp_server.py          # MCP Server with 3 e-commerce tools
├── python-version         # Python version specification
├── pyproject.toml         # Python project configuration
├── README.md             # This file
└── uv.lock               # UV dependency lock file

🚀 Installation & Setup

1. Clone the Repository

git clone https://github.com/FassihShah/PriceHunt-MCP.git
cd PriceHunt-MCP

2. Create Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
venv\Scripts\activate

3. Install Dependencies

Since we're using uv, install dependencies with:

# If using uv (recommended)
uv install

# Or using pip with requirements.txt
pip install -r requirements.txt

If you don't have uv installed:

# Install uv first
pip install uv
# Then install dependencies
uv install

4. Set Up Environment Variables

Create a .env file in the project root:

GOOGLE_API_KEY=your_google_gemini_api_key_here

🖥️ Using with Claude Desktop

This MCP server can also be integrated directly with Claude Desktop application, allowing to use the e-commerce tools directly in your conversations with Claude!

Setup for Claude Desktop:

1. Install Claude Desktop:

2. Configure Claude Desktop: Open the Claude Desktop configuration file:

Windows:

code %APPDATA%\Claude\claude_desktop_config.json

3. Add Your MCP Server: Create or update the claude_desktop_config.json file:

{
  "mcpServers": {
    "ecommerce-scraper": {
      "command": "python",
      "args": ["/path/to/your/project/mcp_server.py"],
      "env": {
        "PYTHONPATH": "/path/to/your/project"
      }
    }
  }
}

Once configured, you can directly ask Claude things like:

  • "Find me the cheapest Ronin Earbuds"

Claude will automatically use these MCP tools to scrape the websites and provide results!

🎮 Usage

Method 1: Claude Desktop Integration

After setting up Claude Desktop configuration (see section above)

Method 2: Streamlit Web Interface

streamlit run app.py

Method 3: MCP Inspector (Development & Testing)

Use the official MCP Inspector to test and debug your server:

uv run mcp dev mcp_server.py

This will:

  • Launch a web interface
  • Test all your tools interactively
  • View tool schemas and parameters

📚 Learning Outcomes

This project demonstrates:

  • MCP Protocol: Understanding of server/client architecture
  • AI Integration: LangChain + LLM tool orchestration
  • Async Programming: Non-blocking operations

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选