Skip to main content
Glama

How It Works

graph LR
    A[AI Assistant<br/>Claude / Open AI / Kiro / Any AI Chat or LLM Model] -->|MCP Protocol<br/>stdio| B[shop-mcp<br/>Server]
    B -->|Playwright<br/>Browser Automation| C[Amazon.in]
    B -->|Playwright<br/>Browser Automation| D[Flipkart]

    B --- E[Saved Sessions<br/>cookies only<br/>no passwords]

    style A fill:#4A90D9,color:#fff
    style B fill:#2ECC71,color:#fff
    style C fill:#FF9900,color:#fff
    style D fill:#F7D02C,color:#000
    style E fill:#95A5A6,color:#fff
flowchart LR
    AI["๐Ÿค– YOUR AI ASSISTANT\nClaude Desktop ยท Kiro ยท Any MCP Client"]

    subgraph SERVER["๐Ÿ–ฅ๏ธ shop-mcp SERVER"]
        direction TB
        RO["๐Ÿ“– Read-Only\nsearch_product\nview_cart\nget_product_details\nget_order_status"]
        MU["โœ๏ธ Mutations\nadd_to_cart"]
        GC["๐Ÿ” Guarded Checkout\ncheckout_dry_run\nplace_order\nToken + โ‚น3000 cap\n5 min expiry"]
    end

    subgraph SITES["๐ŸŒ Shopping Platforms"]
        direction TB
        AMZ["๐ŸŸ  Amazon.in\nSession cookies\nManual login once"]
        FK["๐Ÿ”ต Flipkart\nSession cookies\nManual login once"]
    end

    AI -->|"MCP Protocol\nstdio"| SERVER
    SERVER -->|"Playwright\nChromium"| SITES

    style AI fill:#1a73e8,stroke:#0d47a1,stroke-width:3px,color:#fff
    style SERVER fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#2e7d32
    style RO fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px,color:#1b5e20
    style MU fill:#fff9c4,stroke:#f9a825,stroke-width:2px,color:#e65100
    style GC fill:#ffcdd2,stroke:#c62828,stroke-width:2px,color:#b71c1c
    style SITES fill:#f3e5f5,stroke:#6a1b9a,stroke-width:2px,color:#6a1b9a
    style AMZ fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#bf360c
    style FK fill:#e8eaf6,stroke:#283593,stroke-width:2px,color:#1a237e

Related MCP server: browser-agent-mcp

Key Features

Feature

Description

Price Comparison

Search the same product on both platforms and compare prices instantly

Cart Management

View, add to cart across Amazon.in and Flipkart

Guarded Checkout

Orders require a dry-run summary + confirmation token + price cap

No Password Storage

You log in manually once; only session cookies are saved

Headed Browser

Visible Chromium window โ€” no stealth, no detection issues

MCP Standard

Works with any MCP-compatible AI client via stdio transport


Quick Start

# 1. Clone & setup
git clone https://github.com/detushar/shop-mcp.git
cd shop-mcp
python -m venv .venv
.venv\Scripts\activate              # or source .venv/bin/activate on Linux/macOS

# 2. Install dependencies
pip install -r requirements.txt
playwright install chromium          # downloads browser binary (~180MB)

# 3. Login to sites (one-time, manual)
python -m browser.login amazon
python -m browser.login flipkart

# 4. Run the MCP server
python server.py

Note: playwright install chromium downloads the Chromium binary that Playwright controls. This is separate from the Python package and required for the server to work.


Tools

Tool

Effect

Risk Level

search_product

Search a site for products

Read-only

get_product_details

Get price, title, availability for a product URL

Read-only

view_cart

List current cart contents

Read-only

get_order_status

Look up an existing order by ID

Read-only

add_to_cart

Add a product to the cart

Reversible

checkout_dry_run

Load checkout summary WITHOUT submitting

Read-only

place_order

Submit the order

Irreversible โ€” guarded


Safety Guards

place_order() will REFUSE if:
  โœ— No checkout_dry_run() was called first
  โœ— confirm_token doesn't match the latest dry-run
  โœ— Token is older than 5 minutes (stale prices)
  โœ— Order total exceeds โ‚น3,000 (configurable cap)

Configure in config.py:

Setting

Default

Purpose

MAX_ORDER_TOTAL_INR

3000

Hard price ceiling per order

REQUIRE_CONFIRM_TOKEN

True

Forces dry-run before every purchase

CONFIRM_TOKEN_TTL_SECONDS

300

Token expiry (forces fresh price check)


MCP Client Config

Example config file: mcp-config-example.json

Claude Desktop

%APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "shop-mcp": {
      "command": "C:\\path\\to\\shop-mcp\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\shop-mcp\\server.py"],
      "env": { "PYTHONUNBUFFERED": "1" }
    }
  }
}

Kiro IDE

Add to .kiro/settings/mcp.json:

{
  "mcpServers": {
    "shop-mcp": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "D:\\path\\to\\shop-mcp",
      "env": { "PYTHONUNBUFFERED": "1" },
      "disabled": false
    }
  }
}

Linux / macOS

{
  "mcpServers": {
    "shop-mcp": {
      "command": "/path/to/shop-mcp/.venv/bin/python",
      "args": ["/path/to/shop-mcp/server.py"],
      "env": { "PYTHONUNBUFFERED": "1" }
    }
  }
}

Always use the Python from your .venv so all dependencies are available.


Project Structure

shop-mcp/
โ”œโ”€โ”€ server.py               # MCP server โ€” tool definitions & checkout guards
โ”œโ”€โ”€ config.py               # Safety settings, timeouts, site URLs
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ mcp-config-example.json # Client configuration template
โ”œโ”€โ”€ browser/
โ”‚   โ”œโ”€โ”€ base.py             # Playwright session management (cookies, context)
โ”‚   โ”œโ”€โ”€ amazon.py           # Amazon.in browser actions (search, cart, checkout)
โ”‚   โ”œโ”€โ”€ flipkart.py         # Flipkart browser actions
โ”‚   โ””โ”€โ”€ login.py            # Manual login helper (opens browser for you)
โ””โ”€โ”€ sessions/               # Auto-created, .gitignored โ€” stores login cookies

Important Notes

Terms of Service

Amazon.in and Flipkart restrict bot access. This is for personal, low-volume use of your own account only.

Selectors Break

Both sites change their DOM frequently. Expect to update CSS selectors in browser/amazon.py and browser/flipkart.py when things stop working.

Headed Mode

Both sites detect headless browsers. Everything runs with a visible Chromium window (headless=False).

Session Expiry

When cookies expire, re-run python -m browser.login <site> to refresh.


Tech Stack

Component

Technology

Server Framework

MCP (Model Context Protocol) via fastmcp

Browser Automation

Playwright (Chromium)

Language

Python 3.10+

Transport

stdio (local server)


License

MIT License. See LICENSE for details.


F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.

  • Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.

  • Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/detushar/shop-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server