Logo van Amazon Cart MCP Server

Amazon Cart MCP Server

Community
madebydia

MCP server for your Amazon cart. Made for Poke.com but works for everyone.

Uitgevermadebydia
Repositoryamazon-mcp-server
TaalTypeScript
Forks
9
Sterren
22
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    Amazon Cart MCP Server biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    22 sterren en 9 forks in de gekoppelde repository.

Amazon Cart MCP Server

Local MCP (Model Context Protocol) server that enables AI assistants to interact with your personal Amazon cart through browser automation. Works with Claude Desktop, Poke, and any MCP-compatible client.

⚠️ Important Disclaimer

This tool uses browser automation to interact with Amazon.com.

  • Users are solely responsible for ensuring their use complies with Amazon's Terms of Service
  • This project is for personal, educational use only - not for commercial automation or reselling
  • Use at your own risk - the authors assume no liability for any violations of Amazon's policies or consequences thereof
  • Not affiliated with Amazon - this is an independent, unofficial tool
  • Amazon may change their website or policies at any time, potentially breaking functionality
  • Excessive automation may result in account restrictions or bans

By using this software, you acknowledge and accept these risks.

Features

  • 🔍 Search Amazon - Find products by search query
  • 🛒 Add to Cart - Add items to your Amazon cart automatically
  • 👀 View Cart - Check current cart contents and subtotal
  • 🔐 Login Persistence - Session saved locally for seamless use
  • 🌐 Secure Access - Bearer token authentication via ngrok tunnel

Quick Start

Prerequisites

  • Node.js v20 or higher
  • npm or yarn
  • ngrok account (free tier works)

Installation

  1. Clone the repository:

    bash
    git clone https://github.com/madebydia/amazon-mcp-server.git
    cd amazon-mcp-server
  2. Install dependencies:

    bash
    npm install
  3. Configure environment:

    bash
    cp .env .env.local  # Optional: keep your settings separate

    Edit .env and set:

    • AUTH_TOKEN - Generate a secure random token (required)
    • HEADLESS=false - For first-time login
    • AMAZON_DOMAIN=amazon.com - Or your local Amazon domain
  4. Build the project:

    bash
    npm run build
  5. Start the server:

    bash
    npm start
  6. First-time login:

    • A Chrome browser window will open
    • Log into your Amazon account manually
    • Session will be saved in ./user-data/
    • After logging in once, you can:
      • Stop the server (Ctrl+C)
      • Set HEADLESS=true in .env
      • Restart with headless mode
  7. Expose via ngrok (in a separate terminal):

    bash
    npm run tunnel
    # Note the HTTPS URL (e.g., https://abc123.ngrok.io)

Connecting to Poke

  1. Copy your ngrok URL from the terminal

  2. In Poke, add a custom MCP integration:

    • URL: https://your-ngrok-url.ngrok.io/sse
    • API Key: Your AUTH_TOKEN from .env
    • Type: MCP Server
  3. Important: Always use the /sse endpoint!

  4. Test the connection by asking Poke:

    • "What tools do you have?"
    • "Search Amazon for wireless mouse"

Connecting to Claude Desktop

  1. Build the project: npm run build
  2. Open Claude Desktop → Settings → Developer → Edit Config
  3. Add to mcpServers:
json
{
  "mcpServers": {
    "amazon-cart": {
      "command": "node",
      "args": ["/absolute/path/to/amazon-mcp-server/dist/server.js"],
      "env": {
        "AUTH_TOKEN": "your-token-here",
        "HEADLESS": "true",
        "AMAZON_DOMAIN": "amazon.com"
      }
    }
  }
}
  1. Restart Claude Desktop
  2. You should see the Amazon tools available in the tools menu (🔧)

First-time setup: Run the server once with HEADLESS=false to log into Amazon manually. After that, set HEADLESS=true for Claude Desktop.

Available Tools

ToolDescriptionParameters
search_amazonSearch for products on Amazonquery (required)
add_to_cartAdd a product to cartquery or asin, quantity (optional)
view_cartView current cart contentsNone
check_loginVerify Amazon login statusNone

Architecture

┌─────────────────┐
│   Poke.com      │ (Remote AI Assistant)
│   (Cloud)       │
└────────┬────────┘
         │ HTTPS
         ↓
┌─────────────────┐
│     ngrok       │ (Secure Tunnel)
│  Public HTTPS   │
└────────┬────────┘
         │ Local
         ↓
┌─────────────────┐
│   MCP Server    │ (Port 3000)
│   SSE + HTTP    │
└────────┬────────┘
         │
         ↓
┌─────────────────┐
│   Puppeteer     │ (Browser Automation)
│  + Chrome       │
│  (Persistent    │
│   Session)      │
└─────────────────┘

Configuration

Environment Variables

VariableDefaultDescription
PORT3000Server port
AUTH_TOKENrequiredBearer token for authentication
AMAZON_DOMAINamazon.comAmazon domain (e.g., amazon.co.uk)
HEADLESSfalseRun browser in headless mode
USER_DATA_DIR./user-dataChrome user data directory

Example .env

bash
PORT=3000
AUTH_TOKEN=a1b2c3d4-e5f6-4789-a012-3b4c5d6e7f8a
AMAZON_DOMAIN=amazon.com
HEADLESS=false
USER_DATA_DIR=./user-data

Security

⚠️ Important Security Considerations

  1. AUTH_TOKEN Protection

    • Never commit .env to Git (already in .gitignore)
    • Use a cryptographically secure random token
    • Generate with: openssl rand -hex 32
  2. ngrok Security

    • Free tier URLs are public but unguessable
    • Consider ngrok's authentication features for extra security
    • Upgrade to ngrok paid plan for reserved domains and IP restrictions
  3. Session Data

    • Login sessions stored in ./user-data/
    • Contains cookies and authentication tokens
    • Never share or commit this directory
    • Already excluded via .gitignore
  4. Network Security

    • Server only accepts authenticated requests
    • All traffic through ngrok is HTTPS encrypted
    • Local server binds to localhost only
  5. Browser Automation

    • Puppeteer runs with sandbox disabled (required for some systems)
    • Session isolation via Chrome user data directory
    • No data sent to third parties

Best Practices

  • ✅ Use strong, unique AUTH_TOKEN
  • ✅ Never share your ngrok URL publicly
  • ✅ Regularly rotate AUTH_TOKEN
  • ✅ Monitor server logs for suspicious activity
  • ✅ Keep dependencies updated (npm audit)
  • ✅ Use HEADLESS=true in production
  • ⚠️ This is for personal use only - not production-ready for multi-user scenarios

Troubleshooting

Tools Not Showing in Poke

  1. Restart the server
  2. Delete and re-add the MCP connection in Poke
  3. Check server logs for tools/list request
  4. Verify ngrok tunnel is active

Items Not Added to Cart

  1. Verify you're logged into Amazon:
    • Check the browser window (if visible)
    • Or ask Poke to run check_login
  2. If not logged in:
    • Set HEADLESS=false
    • Restart server
    • Log in manually in the browser window

Connection Keeps Dropping

  • Normal behavior - Poke reconnects as needed
  • If persistent, check ngrok connection: curl https://your-url.ngrok.io/health

Computer Sleep Mode

  • Server and ngrok pause when computer sleeps
  • Poke will reconnect automatically on wake
  • To prevent sleep: Run caffeinate in a separate terminal (macOS)

Development

Project Structure

amazon-mcp/
├── src/
│   ├── server.ts       # MCP server + SSE implementation
│   ├── amazon.ts       # Amazon automation logic
│   ├── browser.ts      # Puppeteer browser management
│   └── types.ts        # TypeScript interfaces
├── dist/               # Compiled JavaScript (gitignored)
├── user-data/          # Chrome session data (gitignored)
├── .env                # Environment config (gitignored)
└── package.json

Running in Development

bash
npm run dev    # Uses ts-node, no build required

Building

bash
npm run build  # Compiles TypeScript to dist/

Testing

Health Check

bash
curl http://localhost:3000/health

Expected response:

json
{"status":"ok","server":"amazon-mcp-server"}

Test SSE Connection

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  http://localhost:3000/sse

Should maintain an open connection with heartbeats.

Compliance Notes

This project is designed for personal, single-user use only. It is not intended for:

  • ❌ Multi-tenant deployments
  • ❌ Production SaaS applications
  • ❌ SOC 2 Type II compliance scenarios
  • ❌ HIPAA or other regulated data handling
  • ❌ Commercial automation at scale

If you need enterprise-grade compliance, consider:

  • Implementing proper authentication (OAuth 2.0)
  • Adding audit logging
  • Using encrypted storage for sessions
  • Deploying to compliant infrastructure (AWS, GCP with compliance certifications)
  • Implementing rate limiting and abuse prevention

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Author

Created by @madebydia


Note: Keep your computer awake while running the server. The ngrok tunnel and SSE connections are sensitive to network interruptions.

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "meimakes-amazon-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Gebruik Amazon Cart MCP Server MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Amazon Cart MCP Server is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Amazon Cart MCP Server toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Amazon Cart MCP Server.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "meimakes-amazon-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "amazon-mcp-server"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Amazon Cart MCP Server in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Amazon Cart MCP Server in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Amazon Cart MCP Server gebruiken om me hiermee te helpen?
Amazon Cart MCP Server
Zeker. Ik heb het gelezen.
Dit vond ik met Amazon Cart MCP Server.

Veelgestelde vragen

Waarvoor wordt de MCP-server Amazon Cart MCP Server gebruikt?

Amazon Cart MCP Server is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Amazon Cart MCP Server MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Amazon Cart MCP Server gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Amazon Cart MCP Server MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Amazon Cart MCP Server verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Amazon Cart MCP Server MCP met TypingMind?

Amazon Cart MCP Server werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Amazon Cart MCP Server MCP in TypingMind?

Amazon Cart MCP Server biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Amazon Cart MCP Server MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Amazon Cart MCP Server authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇