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
Visit Server

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).

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
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
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
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured