Amazon Product Search MCP

Amazon Product Search MCP

Enables AI-powered Amazon product searches and recommendations by integrating the Amazon API with Hugging Face models. It allows users to filter products by price and specific features to receive tailored shopping suggestions.

Category
访问服务器

README

Amazon Product Search MCP Server

The site is live here ! : https://shopassist-sharavana.streamlit.app/

An MCP (Model Context Protocol) server that provides AI-powered Amazon product search and recommendations using FastMCP.

Features

  • 🔍 Smart product search with Amazon API
  • 🤖 AI-powered product recommendations using Hugging Face
  • 💰 Price range filtering
  • 📋 Feature-based matching
  • 🎯 Tailored recommendations for Small/Medium Enterprises

Installation

  1. Clone this repository and navigate to the project directory
  2. Install dependencies:
    # Using uv (recommended)
    uv sync
    
    # Or using pip
    pip install -r requirements.txt
    

Server Setup

Running the MCP Server

# Activate your virtual environment
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Run the server
python main.py

The server exposes one main tool:

  • getdata: Search Amazon products with AI recommendations

Client Options

We provide multiple client implementations to interact with your MCP server:

1. Python Interactive Client (client.py)

A full-featured Python client with examples and interactive mode.

python client.py

Features:

  • Pre-built examples (laptops, smartphones)
  • Interactive search mode
  • Real-time communication with MCP server

2. Command Line Interface (cli_client.py)

Quick command-line searches for automation and scripting.

# Basic search
python cli_client.py "laptop"

# With features and price range
python cli_client.py "laptop" --features "8GB RAM, SSD storage" --min-price 30000 --max-price 80000

# Smartphone search
python cli_client.py "smartphone" --features "good camera, 5G" --min-price 15000 --max-price 50000

Arguments:

  • product: Product to search for (required)
  • --features, -f: Specific features to look for
  • --min-price, -min: Minimum price in rupees
  • --max-price, -max: Maximum price in rupees

3. Web Interface (web_client.py)

A beautiful web interface with REST API backend.

# Install additional dependencies
pip install fastapi uvicorn

# Run the web server
python web_client.py

Then open http://localhost:8000 in your browser for a user-friendly interface.

API Endpoints:

  • GET /: Web interface
  • POST /search: REST API for product search
  • GET /health: Health check

4. MCP CLI Integration

You can also use the MCP CLI to interact with your server:

# Install MCP CLI if not already installed
pip install mcp

# Connect to your server
mcp connect stdio -- python main.py

Usage Examples

Example 1: Laptop Search

{
    "product": "laptop",
    "specific_features": "8GB RAM, SSD storage, good for programming",
    "min_price": 30000,
    "max_price": 80000
}

Example 2: Smartphone Search

{
    "product": "smartphone",
    "specific_features": "good camera, long battery life, 5G support",
    "min_price": 15000,
    "max_price": 50000
}

Example 3: Budget Headphones

{
    "product": "wireless headphones",
    "specific_features": "noise cancellation, comfortable",
    "min_price": 1000,
    "max_price": 5000
}

Configuration

API Keys Required

Make sure you have:

  1. Hugging Face API Token: Update HF_API_TOKEN in server/buy.py
  2. RapidAPI Key: Update the x-rapidapi-key in server/buy.py

Customization

You can customize the AI recommendation prompt in the decision_agent function in server/buy.py.

Integration with Claude Desktop

To use this MCP server with Claude Desktop, add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "amazon-search": {
      "command": "python",
      "args": ["path/to/your/main.py"],
      "env": {}
    }
  }
}

Troubleshooting

Common Issues

  1. Import errors: Make sure you're in the correct virtual environment
  2. API failures: Check your API keys and internet connection
  3. Connection issues: Ensure the MCP server is running before starting clients

Error Messages

  • "No result": Usually indicates API issues or no products found
  • "Connection refused": MCP server is not running
  • "Tool not found": Server initialization issue

Development

Adding New Features

  1. Add new tools in server/buy.py using the @mcp.tool() decorator
  2. Update client code to use new tools
  3. Test with the interactive client first

Testing

# Test the server directly
python -c "from server.buy import mcp; print('Server loads successfully')"

# Test with the interactive client
python client.py

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   MCP Client    │◄──►│   MCP Server    │◄──►│  External APIs  │
│  (Your Choice)  │    │   (FastMCP)     │    │ (Amazon/HF AI)  │
└─────────────────┘    └─────────────────┘    └─────────────────┘
       │                        │                        │
       ▼                        ▼                        ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  • client.py    │    │ • Tool: getdata │    │ • Amazon Search │
│  • cli_client   │    │ • AI Agent      │    │ • HuggingFace   │
│  • web_client   │    │ • FastMCP       │    │ • Recommendations│
│  • Claude       │    │                 │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘

License

This project is open source. Please ensure you comply with the terms of service of the APIs used (Amazon, RapidAPI, Hugging Face).

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选