MCP server for Walmart Connect Ads APIs (Sponsored Search + Display)
Project description
Walmart Connect Advertising APIs
MCP server for Walmart Connect Ads APIs — Sponsored Search and Display.
Exposes a single generic tool (walmart_ads_api) that acts as an authenticated proxy: the AI agent decides which endpoint to call, the server handles RSA-SHA256 signing and auth headers automatically.
Features
- One tool, any endpoint — no code changes needed when APIs evolve
- Supports both Sponsored Search and Display API families
- Multi-region, multi-environment (production + staging) via config file
- Per-request RSA-SHA256 signing with automatic header construction
- Large responses truncated with full data available via MCP resource URI
- Bundled API reference docs served as MCP resources so the agent knows endpoint schemas
Requirements
- Python 3.13+
- Walmart Connect Partner Network credentials (consumer ID, RSA key pair, bearer token)
Quick start
Set up your config (see Configuration), then run the server:
# Run directly with uvx (no clone needed)
npx -y @modelcontextprotocol/inspector uvx mcp-walmart-ads
# Or run from source
git clone https://github.com/alyiox/mcp-walmart-ads.git
cd mcp-walmart-ads
uv sync
npx -y @modelcontextprotocol/inspector uv run mcp-walmart-ads
Configuration
1. Create the config directory and copy the example
mkdir -p ~/.config/mcp-walmart-ads/keys
cp config.example.json ~/.config/mcp-walmart-ads/config.json
2. Edit ~/.config/mcp-walmart-ads/config.json
{
"response_cache_ttl": 3600,
"truncate_threshold": 51200,
"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": {
"search": "https://developer.api.walmart.com/api-proxy/service/WPA/Api/v1",
"display": "https://developer.api.walmart.com/api-proxy/service/display/api/v1"
}
},
"staging": {
"consumer_id": "your-staging-consumer-id",
"private_key": "./keys/us-staging.pem",
"private_key_version": "1",
"bearer_token": "your-staging-bearer-token",
"base_urls": {
"search": "https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1",
"display": "https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1"
}
}
}
}
}
3. Place your RSA private key PEM files in ~/.config/mcp-walmart-ads/keys/
Key paths in the config are resolved relative to the config directory, so ./keys/us-prod.pem resolves to ~/.config/mcp-walmart-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 Walmart Connect 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.search |
Sponsored Search API base URL |
regions.<R>.<E>.base_urls.display |
Display API base URL |
Tool: walmart_ads_api
Parameters shown in the client UI for user approval before execution:
| Parameter | Required | Description |
|---|---|---|
region |
yes | e.g. US |
env |
yes | production or staging |
ad_type |
yes | search or display |
method |
yes | GET, POST, PUT, DELETE |
path |
yes | e.g. /api/v1/campaigns |
params |
no | Query string parameters (JSON object) |
body |
no | JSON request body (for POST/PUT) |
API reference docs (MCP resources)
The server bundles API reference docs the agent can read to learn endpoint schemas:
| Resource URI | Description |
|---|---|
wmc://docs/search/campaigns |
Sponsored Search campaigns |
wmc://docs/search/ad-groups |
Sponsored Search ad groups |
wmc://docs/search/keywords |
Sponsored Search keywords |
wmc://docs/search/snapshot-reports |
Sponsored Search snapshot reports |
wmc://docs/display/campaigns |
Display campaigns |
wmc://docs/display/snapshot-reports |
Display snapshot reports |
Truncated API responses are cached in memory and accessible via wmc://responses/{request_id}.
MCP host examples
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"walmart-ads": {
"command": "uvx",
"args": ["mcp-walmart-ads"]
}
}
}
Claude Code
Add to your Claude Code MCP config:
{
"mcpServers": {
"walmart-ads": {
"command": "uvx",
"args": ["mcp-walmart-ads"]
}
}
}
Codex
[mcp_servers.walmart-ads]
command = "uvx"
args = ["mcp-walmart-ads"]
OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"walmart-ads": {
"type": "local",
"enabled": true,
"command": ["uvx", "mcp-walmart-ads"]
}
}
}
GitHub Copilot
{
"inputs": [],
"servers": {
"walmart-ads": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-walmart-ads"]
}
}
}
Development
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
Contributing
Open issues or PRs. Follow existing style and add tests where appropriate.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_walmart_ads-0.1.0a4.tar.gz.
File metadata
- Download URL: mcp_walmart_ads-0.1.0a4.tar.gz
- Upload date:
- Size: 53.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
423ebd74e5bc7029e52c66fe29b470891d1aa3770b73602a26d5895b9888b6a7
|
|
| MD5 |
f4a557a31be726a4fb4ccdf393369b97
|
|
| BLAKE2b-256 |
d7d063fe865cd20ff80066e4c9e0bbce5aec2ba567dcbc4b9564516e905cd601
|
Provenance
The following attestation bundles were made for mcp_walmart_ads-0.1.0a4.tar.gz:
Publisher:
ci.yml on alyiox/mcp-walmart-ads
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_walmart_ads-0.1.0a4.tar.gz -
Subject digest:
423ebd74e5bc7029e52c66fe29b470891d1aa3770b73602a26d5895b9888b6a7 - Sigstore transparency entry: 1270808233
- Sigstore integration time:
-
Permalink:
alyiox/mcp-walmart-ads@d625e90bae8bd5fdc7f25e1206dbd1ac33aecd90 -
Branch / Tag:
refs/tags/0.1.0a4 - Owner: https://github.com/alyiox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@d625e90bae8bd5fdc7f25e1206dbd1ac33aecd90 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_walmart_ads-0.1.0a4-py3-none-any.whl.
File metadata
- Download URL: mcp_walmart_ads-0.1.0a4-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17a21bd5dc450f14ff7644683fb36caf152daba804c4e7ebe092d68074ed3f4b
|
|
| MD5 |
3420a8c14b49071b561bc521d9c2329e
|
|
| BLAKE2b-256 |
d9ac45ba3fdd4e9142a2cafa63cd6a13b1f40e4ab6a5ee0949a14fac64ae01cd
|
Provenance
The following attestation bundles were made for mcp_walmart_ads-0.1.0a4-py3-none-any.whl:
Publisher:
ci.yml on alyiox/mcp-walmart-ads
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_walmart_ads-0.1.0a4-py3-none-any.whl -
Subject digest:
17a21bd5dc450f14ff7644683fb36caf152daba804c4e7ebe092d68074ed3f4b - Sigstore transparency entry: 1270808240
- Sigstore integration time:
-
Permalink:
alyiox/mcp-walmart-ads@d625e90bae8bd5fdc7f25e1206dbd1ac33aecd90 -
Branch / Tag:
refs/tags/0.1.0a4 - Owner: https://github.com/alyiox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@d625e90bae8bd5fdc7f25e1206dbd1ac33aecd90 -
Trigger Event:
push
-
Statement type: