Skip to main content
Glama

ebay-mcp

Python License: MIT MCP eBay Browse API tests: passing

Give an AI agent real, live market prices — straight from the largest secondhand marketplace on the internet.

eBay is a continuously-updating ledger of what physical things actually cost right now. This wraps its Browse API as an MCP server with three tools, so an agent can search listings, pull a single item, and — the useful one — get an aggregated price landscape for anything: min, median, max, broken down by condition.

Python 3.12+ · MIT · MCP server · app-token auth, no user login

Setup is one free eBay app keyset — no user login, no OAuth consent screen to click through. Point an agent at it and ask "what does an RTX 5080 actually go for?" — one call back comes a grounded answer, split by condition, with the cheapest listings attached.


Contents


Related MCP server: Ebay Mcp Server

The three tools

Tool

What it does

ebay_price_check

Aggregated price landscape for a query — count, min/median/max, a breakdown by condition, and the cheapest listings. The headline tool.

ebay_search

Listing search with sorting and filtering — returns clean {itemId, title, price, condition, seller, itemWebUrl} rows.

ebay_get_item

Full detail for one item by ID.

// ebay_price_check  ·  query: "RTX 5080", exclude: ["laptop", "notebook"]
{
  "count": 47, "currency": "USD",
  "min": 899, "median": 1099, "max": 2200,
  "by_condition": {
    "New":  { "count": 18, "min": 1099, "median": 1199, "max": 1634 },
    "Used": { "count": 21, "min": 899,  "median": 1050, "max": 1499 }
  },
  "cheapest": [ { "price": 899, "condition": "Used", "title": "…", "itemWebUrl": "…" } ]
}

Architecture: one client, three tools

Every tool flows through a single EbayBrowseClient, which owns the token and talks to eBay. There's one place credentials are read, one place a token is cached, one place HTTP happens — nothing to drift.

flowchart LR
    Agent(["AI agent / Claude"])
    subgraph server["ebay-mcp · stdio server"]
        Tools["ebay_search<br/>ebay_get_item<br/>ebay_price_check"]
        Client["EbayBrowseClient"]
        Cache[("OAuth token<br/>in-memory, auto-refresh")]
    end
    Cfg["~/.ebay-mcp.toml<br/>or env vars"]
    eBay["eBay Browse API"]

    Agent -->|"MCP tool call"| Tools
    Tools -->|"search / get_item"| Client
    Client <-->|"reuse or mint token"| Cache
    Client -->|"Bearer token + query"| eBay
    eBay -->|"listings JSON"| Client
    Cfg -.->|"keyset + active env"| Client

The server is async; the client is plain synchronous requests, run in a thread (asyncio.to_thread) so a slow eBay call never blocks the event loop. ebay_price_check is the one tool that does more than pass through — it runs a search and then aggregates the result (see below).


Authentication: client-credentials, cached

eBay's Browse API uses an application token (the OAuth client-credentials grant) — no user is involved. The client mints one on first use, caches it in memory, and silently refreshes when it's about to expire. You never think about it.

sequenceDiagram
    participant T as Tool call
    participant C as EbayBrowseClient
    participant O as eBay OAuth
    participant B as Browse API

    T->>C: search("RTX 5080")
    alt token missing or expired
        C->>O: POST /identity/v1/oauth2/token<br/>Basic(app_id:cert_id), grant=client_credentials
        O-->>C: access_token + expires_in
        Note over C: cache until (expires_in − 60s)
    end
    C->>B: GET /item_summary/search<br/>Authorization: Bearer …
    B-->>C: listings JSON
    C-->>T: parsed results

The 60-second buffer means a token is treated as expired slightly early, so a call never races a token that dies mid-flight. Tokens live ~2 hours; in practice one fetch covers a long session.


ebay_price_check: how the landscape is built

The other two tools are thin wrappers. This one is the reason the project exists: it turns a pile of raw listings into a number you can reason about.

flowchart LR
    Q["query<br/>+ exclude[]"] --> S["search<br/>(up to 50 listings)"]
    S --> F["drop excluded titles<br/>+ unpriced listings"]
    F --> G["group by condition"]
    G --> A["aggregate<br/>min · median · max"]
    G --> H["cheapest N<br/>(the tail)"]
    A --> R(["{ count, min, median, max,<br/>by_condition, cheapest }"])
    H --> R

exclude is what makes the number honest — a search for "RTX 5080" is full of laptops and prebuilt PCs, and exclude: ["laptop", "notebook", "prebuilt"] strips them so the median reflects the actual card. The by_condition split matters just as much: a "median" that blends new-in-box with used-and-abused is noise; split by condition and each tier tells the truth.

One honest limitation worth knowing: the Browse API returns active asking prices, not completed sales. Treat the floor as "best currently advertised," not "what it sold for."


Install

git clone https://github.com/cunicopia-dev/ebay-mcp
cd ebay-mcp
python3.12 -m venv .venv && source .venv/bin/activate
pip install -e .

You need a (free) eBay developer application keyset — see docs/SETUP.md for the five-minute walkthrough. Then wire it into your MCP client:

{
  "mcpServers": {
    "ebay": { "command": "/path/to/ebay-mcp/.venv/bin/ebay-mcp" }
  }
}

Configuration

Credentials come from environment variables (highest priority) or a ~/.ebay-mcp.toml file. The active env selects the keyset and the API base URL together — so production creds can never accidentally point at the sandbox, or vice versa.

flowchart TD
    Start(["load_config()"]) --> Env{"EBAY_ENV /<br/>EBAY_*_APP_ID<br/>in environment?"}
    Env -->|"set"| UseEnv["take keyset<br/>from env vars"]
    Env -->|"unset"| Toml{"~/.ebay-mcp.toml<br/>present?"}
    Toml -->|"yes"| UseToml["take keyset<br/>from TOML"]
    Toml -->|"no"| Default["default env = production<br/>(error if creds missing)"]
    UseEnv --> Pick["env → keyset + base URL<br/>(locked together)"]
    UseToml --> Pick
    Default --> Pick
# ~/.ebay-mcp.toml   (chmod 600)
env = "production"

[production]
app_id  = "YourApp-PRD-..."
cert_id = "PRD-..."

[sandbox]
app_id  = "YourApp-SBX-..."
cert_id = "SBX-..."

Check what's active any time — credentials are masked in the output:

ebay-mcp-config
# env:      production
# app_id:   Keit****87dd
# cert_id:  PRD-****0914
# api_base: https://api.ebay.com
# OK — configuration is valid.

Sandbox vs. production

Flip env between sandbox and production to switch environments — same code, different endpoints and keyset. The sandbox is good for proving the auth flow wires up; its inventory is sparse and seeded, so for real prices you want a production keyset.


Project layout

src/ebay_mcp/
  config.py    # env + TOML loader; ebay-mcp-config CLI
  browse.py    # EbayBrowseClient — OAuth cache + search / get_item
  server.py    # MCP server: list_tools / call_tool / main
tests/         # config precedence, aggregation, tool listing (no network)
docs/SETUP.md  # getting an eBay keyset

License

MIT

Available Tools

3 tools
ebay_get_itemA

Fetch full details for a single eBay item by its item ID (e.g. v1|123456789|0).

ParametersJSON Schema
NameRequiredDescriptionDefault
item_idYeseBay item ID.
marketplaceNoeBay marketplace ID (default EBAY_US).EBAY_US

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must convey behavior. It states 'full details' but does not clarify if the tool is read-only, requires authentication, or has rate limits. The description adds some context (example ID format) but lacks crucial behavioral disclosures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, well-structured sentence with no redundant information. Every word earns its place, providing clear and concise purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description should compensate by explaining what 'full details' includes. It does not, leaving the agent uncertain about the return structure. Adequate for a simple fetch but incomplete for comprehensive understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents both parameters. The description adds value by providing a concrete example of the item_id format ('v1|123456789|0'), which aids correct invocation. No additional value for marketplace beyond the default mention.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches full details for a single eBay item by ID, using the verb 'Fetch' and specifying the resource. It distinguishes itself from siblings like ebay_search (which returns multiple items) and ebay_price_check (likely price-focused).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., ebay_search or ebay_price_check). It implies usage when you have a known item ID, but does not provide exclusions or context for sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ebay_price_checkA

Search eBay and return an aggregated price landscape: count, min/median/max overall and broken down by condition, plus the cheapest listings. The headline tool for price research.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch terms, e.g. 'RTX 5080'.
limitNoListings to sample (default 50, max 50).
excludeNoSubstrings to filter out of results (case-insensitive). E.g. ['laptop', 'notebook'] to strip bundles.
marketplaceNoeBay marketplace ID (default EBAY_US).EBAY_US

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears the full burden of behavioral disclosure. It describes the output (aggregated statistics and cheapest listings) but does not mention any side effects, permissions, rate limits, or limitations beyond what's in the parameter schema (e.g., max 50 listings already included). It adds some value but lacks completeness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, direct and front-loaded. It conveys essential information without unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the moderate complexity (4 parameters, no output schema, no annotations), the description provides good contextual understanding of the output. It could benefit from mentioning behavior on empty results or error conditions, but it is largely sufficient for an AI agent to decide when to invoke.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are already well-documented. The description does not add significant new meaning beyond the schema; it focuses on the output rather than parameter details. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Search eBay and return aggregated price landscape') and specifies output details (count, min/median/max, breakdown by condition, cheapest listings). It explicitly distinguishes itself from siblings by calling itself 'the headline tool for price research.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for price research but does not provide explicit when-to-use or when-not-to-use guidance. It references siblings ebay_get_item and ebay_search, but doesn't explain when to choose this tool over them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedebay_get_item
    • First observedebay_price_check
    • First observedebay_search

TDQS

A3.8/5.0
Disambiguation5/5

Each tool targets a distinct purpose: ebay_get_item retrieves single item details, ebay_price_check aggregates price data, and ebay_search returns listings. No functional overlap.

Naming Consistency5/5

All tools follow the 'ebay_verb' pattern (ebay_get_item, ebay_price_check, ebay_search), with consistent snake_case and clear verb-noun structure.

Tool Count5/5

Three tools is a compact but sufficient set for eBay price research and item lookup. Each tool adds unique value without redundancy.

Completeness4/5

The tools cover core research needs (search, price check, item details) but lack account management or listing operations. Minor gap for seller feedback or category browsing, but not fatal.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search eBay listings, track item prices over time, and identify deals below market value using eBay's APIs. It provides tools for category browsing and retrieving detailed information for specific listings.
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to search products, view item details, track and place bids, make Buy It Now purchases, view order history, and track shipments on eBay via browser automation with Playwright.
    7
    16
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    AI-powered selling intelligence for multiple online marketplaces, enabling item analysis, optimized listings, pricing checks, negotiation coaching, and batch operations via any MCP-compatible AI assistant.
    -

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/cunicopia-dev/ebay-mcp'

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