Amazon Product Search
An AI-powered server for Amazon product search and recommendations.
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
- Clone this repository and navigate to the project directory
- 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 interfacePOST /search: REST API for product searchGET /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:
- Hugging Face API Token: Update
HF_API_TOKENinserver/buy.py - RapidAPI Key: Update the
x-rapidapi-keyinserver/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
- Import errors: Make sure you're in the correct virtual environment
- API failures: Check your API keys and internet connection
- 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
- Add new tools in
server/buy.pyusing the@mcp.tool()decorator - Update client code to use new tools
- 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).
Related Servers
Jina AI Search
Perform semantic, image, and cross-modal searches using Jina AI's neural search capabilities.
MCP Registry Server
A server for discovering and retrieving other MCP servers via MCPulse.
TMDB MCP Server
Access movie information, search, and recommendations from The Movie Database (TMDB) API.
Custom Elasticsearch
A simple MCP server for Elasticsearch, designed for cloud environments where your public key is already authorized.
Airbnb
Search for Airbnb listings and get detailed information about accommodations.
JinaAI Grounding
Enhances LLM responses with factual, real-time web content using Jina AI's grounding capabilities.
ๆๆๆ ๅคงๆฐๆฎๆๅก
Provides comprehensive import and export trade data query functions, including trend analysis, product statistics, and geographic distribution.
Langflow Document Q&A Server
A document question-and-answer server powered by Langflow.
Langgraph Deep Search MCP Server
A deep search server powered by LangGraph and the Google Gemini API.
Naver Search
Search across various Naver services and analyze data trends using the Naver Search and DataLab APIs.