{"id":50127899,"url":"https://github.com/krystiangw/agenticpay","last_synced_at":"2026-06-09T12:00:50.364Z","repository":{"id":354874693,"uuid":"1225580645","full_name":"krystiangw/agenticpay","owner":"krystiangw","description":"MCP-native pay-per-tool-call micropayments for AI agents (Solana + USDC + x402)","archived":false,"fork":false,"pushed_at":"2026-05-11T04:50:29.000Z","size":335,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T06:39:07.594Z","etag":null,"topics":["agentic-payments","ai-agents","claude","mcp","micropayments","model-context-protocol","monetization","payment-infrastructure","solana","stablecoin","typescript","usdc","x402","x402-facilitator"],"latest_commit_sha":null,"homepage":"https://krystiangw.github.io/agenticpay/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krystiangw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-30T12:30:27.000Z","updated_at":"2026-05-05T09:17:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/krystiangw/agenticpay","commit_stats":null,"previous_names":["krystiangw/agentpay","krystiangw/agenticpay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krystiangw/agenticpay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krystiangw%2Fagenticpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krystiangw%2Fagenticpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krystiangw%2Fagenticpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krystiangw%2Fagenticpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krystiangw","download_url":"https://codeload.github.com/krystiangw/agenticpay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krystiangw%2Fagenticpay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34105565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-payments","ai-agents","claude","mcp","micropayments","model-context-protocol","monetization","payment-infrastructure","solana","stablecoin","typescript","usdc","x402","x402-facilitator"],"created_at":"2026-05-23T21:00:18.976Z","updated_at":"2026-06-09T12:00:50.357Z","avatar_url":"https://github.com/krystiangw.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# agenticpay\n\n[![CI](https://github.com/krystiangw/agenticpay/actions/workflows/ci.yml/badge.svg)](https://github.com/krystiangw/agenticpay/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/krystiangw/agenticpay/actions/workflows/codeql.yml/badge.svg)](https://github.com/krystiangw/agenticpay/actions/workflows/codeql.yml)\n[![gitleaks](https://github.com/krystiangw/agenticpay/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/krystiangw/agenticpay/actions/workflows/gitleaks.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/krystiangw/agenticpay?style=flat\u0026logo=github\u0026color=yellow)](https://github.com/krystiangw/agenticpay/stargazers)\n[![npm: @agenticpay/sdk](https://img.shields.io/npm/v/@agenticpay/sdk?label=npm%20%40agenticpay%2Fsdk)](https://www.npmjs.com/package/@agenticpay/sdk)\n[![npm downloads](https://img.shields.io/npm/dm/@agenticpay/sdk?label=downloads)](https://www.npmjs.com/package/@agenticpay/sdk)\n\n**Get paid by AI agents.** Open-source payment infrastructure for the MCP\necosystem — declare a price on any tool, agents pay in USDC over [x402](https://x402.org),\nsettles on Solana in ~1.5 seconds.\n\nNo Stripe. No accounts. No API keys.\n\nThe full stack is here — SDK, CLI, paywall middleware, **self-hosted x402\nfacilitator**, and a live LLM agent demo. All TypeScript, MIT licensed.\n\n\u003e **Just want to test it?** Point your `mcp-server` at our hosted devnet\n\u003e facilitator: `FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com`\n\u003e — no setup needed.\n\n## Live demo\n\nA real Claude Opus agent receives a task, decides which paid tools to use,\npays autonomously via x402 micropayments on Solana, and answers the user.\n\n```\n$ pnpm --filter @agenticpay/two-agent-demo agent\n\nAgent wallet: 3rHoEumCpH8EGrr6Lq2vBKeyec6h3yPRGj2nGG2FzEfX\nServer:       http://localhost:4021\nFacilitator:  http://localhost:4022   ← our own\nModel:        claude-opus-4-7\nTask:         Reverse the string 'agentpay rocks' and tell me how many words\n              are in 'The quick brown fox jumps over the lazy dog'.\n\n[turn 1] tool_use: reverse_string({\"text\":\"agenticpay rocks\"})  →  paying $0.001 USDC ...\n  ✓ paid + got result in 1596ms: {\"result\":\"skcor yaptnega\"}\n[turn 1] tool_use: word_count({\"text\":\"The quick...\"})  →  paying $0.0005 USDC ...\n  ✓ paid + got result in 1286ms: {\"count\":9}\n\nAgent final answer:\n  1. Reversed string: skcor yaptnega\n  2. Word count: 9 words\n\n=== payments summary ===\n  reverse_string   $0.0010 USDC   1596ms\n  word_count       $0.0005 USDC   1286ms\n  TOTAL            $0.0015 USDC   2 calls\n```\n\nOn-chain proof (Solana devnet):\n- Settled by our self-hosted facilitator: [`EsqzTG8id...Bnku`](https://explorer.solana.com/tx/EsqzTG8id5CF5yxXmSSictkJnqn1uVC514joHqVBpdfSy4MkzvGzGGdb7Fybkn5ruSGyCQ87jyjmHuSGpU2Bnku?cluster=devnet)\n- Earlier settle via x402.org: [`2d2HcefgJ...vkqY`](https://explorer.solana.com/tx/2d2HcefgJYmkivWvf4x3TtZENnNEwJ94c9jLHZsHaDbYmEuBGuv3RCojLzsAjsqF2CKHujgX7QaDcApSLSQAvkqY?cluster=devnet)\n\n## Why\n\nThe current AI agent stack assumes humans hold the credit card. That breaks\nthe moment agents act on their own initiative — calling APIs, hiring\nsub-agents, paying for compute. You can't OAuth your way through it.\n\nStablecoin micropayments over HTTP fix it. agenticpay packages the missing\nergonomics for the MCP ecosystem specifically: any tool can declare a price,\nany agent can pay it, and the whole pipeline — including the facilitator that\nactually submits the on-chain settlement — is open source and self-hostable.\n\n## Architecture\n\n```\n┌──────────────┐     1) HTTP request                    ┌─────────────┐\n│   Claude /   │ ────────────────────────────────────▶ │  mcp-server │\n│   GPT agent  │     2) HTTP 402 + payment requirements │  (yours)    │\n│              │ ◀──────────────────────────────────── │             │\n│              │     3) signed USDC payload             │             │\n│              │ ────────────────────────────────────▶ │             │\n└──────────────┘                                        └─────┬───────┘\n                                                              │ verify+settle\n                                                              ▼\n                                                   ┌──────────────────────┐\n                                                   │ agenticpay facilitator │\n                                                   │   (also yours, this  │\n                                                   │    repo, port 4022)  │\n                                                   └──────────┬───────────┘\n                                                              │ submit\n                                                              ▼\n                                                          Solana\n                                                       (USDC SPL,\n                                                       sub-cent fees)\n```\n\nYou can also point `mcp-server` at the public `x402.org/facilitator` for\ntestnet/devnet, or at Coinbase CDP for mainnet. We just made the\nself-hosted route easy.\n\n## Packages\n\n| Package | What it does |\n|---|---|\n| `packages/sdk` | TypeScript primitives: USDC transfers, wallet management, network config |\n| `packages/cli` | `agenticpay` command — wallet, balance, send |\n| `packages/mcp-server` | HTTP server with x402 paywall middleware. Each tool has a price. |\n| `packages/facilitator` | **Self-hosted x402 facilitator** — verify + settle USDC payments on Solana. Pays SOL fees on behalf of agents. |\n| `packages/eliza-plugin` | **Eliza plugin** — wraps paid HTTP endpoints as native Eliza Actions. Solana-native AI agents pay per tool call. |\n| `packages/ai-sdk` | **Vercel AI SDK helpers** — drop paid tools straight into `generateText` / `streamText`. |\n| `packages/mcp-bridge` | **Real MCP server** (stdio + `@modelcontextprotocol/sdk`) wrapping x402 paid tools. Drop into Claude Desktop / Cursor. |\n| `examples/two-agent-demo` | Real Claude Opus agent paying for tool calls |\n\n## Install\n\n```bash\nnpm install @agenticpay/sdk           # Solana + USDC primitives\nnpm install -g @agenticpay/cli        # `agenticpay` command\nnpm install @agenticpay/mcp-server    # paywalled HTTP server\nnpm install @agenticpay/facilitator   # self-hosted x402 facilitator\nnpm install @agenticpay/eliza-plugin  # Eliza plugin (Solana-native agents)\nnpm install @agenticpay/ai-sdk        # Vercel AI SDK paid tools\nnpm install -g @agenticpay/mcp-bridge # MCP server for Claude Desktop / Cursor\n```\n\nOr clone the monorepo to get the live two-agent demo and edit-friendly\ntemplates (recommended for first run — see Quickstart below).\n\n## Use with Claude Code\n\nThis repo ships an [Anthropic Skill](https://docs.claude.com/en/docs/claude-code/skills)\nat `.claude/skills/agenticpay/SKILL.md`. Copy it into your `~/.claude/skills/`\nto give Claude Code first-class context about agenticpay — it'll then walk you\nthrough monetizing an MCP server, generating tool routes, and verifying\non-chain settlements without re-reading the README every time.\n\n```bash\nmkdir -p ~/.claude/skills\ncp -r .claude/skills/agenticpay ~/.claude/skills/\n```\n\n## Quickstart (devnet, ~5 minutes, free)\n\n```bash\n# 1. Install\npnpm install\npnpm -r build\n\n# 2. Generate a payer wallet, fund it on devnet\nnode packages/cli/dist/index.js wallet new\nnode packages/cli/dist/index.js wallet show\n# → fund SOL at https://faucet.solana.com  (paste pubkey)\n# → fund USDC at https://faucet.circle.com (Solana Devnet, same pubkey)\n\n# 3. (option A — fastest) Use our hosted devnet facilitator. Skip step 4.\nexport FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com\n\n# 3. (option B — fully self-hosted) Start your own facilitator (terminal 1)\npnpm --filter @agenticpay/facilitator dev\n# Note the printed feePayer address. It needs ~0.05 SOL devnet to cover fees.\n# Either airdrop or use the helper:\npnpm --filter @agenticpay/facilitator fund\nexport FACILITATOR_URL=http://localhost:4022\n\n# 4. Start the paywalled mcp-server (terminal 2)\nPAY_TO=\u003crecipient pubkey\u003e pnpm --filter @agenticpay/mcp-server dev\n\n# 5. Run the live LLM agent demo (terminal 3, needs ANTHROPIC_API_KEY in .env)\npnpm --filter @agenticpay/two-agent-demo agent\n```\n\n## Framework integrations\n\nDrop-in templates for the most common AI agent stacks live under `examples/`:\n\n| Framework | File |\n|---|---|\n| Anthropic SDK (canonical) | `examples/two-agent-demo/src/agent-llm.ts` |\n| Real-world paid server template (Claude-backed tools) | `examples/research-server/` |\n| LangChain.js | `examples/langchain-js/agent-with-paid-tools.ts` |\n| LangChain Python | `examples/langchain-python/agent_with_paid_tools.py` |\n| Eliza (Solana-native) | `examples/eliza/plugin-agenticpay.ts` |\n| Mastra | `examples/mastra/paid-tool.ts` |\n| Vercel AI SDK | `examples/vercel-ai-sdk/paid-tool.ts` |\n| OpenAI Custom GPT | `examples/openai-gpt/action-schema.json` |\n\nSee `examples/README.md` for the integration matrix.\n\n## Status\n\nPre-alpha. Devnet validated end-to-end. Mainnet config supported but requires\nfunding the facilitator with real SOL and pointing at a mainnet-capable RPC\n(Helius, QuickNode, etc.).\n\n## Roadmap\n\n- [x] Devnet end-to-end demo (smoke + LLM agent)\n- [x] Self-hosted x402 facilitator (verify + settle, fee_payer abstraction)\n- [ ] Real-world MCP server template (search, fetch, summarize, extract — instead of toy `reverse_string`)\n- [ ] On-chain escrow for long-running tasks (Anchor program)\n- [ ] Agent reputation registry on-chain\n- [ ] Hosted facilitator service (`agenticpay.com`)\n\n## What's a facilitator?\n\nIf you've never seen x402 before: the **facilitator** is the trusted middleman\nthat (1) verifies an agent's signed payment payload, (2) submits the USDC\ntransfer on-chain, and (3) pays the SOL gas fees so the agent doesn't need\nany SOL — only USDC. Most MCP devs don't want to run their own; they point\nat a hosted one.\n\nThis repo ships a complete facilitator implementation. You can self-host it,\nfork it, audit it, or deploy it as a service for your own users.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrystiangw%2Fagenticpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrystiangw%2Fagenticpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrystiangw%2Fagenticpay/lists"}