VetoVetoDocs
Guides

Set up Veto with your coding agent (MCP)

Hand the whole hosted setup to your coding agent. The @veto-protocol/mcp-merchant MCP server gives Claude Code, Cursor, or any MCP client the tools to create a merchant, add products, set receiving, and publish — you just describe your shop in plain English.

You don't have to run the curls yourself. The @veto-protocol/mcp-merchant MCP server gives your coding agent — Claude Code, Cursor, Continue, anything that speaks MCP — a set of tools that drive the hosted control plane at https://merchants.veto-ai.com. You describe your store in plain English; the agent creates the merchant, adds your catalog, sets your receiving address, and publishes — calling the exact same endpoints from the end-to-end setup guide.

This is the merchant-setup MCP server — it provisions your storefront. It's distinct from the buyer-side checkout MCP (@veto-protocol/mcp, the checkout_* tools that transact against a merchant) and from the buyer-governance Veto MCP (veto_authorize, veto_policy_*) that gates an agent's spend. Here, the agent is your back-office operator.

1. Get a key

In Dashboard → Developers at https://merchants.veto-ai.com, mint an API key. Start with a veto_test_ key so your agent provisions a sandbox merchant first; swap to a veto_live_ key when you're ready to take real money. The mode is the key — a test key makes a test merchant, a live key a live one.

2. Add the server to your agent's MCP config

Drop a .mcp.json in your project (Claude Code / Cursor both read it). The server is launched with npx, and your key is passed via the VETO_API_KEY env var:

.mcp.json
{
  "mcpServers": {
    "veto-merchant": {
      "command": "npx",
      "args": ["-y", "@veto-protocol/mcp-merchant"],
      "env": {
        "VETO_API_KEY": "veto_test_8f2c…",
        "VETO_API_BASE": "https://merchants.veto-ai.com"
      }
    }
  }
}

Keep the key out of version control.

VETO_API_KEY is a secret. Use your agent's env-var substitution (e.g. "VETO_API_KEY": "${VETO_API_KEY}") or your editor's secret store rather than committing the literal key — and never put a veto_live_ key in a shared repo.

Restart your agent (or reload its MCP servers). It should now list the veto_* merchant tools.

3. The tools

Each tool wraps one hosted endpoint and returns its reason-coded JSON verbatim, so the agent can read findings and self-correct:

ToolWrapsWhat it does
veto_statusGET /v1/meConfirm the key resolves and which mode (test/live) you're in. Start here.
veto_create_merchantPOST /v1/merchantsCreate the merchant (slug, name, domain, rails?).
veto_add_productPOST /v1/catalogAdd a CatalogItemsku, name, decimal-string price, available.
veto_set_receivingPUT /v1/receivingSet your pay_tobase-sepolia (test) or base (live), your address.
veto_validatePOST /v1/validateDry-run the draft config; surface findings with no side effects.
veto_publishPOST /v1/publishValidate, activate the newest policy version, rebuild the manifest.
veto_connect_infomanifestPrint the discovery anchor URL + CNAME steps to serve it under your brand.

Money stays an exact decimal string through every tool ("5.00", never 5.0), exactly as the REST API requires. The agent never re-derives a float.

4. A sample prompt

Give your agent something like this. It has everything the tools need; the agent fills the gaps by reading each tool's reason-coded response:

Set up my Veto merchant on the hosted platform using the veto-merchant MCP tools.

1. Run veto_status to confirm my key works and tell me if I'm in test or live mode.
2. Create a merchant: slug "acme", name "Acme Corp", domain "shop.acme.example".
3. Add one product: sku "rpt-001", name "Market Report", price "5.00" USD, available.
4. Set receiving to my Base Sepolia USDC address
   0x1111111111111111111111111111111111111111 (I'm in test mode).
5. Run veto_validate; if there are findings, fix them and explain what changed.
6. Publish with veto_publish and show me the active_policy_version.
7. Run veto_connect_info and give me the manifest URL plus the CNAME I'd add to
   serve it under shop.acme.example.

Keep all prices as exact decimal strings. Stop and ask me before doing anything
that would move real money.

The agent walks the same seven steps as the hosted setup guide, but you never touch a terminal. When it finishes, you have a published, agent-discoverable storefront.

5. Go live

When the sandbox merchant checks out cleanly, tell the agent to redo it against production: update .mcp.json to your veto_live_ key, then ask it to create a fresh live merchant and set receiving to your real Base mainnet address (chain: "base"). A live key is the only thing that reaches the real x402-rs facilitator. Then drive one small real purchase yourself and confirm the txHash — see Go live with x402.