Walmart & Sam's Club APIs

io.github.alyiox由 GitHub 帳號 alyiox 發布v0.5.1更新於 Oct 24, 2026

MCP server for Walmart Connect Ads, Sam's Club Sponsored Ads, and Walmart Marketplace APIs

已驗證STDIO僅桌面開發者工具商業與電商

概覽

AI 產生的概覽

讓助理探索並呼叫 Walmart Connect、Sam's Club 與 Walmart Marketplace 廣告及賣家 API 的 MCP 伺服器,認證由伺服器端處理。

可以做什麼
  • 依關鍵字、API、平台、標籤或 HTTP 方法篩選並列出 31 份內建 Walmart API 規格中的操作
  • 檢視單一操作及其可達的請求結構,並自動省略伺服器管理的認證標頭
  • 在已設定的平台上執行帶認證的呼叫,支援原始 method 與 path 路由以及 multipart 檔案上傳
  • 下載報表、標籤與快照到指定路徑或快取資源
  • 讀取已載入平台、其 API、主機、廣告主、完整截斷回應與可重現 cURL 等資源
適用情境
適合需要讓助理處理 Walmart 廣告或賣家資料(贊助商品、展示廣告、訂單、商品、資料饋送、報表)的情境,以單一工具介面取代自行撰寫的 API 用戶端。
執行需求
本機 Python 3.13+ 程序,通常以 uvx 執行。需在 ~/.config/mcp-walmart-ads/config.json(可選 config.d 分檔)設定憑證:Walmart Connect 與 Sam's Club 需 consumer ID、RSA 私鑰路徑、金鑰版本與 bearer token;Marketplace 需 client ID、secret 與廣告主 ID。無憑證時仍可探索端點。
安裝前請注意
設定檔保存長期有效的機密:RSA 私鑰、bearer token 與 OAuth client secret,需限制檔案權限。呼叫會寫入 Walmart 系統,資料饋送上傳、資料更新等 POST/PUT/PATCH/DELETE 操作可能改動線上廣告與賣家資料。download_file 會寫入指定的目標路徑。憑證會傳送至 Walmart 主機;跨主機重新導向時會捨棄認證標頭。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Walmart & Sam's Club APIs,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Walmart & Sam's Club APIs

[CI] [PyPI] [Python 3.13+] [License: MIT]

MCP server for three Walmart Inc. API families, behind one tool surface:

PlatformAPIsAuth
walmart:ads — Walmart ConnectSponsored Products, DisplayRSA-SHA256 signature + bearer token
walmart:marketplace — Walmart Marketplace28 domains (orders, items, feeds, reports, …)OAuth2 client_credentials
samsclub:ads — Sam's ClubSponsored ProductsRSA-SHA256 signature + bearer token

Four tools over 31 apis and 424 operations — discovery, a generic proxy, and a downloader. An agent finds endpoints in the bundled OpenAPI specs and calls them; the server signs, acquires tokens, and builds headers.

walmart:ads:sponsored-products:SBAProfileUpdateV2└─ retailer ─┘└ line ┘└─── api name ───┘└── operationId ──┘   └────────── platform ─────────┘  credentials attach here

An operation id alone resolves to a host and an auth model. A matching <line>:<name> suffix means the same surface for another retailer — 13 shared operation ids of 90.

Requirements

  • Python 3.13+
  • Credentials for whichever platforms you use. Configure only those — an absent platform is simply unconfigured, and discovery works with no credentials at all.
    • Walmart Connect / Sam's Club — consumer ID, RSA key pair, bearer token
    • Walmart Marketplace — client ID + secret, and the advertiser (seller profile) ids they serve

Quick start

Set up your config (see Configuration), then run the server:

bash
# Run directly with uvx (no clone needed)npx -y @modelcontextprotocol/inspector@latest uvx mcp-walmart-ads
bash
# Or run from sourcegit clone https://github.com/alyiox/mcp-walmart-ads.gitcd mcp-walmart-adsuv syncnpx -y @modelcontextprotocol/inspector@latest uv run mcp-walmart-ads

Configuration

config.json MUST live at ~/.config/mcp-walmart-ads/config.json. The server reads it once at startup, so a corrected file REQUIRES a restart.

Windows: ~ maps to %USERPROFILE% (typically C:\Users\<you>), making the full path %USERPROFILE%\.config\mcp-walmart-ads\config.json.

Create the directory and copy the example:

bash
# Unix-like (macOS, Linux, WSL, …)mkdir -p ~/.config/mcp-walmart-ads/keys/walmart-adscp config.example.json ~/.config/mcp-walmart-ads/config.json
powershell
# Windows (PowerShell)New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\mcp-walmart-ads\keys\walmart-ads"Copy-Item config.example.json "$env:USERPROFILE\.config\mcp-walmart-ads\config.json"

Shape

platforms.<platform>.regions.<region>.<environment> = <auth block>

<platform> is the two-segment prefix an api id starts with, so a config key is literally the value you pass as the platform tool parameter — nothing to translate.

The auth block's shape follows the platform's auth model. There is exactly one shape per platform, so no discriminator field is needed.

Signature platforms (walmart:ads, samsclub:ads):

json
{  "platforms": {    "walmart:ads": {      "regions": {        "us": {          "production": {            "consumer_id": "your-consumer-id",            "private_key": "./keys/walmart-ads/us-prod.pem",            "private_key_version": "1",            "bearer_token": "your-bearer-token",            "base_urls": {              "sponsored-products": "https://developer.api.walmart.com/api-proxy/service/WPA/Api/v1",              "display": "https://developer.api.walmart.com/api-proxy/service/display/api/v1"            }          }        }      }    }  }}
FieldNotes
consumer_idPartner Network consumer ID
private_keyPath to the RSA private key (PEM). Relative paths resolve against the config directory
private_key_versionKey version string (default "1")
bearer_tokenOAuth bearer token
base_urls.<api>One per api in the platform's discovery surface. Keys MAY be bare (sponsored-products) or fully qualified (walmart:ads:sponsored-products); extra keys are allowed for the auxiliary specs reached by raw method+path

Environment names are free-form here — Walmart may issue a tenant only production, or production and staging.

OAuth2 platform (walmart:marketplace):

json
{  "platforms": {    "walmart:marketplace": {      "regions": {        "us": {          "production": {            "credentials": [              {                "client_id": "your-client-id",                "client_secret": "your-client-secret",                "advertisers": [                  { "id": 7060158, "partner_id": "10001234" },                  { "id": 7060159 }                ]              }            ]          }        }      }    }  }}

environment MUST be production or sandbox; base URLs are fixed by the server and absent from the file. Advertiser ids nest under the credential that serves them, so a secret appears exactly once and a dangling advertiser reference is structurally impossible. partner_id is per-seller because two payments operations require it as WM_PARTNER_ID; an all-zero value reads as absent, since that is what a generated config writes for a seller without one, and scripts/backfill_partner_ids.py fills the gaps from Walmart.

Regions are a namespace, not a route — every walmart:marketplace region reaches the same hosts. The level exists because advertiser ids are unique only within a region.

Splitting the config

A populated walmart:marketplace block runs to tens of kilobytes of credentials, 88% of the file here, and a stray comma while editing it takes down every platform: a parse failure precedes per-platform validation. Platforms MAY therefore live in drop-in files under config.d/, merged over the base:

~/.config/mcp-walmart-ads/├── config.json                  # server-wide settings, and any platforms you like├── config.d/│   ├── walmart-marketplace.json # only a "platforms" object│   └── samsclub-ads.json└── keys/
  • A drop-in MUST declare only platforms; server-wide settings stay in config.json.
  • A platform declared in two files is an error naming both — never silent precedence.
  • Only *.json directly in config.d/ is read, so .bak and editor swap files are ignored.
  • A file that fails to parse costs only its own platforms; the rest keep working.
  • Relative private_key paths resolve against config.json's directory either way, so moving a platform into config.d/ needs no path edits.
  • No config.d/ directory means no change in behavior.

A malformed block for one platform MUST NOT stop the others loading. Read wmt://platforms to see which loaded and what regions and environments they declare: one that failed has no regions, and reading one of its environments returns the loader's own message — which file, which fields, and that a fix needs a restart.

Top-level options

FieldDefaultNotes
response_cache_ttl3600Seconds a truncated body or download stays readable at its resource URI
truncate_threshold2048Response bytes returned inline before truncating to a preview
spec_refresh{"auto": true, "interval": 7}Background spec refresh. auto turns the sweep on or off; interval is days between sweeps, and MAY be fractional

Market → tenant (wap-tenant-id)

Pass tenant on call_endpoint and download_file for non-US walmart:ads markets (WMT_CA, WMT_MX, WBD_OD, …). Omit it for US and for walmart:marketplace.

Tools

list_endpoints

List operations across every api, with optional filters.

ParameterNotes
queryCase-insensitive substring on operation id, path, or summary
apiLimit to one api, e.g. walmart:marketplace:order-management
platformLimit to one platform — walmart:ads, walmart:marketplace, samsclub:ads (schema enum)
tagFilter by OpenAPI tag
methodFilter by HTTP verb — GET, POST, PUT, PATCH, DELETE (schema enum)

Returned operation ids are qualified (api:operationId) and pass straight to describe_endpoint or call_endpoint.

describe_endpoint

One operation plus every components.schemas entry reachable from it, so a request body can be built without the full spec. Server-managed auth and QoS headers are omitted.

ParameterNotes
operation_idQualified (api:operationId), or bare when unambiguous
apiApi to resolve a bare id in, e.g. walmart:ads:sponsored-products

call_endpoint

Execute an authenticated request against any configured platform. Signing, token acquisition with per-credential caching and single-flight refresh, and one retry after a 401 all happen server-side.

ParameterNotes
region, environmentRequired. Src: config
operation_idQualified or bare. Resolves api, platform, method, path, and required headers
apiRequired with raw method + path; otherwise inferred from operation_id. Accepts the two auxiliary walmart:ads specs
method, pathRaw route, reaching alpha/beta/unpublished endpoints absent from the specs
path_paramsValues for {placeholders} in the path
params, bodyQuery string and JSON body
file_pathSend the file as multipart/form-data — Marketplace feed uploads. Pair with the feedType query parameter
advertiser_idMUST be given on walmart:marketplace, where it selects the credential. Optional on the ads platforms, where it is sent as X-Advertiser-ID
tenantWAP tenant for non-US walmart:ads regions

A response larger than truncate_threshold is previewed inline, with the full body at wmt://responses/{request_id} and a reproducible cURL at wmt://curl/{request_id} — bearer tokens, access tokens, and signatures replaced with placeholders.

download_file

Download a report, label, or snapshot from an authenticated endpoint. Give a full url (the details URL from a display snapshot poll, say), or operation_id, or api with method + path. platform is required only for a bare url.

With dest_path the bytes are written there. Without it they are gunzipped when gzipped and cached, and the result carries cached_at — a binary payload with no dest_path asks for one instead. Redirects are followed, keeping auth headers on a relative or same-host Location and dropping credentials cross-host; the result includes urls, the hop path.

Specs

33 OpenAPI documents ship in the wheel. A refresh writes updated copies to ~/.cache/mcp-walmart-ads/specs/, which outranks the bundle on read. The bundle is never written at runtime, so it stays the floor a damaged or missing cache falls back to.

Where they come from

Walmart publishes no OpenAPI files, but each ReadMe reference page hydrates its HTML with the registry UUIDs of its documents, and https://dash.readme.com/api/v1/api-registry/<uuid> serves the full spec unauthenticated. That covers Walmart Connect and all 28 Marketplace domains. Sam's Club publishes neither, so its spec is hand-authored from the developer docs: scripts/build_samsclub_spec.py regenerates a candidate from those docs, and the scheduled spec drift workflow opens a PR when they change, as a human review gate. The candidate is never shipped and never loaded at runtime.

Documents are stored verbatim as upstream served them, so a refresh diff shows exactly what changed. Oversized inline examples and x-readme metadata are stripped on load rather than on disk, which keeps that reduction retunable without re-downloading anything.

Keeping them current

Specs refresh in the background: once at startup, then every spec_refresh.interval days (7 by default). Set auto to false to stop the sweep — the interval is remembered for whenever you turn it back on, and the manual refresh still works.

To refresh now, having hit an endpoint the bundled spec does not have:

bash
# Installed with uvx (no clone)uvx mcp-walmart-ads --refresh
# Or from a source checkoutuv run mcp-walmart-ads --refresh

Either form sweeps every spec regardless of the interval and writes the same user cache, printing one row per document: written, unchanged, or error.

There is deliberately no tool for this. A stale spec is indistinguishable from a current one from inside a session — it simply lacks an endpoint — so an agent asked to decide would either never refresh or refresh superstitiously after an unrelated failure. The trigger belongs outside the session.

A document MUST yield at least one operation before it is installed, so an upstream answering 200 with an error body cannot poison the cache, and a byte-identical document is left alone. A cached file that will not load is discarded and the read falls back to the bundle. Servers coordinate through spec-state.json at the cache root, which records when each spec was last tried and holds a lease so one process sweeps at a time — every client session runs its own server process, and without it each would re-download all 33.

Rebuilding the bundle

A maintainer step, and not the same thing as --refresh: that updates your cache, this updates the copies that ship in the wheel.

bash
# Registry-sourced specs only, by defaultuv run python scripts/fetch_specs.pyuv run python scripts/fetch_specs.py walmart:ads:sponsored-products walmart:marketplace:order-management
# Regenerate the Sam's Club candidate spec for reviewuv run --group spec-build python scripts/build_samsclub_spec.py

MCP resources

Resource URIDescription
wmt://platformsEvery platform, its auth model, and the regions and environments it declares
wmt://platforms/{platform}/apisThat platform's api ids
wmt://platforms/{platform}/apis/{name}One api: title, version, operation count, and its tags with a count each — the legal list_endpoints(tag=…) values
wmt://platforms/walmart:marketplace/regions/{region}/{environment}/advertisersAdvertiser ids mapped to their Walmart Partner ID (null when unset)
wmt://platforms/{platform}/regions/{region}/{environment}/hostsApi ids mapped to the base URL a call reaches, or * for every api whose host the server owns
wmt://responses/{request_id}Full body of a truncated response or a cached download (in memory, TTL from config)
wmt://curl/{request_id}Reproducible cURL for a previous request, credentials replaced with placeholders

MCP host examples

Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "walmart": {      "command": "uvx",      "args": ["mcp-walmart-ads"]    }  }}
Claude Code

Add to your Claude Code MCP config:

json
{  "mcpServers": {    "walmart": {      "command": "uvx",      "args": ["mcp-walmart-ads"]    }  }}
Codex
toml
[mcp_servers.walmart]command = "uvx"args = ["mcp-walmart-ads"]
OpenCode
json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "walmart": {      "type": "local",      "enabled": true,      "command": ["uvx", "mcp-walmart-ads"]    }  }}
GitHub Copilot
json
{  "inputs": [],  "servers": {    "walmart": {      "type": "stdio",      "command": "uvx",      "args": ["mcp-walmart-ads"]    }  }}

Development

bash
uv sync --group devuv run ruff check src/ tests/ scripts/uv run ruff format --check src/ tests/ scripts/uv run pyrightuv run pytest tests/ -v

Contributing

Issues and pull requests are welcome. Keep changes focused; ruff check, ruff format --check, pyright, and pytest MUST all pass.

License

LICENSE.

來源:README.md,提交 609b2b4

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.5.1最新Sep 30, 2026
  2. v0.5.0Sep 18, 2026
  3. v0.4.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分