DEV Community

Ramandeep Singh
Ramandeep Singh

Posted on

MCP Server for Amazon Products (100% Open Source) πŸ›’πŸš€

Overview πŸ“

I've built a powerful MCP Server for Amazon that's completely open source! This innovative server leverages the Model Context Protocol (MCP) to create a seamless bridge between your applications and Amazon product data. Supercharge your workflow with these amazing capabilities:

  • πŸ” Search for Amazon products by keyword
  • πŸ“¦ Scrape detailed product information (name, price, image, rating, reviews, availability, description)
  • ⚑ No API keys or authentication required
  • πŸ› οΈ Easy integration with tools like Cursor and Claude Desktop

Cursor demo

Setup βš™οΈ

  1. πŸ§‘β€πŸ’» Clone the repository:
git clone https://github.com/r123singh/amazon-mcp-server.git
Enter fullscreen mode Exit fullscreen mode
  1. πŸ“‚ cd amazon-mcp-server
  2. πŸ—οΈ Create a virtual environment:
python -m venv venv
Enter fullscreen mode Exit fullscreen mode
  1. ▢️ Activate the virtual environment:
  2. On Linux/macOS:
  source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode
  • On Windows:
  venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode
  1. πŸ“¦ Install dependencies:
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode
  1. 🚫 No API keys or tokens are required!

  2. πŸ› οΈ Configure MCP JSON:
    Create a mcp.json file with:

{
  "mcpServers": {
    "amazon": {
      "command": "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\venv\\Scripts\\python.exe",
      "args": [
        "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\server.py"
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Replace:

  • πŸ—‚οΈ {PATH_TO_DIRECTORY} with the absolute path to this directory (use pwd or cd to get the path)

Available Tools πŸ› οΈ

The server provides the following tools for interacting with Amazon:

  • πŸ›’ Scrape a product

    • scrape_product(product_url)
    • Scrape product details (name, price, image, rating, reviews, availability, description) from a given Amazon product URL.
  • πŸ” Search for products

    • search_products(query, max_results)
    • Search for products on Amazon by keyword and return a list of results.

Usage 🚦

Now that you have the MCP server configured, you can use it in your applications. The server provides a natural language interface to interact with Amazon through the available tools such as Cursor, Claude Desktop, and more!

Cursor AI πŸ’»

  1. Open MCP settings in Cursor AI - File -> Settings -> MCP -> Enable MCP
  2. Add the following to your Cursor AI settings:
{
  "mcpServers": {
    "amazon": {
      "command": "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\venv\\Scripts\\python.exe",
      "args": [
        "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\server.py"
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode
  1. πŸ”„ Restart Cursor AI

  2. Use the following prompt to use the Amazon MCP server:

Search Amazon for 'wireless headphones', show top 3 results πŸ›’
Enter fullscreen mode Exit fullscreen mode

Or:

Get details for this Amazon product: [product URL]
Enter fullscreen mode Exit fullscreen mode

Claude Desktop πŸ–₯️

  1. Open Claude Desktop. Go to File -> Settings -> Select developer tab -> Click on "Edit config"
  2. It will open location of config file in your default editor. It is named 'claude_desktop_config.json'. Open it.
  3. Add the following to the config:
{
  "mcpServers": {
    "amazon": {
      "command": "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\venv\\Scripts\\python.exe",
      "args": [
        "{PATH_TO_DIRECTORY}\\amazon-mcp-server\\server.py"
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode
  1. The new mcp server should appear in the settings page with status "Running" or "Connected" βœ…

  2. Close the settings page and go back to the chat. Select the 3 line icon just below the chat input box. It should display now "amazon" in the list of available servers, clicking it will list all the tools available.

  3. Use the following prompt to search for products:

Search Amazon for 'wireless headphones', show top 3 results πŸ›’
Enter fullscreen mode Exit fullscreen mode

Or to get product details:

Get details for this Amazon product: [product URL]
Enter fullscreen mode Exit fullscreen mode
  1. It will prompt initially to run the tool. Click on "Always run". It will fetch the product data from Amazon and return the details. πŸ”—

Why Use This MCP Server? πŸ€”

  • πŸš€ Instantly access Amazon product data without API keys or scraping headaches
  • πŸ›‘οΈ 100% open source and privacy-friendly
  • 🧩 Plug-and-play with modern AI tools and workflows
  • πŸ› οΈ Extensible for your own custom use-cases

Top comments (2)

Collapse
 
dotallio profile image
Dotallio

This is super practical, especially not needing API keys or tokens. Are you planning to add support for any other marketplaces in the future?

Collapse
 
buildandcodewithraman profile image
Ramandeep Singh

Thanks! Yes, we're definitely considering expanding to other marketplaces. The no-API-key approach makes it much easier to add new platforms