Agents & MCP
Connect AI agents to BAGS via MCP, WebMCP, /auth.md, and machine-readable discovery.
BAGS is built for agent-native commerce. Agents discover payment capabilities via MCP and /.well-known/*. Merchants sell to agents via x402.
MCP server
POST https://www.getbags.app/api/mcp/mcpTransport: Streamable HTTP (MCP 2025-03-26). Stateless — no session store required.
Tools
| Tool | Description |
|---|---|
bags-preview-payment-link | Fetch public metadata for a payment link UUID (name, amount, networks, merchant info) |
bags-tax-quote | Compute tax estimate for a payment link + customer address; returns signed quoteToken |
Both tools are read-only / anonymous and rate-limited per client IP. They mirror the browser WebMCP tools on the marketing layout.
Agent registration (/auth.md)
Merchants who need API keys follow human-mediated registration documented at:
https://www.getbags.app/auth.mdThat skill explains verified-email signup, claiming bag_live_… / bag_test_… keys from the dashboard, and Bearer auth against /api/v1. There is no unauthenticated programmatic signup endpoint.
Buyer agents paying via x402 do not need BAGS API keys.
Discovery endpoints
| Resource | URL |
|---|---|
| Auth skill | /auth.md |
| MCP server card | /.well-known/mcp/server-card.json |
| Agent skills index | /.well-known/agent-skills/index.json |
| API catalog (RFC 9727) | /.well-known/api-catalog |
| OAuth protected resource | /.well-known/oauth-protected-resource |
| Agent card (A2A) | /.well-known/agent-card.json |
| OpenAPI | /openapi.yaml |
| x402 discovery | GET /api/v1 (returns an x402 challenge) |
Production origin: https://www.getbags.app
WebMCP (browser)
On the marketing site, BAGS registers WebMCP tools via navigator.modelContext — the same tool surface as the remote MCP server.
x402 pay-per-use
For monetizing your own API endpoints, use x402 agentic payments. Clients receive HTTP 402 with payment instructions until USDC payment succeeds.
GET /api/v1 is a nominal x402 discovery index (not your merchant paywall) so scanners detect protocol support.
Merchant API vs agent tools
| Capability | Auth | Use case |
|---|---|---|
| MCP preview / tax quote | None (rate-limited) | Agents researching or quoting before checkout |
| Products / payment links / checkouts | API key | Creating and managing sellables |
| x402 agent proxy | USDC payment (402) | Paying for a call — no merchant key for the buyer |
Never embed live API keys in agent prompts or MCP configs exposed to end users.