Skip to main content

A Model Context Protocol (MCP) service for Amazon Product Advertising API integration.

Project description

Amazon PA-API MCP Service

A Model Context Protocol (MCP) service for Amazon Product Advertising API integration. This project uses the Python SDK officially provided at Product Advertising API 5.0.

PyPI - Python Version PyPI - Version PyPI - Downloads

Integration in Claude & Cursor

For configuring host, region and markeplace, consult the Locale Reference for Product Advertising API documentation.

{
  "mcpServers": {
    "amazon-paapi": {
      "command": "uvx",
      "args": [
        "mcp-amazon-paapi"
      ],
      "env": {
        "PAAPI_ACCESS_KEY": "your-access-key",
        "PAAPI_SECRET_KEY": "your-secret-key",
        "PAAPI_PARTNER_TAG": "your-partner-tag",
        "PAAPI_HOST": "webservices.amazon.de",  // select EU or US servers and region
        "PAAPI_REGION": "eu-west-1",
        "PAAPI_MARKETPLACE": "www.amazon.de" // set your preferred marketplace
      }
    }
  }
}

Project Structure

mcp-amazon-paapi/
├── src/
│   └── mcp_amazon_paapi/           # Main package
│       ├── __init__.py             # Package initialization
│       ├── service.py              # Amazon PA-API service class with dependency injection
│       ├── server.py               # FastMCP server implementation
│       └── _vendor/                # Vendored dependencies
│           └── paapi5_python_sdk/  # Amazon PA-API Python SDK
├── test/                           # Test suite
│   ├── __init__.py                 # Test package initialization
│   └── test_service.py             # Tests for service module
├── pyproject.toml                  # Project configuration and dependencies
├── uv.lock                         # Dependency lock file
├── README.md                       # Project documentation

Local Setup

Initial Setup

# Sync dependencies from uv.lock (creates virtual environment automatically)
uv sync

# Alternatively, activate the virtual environment manually
source .venv/bin/activate  # Linux/Mac
# or
.venv\Scripts\activate     # Windows

Environment Variables

export PAAPI_ACCESS_KEY="your-access-key"
export PAAPI_SECRET_KEY="your-secret-key"
export PAAPI_PARTNER_TAG="your-partner-tag"
export PAAPI_HOST="webservices.amazon.de"       # optional defaults to webservices.amazon.de
export PAAPI_REGION="eu-west-1"                 # optional defaults to eu-west-1
export PAAPI_MARKETPLACE="www.amazon.de"        # optional, defaults to www.amazon.de

Testing

Run the simple test suite:

# Run all tests with uv (recommended)
uv run python -m pytest test/test_service.py -v

# Or if you have activated the virtual environment
pytest test/test_service.py -v

The test suite includes:

  • Service initialization tests
  • Configuration management tests
  • Search functionality tests with mocking
  • Error handling tests

Usage

from service import AmazonPAAPIService

# Create service (uses environment variables)
service = AmazonPAAPIService()

# Search for items
items = service.search_items("echo dot", "Electronics", 5)

Running the MCP Server

# Run directly with uv (recommended)
uv run python server.py

# Or if you have activated the virtual environment
python server.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_amazon_paapi-0.3.0.tar.gz (65.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_amazon_paapi-0.3.0-py3-none-any.whl (218.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_amazon_paapi-0.3.0.tar.gz.

File metadata

  • Download URL: mcp_amazon_paapi-0.3.0.tar.gz
  • Upload date:
  • Size: 65.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_amazon_paapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 897bfc291207dd8cf9abde774077bdb00adb3f2749ee17c0703629e645f62132
MD5 3c20d8b101e69afcda5e2810f69a073d
BLAKE2b-256 6faefe221dc93a3a381c16ca3ca2ed24f7df66f1739287cbd67351b3068c7ba1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_amazon_paapi-0.3.0.tar.gz:

Publisher: python-publish.yml on jademind/mcp-amazon-paapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_amazon_paapi-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_amazon_paapi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f689a4202d961a93c3d6b6053c80ea4ce609a2c98e1f3e2692d98de1dd469cc7
MD5 0335839b98dcecb3ea73e3d20765d74f
BLAKE2b-256 9009202e79e8d5822d1a5d799379a471b346d93e01af3b9f835cc8cec5278f6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_amazon_paapi-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on jademind/mcp-amazon-paapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page