Amazon Cart MCP Serverのロゴ

Amazon Cart MCP Server

コミュニティ
madebydia

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

公開者madebydia
リポジトリamazon-mcp-server
言語TypeScript
フォーク
9
スター
22
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Amazon Cart MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには22件のスターと9件のフォークがあります。

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.

インストール

TypingMind
前提条件:

Node.js 18+

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

Amazon Cart MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Amazon Cart MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Amazon Cart MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Amazon Cart MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "meimakes-amazon-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "amazon-mcp-server"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてAmazon Cart MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Amazon Cart MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Amazon Cart MCP Serverを使ってこのタスクを手伝ってもらえますか?
Amazon Cart MCP Server
はい、読みました。
Amazon Cart MCP Serverで調べた結果をお伝えします。

よくある質問

Amazon Cart MCP Server MCPサーバーは何に使いますか?

Amazon Cart MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでAmazon Cart MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでAmazon Cart MCP Serverを利用できます。

TypingMindでAmazon Cart MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Amazon Cart MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Amazon Cart MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Amazon Cart MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでAmazon Cart MCP Server MCPのどのようなツールを利用できますか?

Amazon Cart MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Amazon Cart MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Amazon Cart MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇