Agenticpay

io.github.krystiangw由 GitHub 账号 krystiangw 发布v0.0.1更新于 Oct 25, 2026

x402 USDC paywall bridge for MCP — pay per tool call on Solana.

发布方自己的服务:Agent Rynku - Warsaw Stock Exchange (GPW) data for your agent

已验证STDIO仅桌面金融开发者工具

概览

AI 生成的概览

本地 stdio MCP 桥接器,将按 x402 计费的 HTTP 工具封装为 MCP 工具,让助手用配置的 Solana 密钥对按次以 USDC 付费。

可以做什么
把 JSON 配置中定义的付费 HTTP 工具暴露为助手可调用的 MCP 工具,每个工具有名称、描述、URL、输入 schema,并可为单个工具附加请求头。在工具调用需要付费时,用配置的 Solana 密钥对签署 x402 USDC 支付载荷。通过 x402 facilitator 在 Solana 上完成结算,网络与 RPC 端点由配置指定。仅在支付结算成功后返回工具结果,因此失败的调用不会扣费。
适用场景
当你希望助手调用按次以 USDC 通过 x402 在 Solana 上收费的 HTTP 工具,并愿意为付款钱包充值时使用。它适合在 devnet 上测试或试验代理微支付,而非生产用途,因为项目自称为 pre-alpha。
运行要求
以 npm 包 @agenticpay/mcp-bridge 通过 stdio 在本地运行,需要 Node.js。需要 AGENTICPAY_BRIDGE_KEYPAIR 密钥(64 字节 Solana 密钥对 JSON 数组)、AGENTICPAY_BRIDGE_TOOLS 中的付费工具定义 JSON 数组,可选 AGENTICPAY_BRIDGE_NETWORK 与 AGENTICPAY_BRIDGE_RPC。付款钱包需要 USDC,视 facilitator 还需 SOL 支付手续费;需要访问 RPC 与 facilitator 的网络。
安装前请注意
桥接器在 AGENTICPAY_BRIDGE_KEYPAIR 中持有 Solana 私钥并用它签署真实 USDC 支付,因此每次工具调用都可能花钱;请使用专用的低余额钱包。主网结算不可逆,且需要真实 SOL 与 USDC。工具 URL 与可选请求头来自你自己的配置,调用会向这些第三方端点发送请求。项目处于 pre-alpha 阶段,返回成功但质量差的工具结果仍会被扣费。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agenticpay,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agenticpay

[CI] [CodeQL] [gitleaks] [License: MIT] [GitHub stars] [npm: @agenticpay/sdk] [npm downloads]

Website · Spend caps · npm

Get paid by AI agents. Open-source payment infrastructure for the MCP ecosystem - declare a price on any tool, agents pay in USDC over x402, settles on Solana in ~1.5 seconds.

No Stripe. No accounts. No API keys.

The full stack is here - SDK, CLI, paywall middleware, self-hosted x402 facilitator, and a live LLM agent demo. All TypeScript, MIT licensed.

Just want to test it? Point your mcp-server at our hosted devnet facilitator: FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com No setup needed.

Live demo

A real Claude Opus agent receives a task, decides which paid tools to use, pays autonomously via x402 micropayments on Solana, and answers the user.

$ pnpm --filter @agenticpay/two-agent-demo agent
Agent wallet: 3rHoEumCpH8EGrr6Lq2vBKeyec6h3yPRGj2nGG2FzEfXServer:       http://localhost:4021Facilitator:  http://localhost:4022   ← our ownModel:        claude-opus-4-7Task:         Reverse the string 'agentpay rocks' and tell me how many words              are in 'The quick brown fox jumps over the lazy dog'.
[turn 1] tool_use: reverse_string({"text":"agenticpay rocks"})  →  paying $0.001 USDC ...  ✓ paid + got result in 1596ms: {"result":"skcor yaptnega"}[turn 1] tool_use: word_count({"text":"The quick..."})  →  paying $0.0005 USDC ...  ✓ paid + got result in 1286ms: {"count":9}
Agent final answer:  1. Reversed string: skcor yaptnega  2. Word count: 9 words
=== payments summary ===  reverse_string   $0.0010 USDC   1596ms  word_count       $0.0005 USDC   1286ms  TOTAL            $0.0015 USDC   2 calls

On-chain proof (Solana devnet):

Why

The current AI agent stack assumes humans hold the credit card. That breaks the moment agents act on their own initiative - calling APIs, hiring sub-agents, paying for compute. You can't OAuth your way through it.

Stablecoin micropayments over HTTP fix it. agenticpay packages the missing ergonomics for the MCP ecosystem specifically: any tool can declare a price, any agent can pay it, and the whole pipeline - including the facilitator that actually submits the on-chain settlement - is open source and self-hostable.

Architecture

┌──────────────┐     1) HTTP request                    ┌─────────────┐│   Claude /   │ ────────────────────────────────────▶ │  mcp-server ││   GPT agent  │     2) HTTP 402 + payment requirements │  (yours)    ││              │ ◀──────────────────────────────────── │             ││              │     3) signed USDC payload             │             ││              │ ────────────────────────────────────▶ │             │└──────────────┘                                        └─────┬───────┘                                                              │ verify+settle                                                              ▼                                                   ┌──────────────────────┐                                                   │ agenticpay facilitator │                                                   │   (also yours, this  │                                                   │    repo, port 4022)  │                                                   └──────────┬───────────┘                                                              │ submit                                                              ▼                                                          Solana                                                       (USDC SPL,                                                       sub-cent fees)

You can also point mcp-server at the public x402.org/facilitator for testnet/devnet, or at Coinbase CDP for mainnet. We just made the self-hosted route easy.

Packages

PackageWhat it does
packages/sdkTypeScript primitives: USDC transfers, wallet management, network config
packages/cliagenticpay command - wallet, balance, send
packages/mcp-serverHTTP server with x402 paywall middleware. Each tool has a price.
packages/facilitatorSelf-hosted x402 facilitator - verify + settle USDC payments on Solana. Pays SOL fees on behalf of agents.
packages/eliza-pluginEliza plugin - wraps paid HTTP endpoints as native Eliza Actions. Solana-native AI agents pay per tool call.
packages/ai-sdkVercel AI SDK helpers - drop paid tools straight into generateText / streamText.
packages/mcp-bridgeReal MCP server (stdio + @modelcontextprotocol/sdk) wrapping x402 paid tools. Drop into Claude Desktop / Cursor.
examples/two-agent-demoReal Claude Opus agent paying for tool calls

Install

bash
npm install @agenticpay/sdk           # Solana + USDC primitivesnpm install -g @agenticpay/cli        # `agenticpay` commandnpm install @agenticpay/mcp-server    # paywalled HTTP servernpm install @agenticpay/facilitator   # self-hosted x402 facilitatornpm install @agenticpay/eliza-plugin  # Eliza plugin (Solana-native agents)npm install @agenticpay/ai-sdk        # Vercel AI SDK paid toolsnpm install -g @agenticpay/mcp-bridge # MCP server for Claude Desktop / Cursor

Or clone the monorepo to get the live two-agent demo and edit-friendly templates (recommended for first run - see Quickstart below).

Use with Claude Code

This repo ships an Anthropic Skill at .claude/skills/agenticpay/SKILL.md. Copy it into your ~/.claude/skills/ to give Claude Code first-class context about agenticpay - it'll then walk you through monetizing an MCP server, generating tool routes, and verifying on-chain settlements without re-reading the README every time.

bash
mkdir -p ~/.claude/skillscp -r .claude/skills/agenticpay ~/.claude/skills/

Quickstart (devnet, ~5 minutes, free)

bash
# 1. Installpnpm installpnpm -r build
# 2. Generate a payer wallet, fund it on devnetnode packages/cli/dist/index.js wallet newnode packages/cli/dist/index.js wallet show# → fund SOL at https://faucet.solana.com  (paste pubkey)# → fund USDC at https://faucet.circle.com (Solana Devnet, same pubkey)
# 3. (option A - fastest) Use our hosted devnet facilitator. Skip step 4.export FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com
# 3. (option B - fully self-hosted) Start your own facilitator (terminal 1)pnpm --filter @agenticpay/facilitator dev# Note the printed feePayer address. It needs ~0.05 SOL devnet to cover fees.# Either airdrop or use the helper:pnpm --filter @agenticpay/facilitator fundexport FACILITATOR_URL=http://localhost:4022
# 4. Start the paywalled mcp-server (terminal 2)PAY_TO=<recipient pubkey> pnpm --filter @agenticpay/mcp-server dev
# 5. Run the live LLM agent demo (terminal 3, needs ANTHROPIC_API_KEY in .env)pnpm --filter @agenticpay/two-agent-demo agent

Framework integrations

Drop-in templates for the most common AI agent stacks live under examples/:

FrameworkFile
Anthropic SDK (canonical)examples/two-agent-demo/src/agent-llm.ts
Real-world paid server template (Claude-backed tools)examples/research-server/
LangChain.jsexamples/langchain-js/agent-with-paid-tools.ts
LangChain Pythonexamples/langchain-python/agent_with_paid_tools.py
Eliza (Solana-native)examples/eliza/plugin-agenticpay.ts
Mastraexamples/mastra/paid-tool.ts
Vercel AI SDKexamples/vercel-ai-sdk/paid-tool.ts
OpenAI Custom GPTexamples/openai-gpt/action-schema.json

See examples/README.md for the integration matrix.

Status

Pre-alpha. Devnet validated end-to-end. Mainnet config supported but requires funding the facilitator with real SOL and pointing at a mainnet-capable RPC (Helius, QuickNode, etc.).

Roadmap

  • Devnet end-to-end demo (smoke + LLM agent)
  • Self-hosted x402 facilitator (verify + settle, fee_payer abstraction)
  • Real-world MCP server template (search, fetch, summarize, extract - instead of toy reverse_string)
  • On-chain escrow for long-running tasks (Anchor program)
  • Agent reputation registry on-chain
  • Hosted facilitator service (agenticpay.com)

What's a facilitator?

If you've never seen x402 before: the facilitator is the trusted middleman that (1) verifies an agent's signed payment payload, (2) submits the USDC transfer on-chain, and (3) pays the SOL gas fees so the agent doesn't need any SOL - only USDC. Most MCP devs don't want to run their own; they point at a hosted one.

This repo ships a complete facilitator implementation. You can self-host it, fork it, audit it, or deploy it as a service for your own users.

What happens when a paid tool call fails?

Short version: a failed tool call is never charged. x402 settlement is an irreversible push, so the middleware is careful about when it settles:

  1. Verify before execute. The payment payload (signature, funds, requirements match) is verified before your tool handler runs. Invalid payment → HTTP 402, the tool never executes.
  2. Execute with a buffered response. The handler runs, but its response is held back - nothing is sent to the agent yet.
  3. Settle only on success. If the handler responds with status ≥ 400, the middleware skips settlement entirely and just returns the error. The agent pays nothing for a failed call.
  4. No result without payment. If on-chain settlement itself fails, the buffered tool result is discarded and the agent gets a payment error instead - the server never leaks a result it wasn't paid for.

What this doesn't cover: a tool that returns 200 OK with a junk answer is still charged - the protocol can't judge response quality. That's what keeps per-call prices micro ($0.0005–$0.001 in the demo): the worst case is capped at one call's price, and quality enforcement belongs to a reputation layer (see Roadmap) rather than the payment protocol.

License

MIT

来源:README.md,提交 9072408

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Agentrynku 集成