{
  "markdown": "# jpyc-skill\n\nAI agent tooling for the **JPYC EC Platform** ([ec.jpyc-service.com](https://ec.jpyc-service.com)) — buy products with JPYC stablecoin via the **x402** payment protocol, no gas fees, no accounts.\n\nThis repo ships two complementary pieces:\n\n| Path | What it is | Use it from |\n| ---- | ---------- | ----------- |\n| [`skills/jpyc-ec-purchase/`](./skills/jpyc-ec-purchase) | Claude Code [Skill](https://docs.anthropic.com/en/docs/claude-code/plugins) — markdown reference describing the EC API and x402 flow | Claude Code (CLI / Desktop) |\n| [`mcp-servers/jpyc-ec-purchase/`](./mcp-servers/jpyc-ec-purchase) | Model Context Protocol server — invokable tools (`list_shops`, `get_product`, `purchase_cart`, …) for any MCP-capable agent | Claude Desktop, Cursor, OpenAI Agents SDK, and any MCP host |\n\nBoth target the same surface: the JPYC EC Platform's public `/api/v1` routes plus the x402 v2 checkout endpoint.\n\n---\n\n## Why this exists\n\n[x402](https://x402.org) is an open standard (Coinbase, December 2025) that embeds payments into HTTP using the long-dormant `402 Payment Required` status code. JPYC implements EIP-3009 natively, so an AI agent can:\n\n1. Discover a product on the JPYC EC Platform\n2. Sign an EIP-712 authorization with its wallet (zero gas)\n3. POST it back — the platform's facilitator settles on-chain in one round trip\n4. Receive an order number + transaction hash\n\nThis repo is the agent-side ergonomics layer for that flow.\n\n---\n\n## Skill (`skills/jpyc-ec-purchase/`)\n\nMarkdown documentation Claude Code reads as context. Two files:\n\n- **`SKILL.md`** — The TypeScript / SDK-flavoured reference. Decision tree (when to ask for shipping, when to ask for variants), full request/response shapes for every `/api/v1` route, complete error matrix, sample TypeScript implementation using viem.\n- **`SKILL-acli.md`** — The same content rewritten as `curl` + `jq` recipes. Useful for shell-based agents and direct debugging.\n\n### Install (Claude Code)\n\n```bash\ngit clone https://github.com/Mameta29/jpyc-skill.git\nmkdir -p ~/.claude/skills/jpyc-ec-purchase\ncp -r jpyc-skill/skills/jpyc-ec-purchase/* ~/.claude/skills/jpyc-ec-purchase/\n```\n\nClaude Code will then automatically use the skill whenever you ask it to interact with the JPYC EC Platform — e.g. \"list shops on stg-ec.jpyc-service.com\" or \"buy product X with my testnet wallet\".\n\n---\n\n## MCP server (`mcp-servers/jpyc-ec-purchase/`)\n\nA standalone MCP server exposing eight tools:\n\n| Tool | EC API endpoint |\n| ---- | --------------- |\n| `list_shops` | `GET /api/v1/shops` |\n| `list_products_in_shop` | `GET /api/v1/shops/:slug/products` |\n| `get_product` | `GET /api/v1/products/:id` |\n| `get_product_reviews` | `GET /api/v1/products/:id/reviews` |\n| `get_nft_discounts` | `GET /api/v1/shops/:slug/nft-discounts` |\n| `get_categories` | `GET /api/v1/categories` |\n| `get_order_status` | `GET /api/v1/orders?customer_address=` |\n| `purchase_cart` | `POST /api/v1/checkout` (x402, called twice) |\n| `purchase_product` | `POST /api/v1/checkout` (x402, called twice — single-item shim over `purchase_cart`) |\n\n`purchase_cart` runs the full x402 dance: fetches the 402 challenge, signs an\nEIP-3009 `transferWithAuthorization` with the agent's wallet, submits the\nsigned payload, returns the finalized order. `purchase_product` is a thin\nsingle-item wrapper over it. Both accept an optional `max_amount_atomic`\nbudget cap so a misbehaving (or hijacked) agent can't overspend.\n\n> Both purchase tools target the unified `POST /api/v1/checkout` endpoint.\n> The older single-product `POST /api/v1/products/:id/checkout` route was\n> removed on the platform — human shoppers and AI agents now share one\n> checkout endpoint.\n\n### Configure (Claude Desktop)\n\n```json\n{\n  \"mcpServers\": {\n    \"jpyc-ec-purchase\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@jpyc-skill/ec-purchase-mcp\"],\n      \"env\": {\n        \"BUYER_PRIVATE_KEY\": \"0x...\",\n        \"EC_API_URL\": \"https://ec.jpyc-service.com\"\n      }\n    }\n  }\n}\n```\n\nFor Cursor / OpenAI Agents SDK, the same stdio launcher works — both accept arbitrary MCP servers.\n\n### Run from source\n\n```bash\ncd jpyc-skill/mcp-servers/jpyc-ec-purchase\nnpm install && npm run build\nBUYER_PRIVATE_KEY=0x... EC_API_URL=https://stg-ec.jpyc-service.com node dist/bin.js\n```\n\nSee [`mcp-servers/jpyc-ec-purchase/README.md`](./mcp-servers/jpyc-ec-purchase/README.md) for the full setup walkthrough.\n\n---\n\n## What this repo is NOT\n\n- It is **not** a JPYC contract reference. EIP-3009 / EIP-2612 / admin docs for the JPYC token itself live elsewhere.\n- It is **not** a generic x402 facilitator. The hosted facilitator the platform uses (`facilitator.jpyc-service.com`) is operated separately at [`Mameta29/jpyc-x402-facilitator`](https://github.com/Mameta29/jpyc-x402-facilitator).\n- It is **not** affiliated with JPYC株式会社 or Coinbase.\n\n---\n\n## Related\n\n- [jpyc-ec-platform](https://github.com/Mameta29/jpyc-ec-platform) — The EC platform whose API these tools target.\n- [jpyc-x402-facilitator](https://github.com/Mameta29/jpyc-x402-facilitator) — The x402 facilitator the EC platform delegates settlement to.\n- [coinbase/x402](https://github.com/coinbase/x402) — Protocol specification.\n\n## License\n\nMIT\n",
  "bytes": 5205,
  "sha": "2c27f44d3818a8408bc2c8fbf0694b76aa782d51eb59f85c9b759c14a183d015",
  "repo_slug": "mameta29/jpyc-skill",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_mameta29_jpyc_skill_jpyc_dev_reference_94cdc11a/readme"
}