MCP server for Sam's Club Sponsored Ads APIs
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
MCP server for Sam's Club Sponsored Ads APIs.
Exposes spec-driven discovery (list_endpoints, describe_endpoint), a generic API proxy (call_endpoint), and a runtime spec refresher (refresh_specs). The AI agent discovers endpoints from a bundled OpenAPI spec then calls them; the server handles RSA-SHA256 signing and auth headers automatically.
Forked from mcp-walmart-ads: Sam's Club runs on the same Walmart api-proxy backend and uses the same WM_* signing headers, so the auth, HTTP client, discovery, caching, and tool surface carry over. The differences are a single sponsored ad family (vs Walmart's search/display), the Sam's Club base URLs, and a hand-authored OpenAPI spec.
Set up your config (see Configuration), then run the server:
The server speaks MCP over stdio.
The config file lives under your home directory at ~/.config/mcp-samsclub-ads/config.json.
Windows note:
~maps to%USERPROFILE%(typicallyC:\Users\<you>), so the full path is%USERPROFILE%\.config\mcp-samsclub-ads\config.json.
1. Create the config directory and copy the example
2. Edit ~/.config/mcp-samsclub-ads/config.json
3. Place your RSA private key PEM files in ~/.config/mcp-samsclub-ads/keys/
Key paths in the config are resolved relative to the config directory, so ./keys/us/prod.pem resolves to ~/.config/mcp-samsclub-ads/keys/us/prod.pem.
| Config field | Description |
|---|---|
response_cache_ttl | Seconds to keep truncated responses in memory (default 3600) |
truncate_threshold | Response byte limit before truncation (default 51200) |
regions.<R>.<E>.consumer_id | Your Sam's Club consumer ID |
regions.<R>.<E>.private_key | Path to RSA private key PEM (relative to config dir or absolute) |
regions.<R>.<E>.private_key_version | Key version string (default "1") |
regions.<R>.<E>.bearer_token | OAuth bearer token |
regions.<R>.<E>.base_urls.sponsored | Sponsored Ads API base URL |
Each request is signed with WM_CONSUMER.ID, WM_SEC.AUTH_SIGNATURE (Base64 RSA-SHA256), WM_SEC.KEY_VERSION, and WM_CONSUMER.INTIMESTAMP (Unix epoch ms), plus Authorization: Bearer <token> β all injected automatically by the client.
https://developer.api.us.walmart.com/api-proxy/service/sp/api-sams/v1https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1Paths in the spec begin /api/v1/... (or /api/v2/...), so the effective URL is <base_url>/api/v1/<resource>.
list_endpointsList operations from the bundled OpenAPI spec for an ad_type, with optional filters.
| Parameter | Required | Description |
|---|---|---|
ad_type | yes | sponsored |
query | no | Case-insensitive substring match on operationId, path, or summary |
tag | no | Filter to operations whose OpenAPI tags include this value |
method | no | Filter by HTTP verb |
describe_endpointReturn one operation plus the components.schemas reachable from it (its $ref closure), so request bodies and responses can be built without the full spec.
| Parameter | Required | Description |
|---|---|---|
ad_type | yes | sponsored |
operation_id | yes | Spec operation id (from list_endpoints) |
call_endpointExecute any Sam's Club Sponsored Ads API endpoint. Identify it by operation_id, or by raw method + path. Raw method+path also reaches endpoints not yet in the bundled spec. The server handles RSA-SHA256 signing.
| Parameter | Required | Description |
|---|---|---|
region | yes | e.g. US |
env | yes | production or sandbox |
ad_type | yes | sponsored |
operation_id | no* | Spec operation id; resolves method+path |
method | no* | GET, POST, PUT, PATCH, or DELETE |
path | no* | e.g. /api/v1/campaigns |
params | no | Query string parameters (JSON object) |
body | no | JSON request body for POST/PUT (object or array) |
* Provide either operation_id, or both method and path.
refresh_specsRe-fetch the bundled OpenAPI spec from its committed source_url into a user cache (~/.cache/mcp-samsclub-ads/specs/) that takes precedence over the bundled copy β ship fixes without a release.
| Parameter | Required | Description |
|---|---|---|
spec_id | no | One spec to refresh (e.g. sponsored/sponsored-ads); omit to refresh all |
Endpoint schemas come from the bundled OpenAPI spec via list_endpoints / describe_endpoint (see Tools), not from static resources.
| Resource URI | Description |
|---|---|
sca://config | Available regions, environments, and ad types from your config |
sca://responses/{request_id} | Full body of a truncated API response (cached in memory, TTL from config) |
sca://curl/{request_id} | Reproducible cURL command for a previous API request |
The bundled OpenAPI spec is hand-authored from the
developer.samsclub.com docs and is partial by
design. It covers the core ads surface: Campaigns, Statistics, Ad Groups, Ad Items, Catalog
Item Search, Keywords (+ suggestions/analytics), Negative Keywords, Placements, Bid
Multipliers, and Snapshot Reports v1/v2 + Latest Report Date. Endpoints not yet modeled (SBA
profiles, media, reviews, api-usage, entity/audit snapshots, alerts & recommendations) are
still reachable via call_endpoint with a raw method+path.
Partner credentials are the long pole. Access requires emailing an RSA public key to
partner-support@samsclub.com and receiving a consumer id + auth token + key version.
Without sandbox credentials the server runs and its discovery/signing are verified offline,
but calls cannot be exercised end-to-end.
scripts/build_spec.py scrapes the docs into a candidate spec at
spec-candidate/ β offline, never at runtime. The
Spec drift workflow runs it on a schedule and opens a
PR when the docs change; a reviewer then ports real changes into the hand-authored canonical
spec. The candidate is intentionally flat and is never shipped or loaded.
Still deferred: flipping a spec's auth flag to fetch the authenticated live Swagger backend
once partner credentials exist.
Add to .cursor/mcp.json:
Add to your Claude Code MCP config:
mcp-walmart-adsOpen issues or PRs. Follow existing style and add tests where appropriate.
MIT. See LICENSE.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sam-s-club-sponsored-ads-apis)<a href="https://allmcps.com/mcp/sam-s-club-sponsored-ads-apis"><img src="https://allmcps.com/api/badge/sam-s-club-sponsored-ads-apis?style=directory" alt="Sam's Club Sponsored Ads APIs on AllMCPs" /></a>