mcp-samsclub-ads
About
MCP server for Sam's Club Sponsored Ads APIs — spec-driven endpoint discovery and a generic authenticated proxy with automatic RSA-SHA256 request signing.
Details
- Author
- alyiox
- Categories
- Productivity
Jump to
Setup
Install mcp-samsclub-ads in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/alyiox/mcp-samsclub-ads
Follow the installation instructions in the repository README, then restart your MCP client.
MCP server forSam'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.
- Spec-driven discovery— list/describe endpoints from a bundled OpenAPI spec, refreshable at runtime
- Any endpoint— call by operation id or raw method+path (raw path reaches endpoints not yet in the spec); no code changes when APIs evolve
- Multi-region, multi-environment (production + sandbox) via config file
- Per-request RSA-SHA256 signing with automatic header construction
- Large responses truncated with full data available via MCP resource URI
- Python 3.13+
- Sam's Club Partner credentials (consumer ID, RSA key pair, bearer token) — seeStatus & blocker
Set up your config (seeConfiguration), then run the server:
# Run directly with uvx (no clone needed) npx -y @modelcontextprotocol/inspector uvx mcp-samsclub-ads
# Or run from source git clone https://github.com/alyiox/mcp-samsclub-ads.git cd mcp-samsclub-ads uv sync npx -y @modelcontextprotocol/inspector uv run mcp-samsclub-ads
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
# Unix-like (macOS, Linux, WSL, …) mkdir -p ~/.config/mcp-samsclub-ads/keys/us cp config.example.json ~/.config/mcp-samsclub-ads/config.json
# Windows (PowerShell) New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\mcp-samsclub-ads\keys\us" Copy-Item config.example.json "$env:USERPROFILE\.config\mcp-samsclub-ads\config.json"
2. Edit~/.config/mcp-samsclub-ads/config.json
{ "response_cache_ttl": 3600, "truncate_threshold": 1024, "regions": { "US": { "production": { "consumer_id": "your-consumer-id", "private_key": "./keys/us/prod.pem", "private_key_version": "1", "bearer_token": "your-bearer-token", "base_urls": { "sponsored": "https://developer.api.us.walmart.com/api-proxy/service/sp/api-sams/v1" } }, "sandbox": { "consumer_id": "your-sandbox-consumer-id", "private_key": "./keys/us/sandbox.pem", "private_key_version": "1", "bearer_token": "your-sandbox-bearer-token", "base_urls": { "sponsored": "https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1" } } } } }
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.pemresolves to~/.config/mcp-samsclub-ads/keys/us/prod.pem.
Each request is signed withWM_CONSUMER.ID,WM_SEC.AUTH_SIGNATURE(Base64 RSA-SHA256),WM_SEC.KEY_VERSION, andWM_CONSUMER.INTIMESTAMP(Unix epoch ms), plusAuthorization: Bearer <token>— all injected automatically by the client.
- Production:https://developer.api.us.walmart.com/api-proxy/service/sp/api-sams/v1
- Sandbox:https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1
Paths in the spec begin/api/v1/...(or/api/v2/...), so the effective URL is<base_url>/api/v1/<resource>.
List operations from the bundled OpenAPI spec for anad_type, with optional filters.
Return one operation plus thecomponents.schemasreachable from it (its$refclosure), so request bodies and responses can be built without the full spec.
Execute any Sam's Club Sponsored Ads API endpoint. Identify it byoperation_id, or by rawmethod+path. Raw method+path also reaches endpoints not yet in the bundled spec. The server handles RSA-SHA256 signing.
Provide eitheroperation_id, or bothmethodandpath.
Re-fetch the bundled OpenAPI spec from its committedsource_urlinto a user cache (~/.cache/mcp-samsclub-ads/specs/) that takes precedence over the bundled copy — ship fixes without a release.
Endpoint schemas come from the bundled OpenAPI spec vialist_endpoints/describe_endpoint(seeTools), not from static resources.
The bundled OpenAPI spec ishand-authored from thedeveloper.samsclub.comdocs 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 viacall_endpointwith a rawmethod+path.
Partner credentials are the long pole.Access requires emailing an RSA public key topartner-support@samsclub.comand 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.pyscrapes the docs into acandidatespec atspec-candidate/— offline, never at runtime. TheSpec driftworkflow 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.
uv run --group spec-build python scripts/build_spec.py # write candidate uv run --group spec-build python scripts/build_spec.py --check # exit 1 on drift
Still deferred: flipping a spec'sauthflag to fetch the authenticated live Swagger backend once partner credentials exist.
{ "mcpServers": { "samsclub-ads": { "command": "uvx", "args": ["mcp-samsclub-ads"] } } }
{ "mcpServers": { "samsclub-ads": { "command": "uvx", "args": ["mcp-samsclub-ads"] } } }
[mcp_servers.samsclub-ads] command = "uvx" args = ["mcp-samsclub-ads"]
{ "$schema": "https://opencode.ai/config.json", "mcp": { "samsclub-ads": { "type": "local", "enabled": true, "command": ["uvx", "mcp-samsclub-ads"] } } }
{ "inputs": [], "servers": { "samsclub-ads": { "type": "stdio", "command": "uvx", "args": ["mcp-samsclub-ads"] } } }
uv sync --group dev # install deps uv run pytest # run tests uv run ruff check . # lint uv run ruff format . # format uv run pyright # type check
- API docs:https://developer.samsclub.com/API/overview/
- Authentication:https://developer.samsclub.com/API/authentication/
- Base project:mcp-walmart-ads
Open issues or PRs. Follow existing style and add tests where appropriate.
The 1Password MCP server creates a bridge that allows MCP clients such as Codex and Kiro to manage your 1Password Environments with secure authorization prompts.
This is the 1st, easiest, and cheapest PPT, slides, presentation AI generation MCP Server in the world.
Persistent memory for any AI assistant. Zero token cost until recall. Stores memories in local SQLite, ranks by 6-factor scoring, returns results 79% smaller than JSON. Works with Claude, ChatGPT, Grok, Cursor, Windsurf, and any MCP client.
A MCP server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.
Enables LLM clients to interact with macOS applications through AppleScript. Built using the @beyondbetter/bb-mcp-server library, this server provides safe, controlled execution of predefined scripts with optional support for arbitrary script execution.
An MCP server for WordPress plugin audits
Turn your AI assistant into a digital marketing hub that creates, organizes, and analyzes links and QR Codes on demand.
Connect AI clients to Cal.com scheduling through the Model Context Protocol using the hosted server at mcp.cal.com or a local instance.
Sync Calendars, Scheduling Links, AI Executive Scheduling Assistant, Unified Calendar
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



