Skip to main content
Glama

agenticpay

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

AI エージェントから報酬を受け取りましょう。 MCP エコシステム向けのオープンソース決済インフラストラクチャです。あらゆるツールに価格を設定し、エージェントは x402 を介して USDC で支払いを行い、Solana 上で約 1.5 秒で決済されます。

Stripe も、アカウントも、API キーも不要です。

SDK、CLI、ペイウォールミドルウェア、セルフホスト可能な x402 ファシリテーター、そしてライブ LLM エージェントデモまで、フルスタックが揃っています。すべて TypeScript で記述されており、MIT ライセンスです。

試してみたいですか? mcp-server をホスト済みの devnet ファシリテーターに向けてください: FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com — セットアップは不要です。

ライブデモ

実際の Claude Opus エージェントがタスクを受け取り、どの有料ツールを使用するかを判断し、Solana 上の x402 マイクロペイメントを介して自律的に支払いを行い、ユーザーに応答します。

$ pnpm --filter @agenticpay/two-agent-demo agent

Agent wallet: 3rHoEumCpH8EGrr6Lq2vBKeyec6h3yPRGj2nGG2FzEfX
Server:       http://localhost:4021
Facilitator:  http://localhost:4022   ← our own
Model:        claude-opus-4-7
Task:         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

オンチェーン証明 (Solana devnet):

Related MCP server: x402 Payment Gateway MCP Server

なぜこれが必要なのか

現在の AI エージェントスタックは、人間がクレジットカードを保持していることを前提としています。エージェントが API の呼び出し、サブエージェントの雇用、計算リソースの支払いなど、自発的に行動し始めると、その前提は崩れます。OAuth だけでは対応できません。

HTTP 上でのステーブルコインによるマイクロペイメントがこれを解決します。agenticpay は、MCP エコシステムに欠けていた人間工学的な利便性をパッケージ化しました。あらゆるツールが価格を宣言でき、あらゆるエージェントが支払うことができ、オンチェーン決済を実際に実行するファシリテーターを含むパイプライン全体がオープンソースであり、セルフホスト可能です。

アーキテクチャ

┌──────────────┐     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)

mcp-server をテストネット/devnet 用の公開 x402.org/facilitator に向けることも、メインネット用に Coinbase CDP に向けることも可能です。私たちはセルフホストのルートを簡単にしました。

パッケージ

パッケージ

機能

packages/sdk

TypeScript プリミティブ: USDC 送金、ウォレット管理、ネットワーク設定

packages/cli

agenticpay コマンド — ウォレット、残高、送信

packages/mcp-server

x402 ペイウォールミドルウェアを備えた HTTP サーバー。各ツールに価格を設定可能。

packages/facilitator

セルフホスト型 x402 ファシリテーター — Solana 上での USDC 支払いの検証と決済。エージェントに代わって SOL 手数料を支払います。

packages/eliza-plugin

Eliza プラグイン — 有料 HTTP エンドポイントをネイティブな Eliza アクションとしてラップ。Solana ネイティブな AI エージェントがツール呼び出しごとに支払います。

packages/ai-sdk

Vercel AI SDK ヘルパー — 有料ツールを generateText / streamText に直接組み込み可能。

packages/mcp-bridge

リアル MCP サーバー (stdio + @modelcontextprotocol/sdk)。x402 有料ツールをラップ。Claude Desktop / Cursor に組み込み可能。

examples/two-agent-demo

ツール呼び出しに対して支払いを行う実際の Claude Opus エージェント

インストール

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

または、モノレポをクローンして、ライブの 2 エージェントデモや編集しやすいテンプレートを入手してください(初回実行にはこちらを推奨 — 以下のクイックスタートを参照)。

Claude Code での使用

このリポジトリには、.claude/skills/agenticpay/SKILL.md に Anthropic Skill が同梱されています。これを ~/.claude/skills/ にコピーすると、Claude Code に agenticpay に関するファーストクラスのコンテキストを与えることができます。これにより、MCP サーバーの収益化、ツールルートの生成、オンチェーン決済の検証を、毎回 README を読み直すことなく実行できるようになります。

mkdir -p ~/.claude/skills
cp -r .claude/skills/agenticpay ~/.claude/skills/

クイックスタート (devnet, 約 5 分, 無料)

# 1. Install
pnpm install
pnpm -r build

# 2. Generate a payer wallet, fund it on devnet
node packages/cli/dist/index.js wallet new
node 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 fund
export 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

フレームワーク統合

一般的な AI エージェントスタック向けのドロップインテンプレートが examples/ 以下にあります:

フレームワーク

ファイル

Anthropic SDK (標準)

examples/two-agent-demo/src/agent-llm.ts

実用的な有料サーバーテンプレート (Claude 駆動ツール)

examples/research-server/

LangChain.js

examples/langchain-js/agent-with-paid-tools.ts

LangChain Python

examples/langchain-python/agent_with_paid_tools.py

Eliza (Solana ネイティブ)

examples/eliza/plugin-agenticpay.ts

Mastra

examples/mastra/paid-tool.ts

Vercel AI SDK

examples/vercel-ai-sdk/paid-tool.ts

OpenAI Custom GPT

examples/openai-gpt/action-schema.json

統合マトリックスについては examples/README.md を参照してください。

ステータス

プレアルファ版。Devnet でエンドツーエンドの検証済み。メインネット設定もサポートされていますが、ファシリテーターに実際の SOL を供給し、メインネット対応の RPC (Helius, QuickNode など) を指定する必要があります。

ロードマップ

  • [x] Devnet エンドツーエンドデモ (スモークテスト + LLM エージェント)

  • [x] セルフホスト型 x402 ファシリテーター (検証 + 決済、fee_payer 抽象化)

  • [ ] 実用的な MCP サーバーテンプレート (検索、取得、要約、抽出 — おもちゃの reverse_string ではなく)

  • [ ] 長時間実行タスク用のオンチェーンエスクロー (Anchor プログラム)

  • [ ] オンチェーンのエージェント評判レジストリ

  • [ ] ホスト型ファシリテーターサービス (agenticpay.com)

ファシリテーターとは?

x402 を初めて見る方のために説明すると、ファシリテーターとは信頼された仲介者であり、(1) エージェントの署名済み支払いペイロードを検証し、(2) オンチェーンで USDC 送金を送信し、(3) エージェントが SOL を必要としないように(USDC だけで済むように)SOL ガス代を支払う役割を担います。ほとんどの MCP 開発者は自分で運用したくないため、ホストされているサービスを利用します。

このリポジトリには完全なファシリテーターの実装が含まれています。セルフホスト、フォーク、監査、あるいは独自のユーザー向けサービスとしてデプロイすることが可能です。

ライセンス

MIT

Available Tools

1 tool
agenticpay_infoB

Placeholder tool for Glama introspection handshake.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It describes itself as a 'placeholder,' implying no significant side effects, but fails to explicitly state whether it is read-only, what it returns, or any other behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is both concise and front-loaded. Every word serves a purpose, and there is no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description is adequately complete for its placeholder role. It explains the tool's purpose without missing essential details for a minimal introspection handshake.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so the baseline score is 4 per the rubric. The description adds no parameter information, but none is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool is a placeholder for 'Glama introspection handshake,' which is a specific purpose. The verb 'handshake' is implied, and the resource 'introspection' is named, distinguishing it from typical functional tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. As a placeholder, it likely serves a specific introspective role, but the description does not explain its usage context or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.0
    • First observedagenticpay_info

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

Only one tool exists, so there is no ambiguity between tools.

Naming Consistency5/5

With a single tool, naming is trivially consistent; the name uses a clear verb_noun pattern.

Tool Count1/5

One placeholder tool is far too few for a server named 'agenticpay', which implies a payment domain requiring multiple operations.

Completeness1/5

The server lacks any functional tools; a payment server should have tools for transactions, balances, etc., but there is only a placeholder.

Maintenance

ActivityActive
ResponsivenessWithin a week

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Drop-in x402 payment middleware for MCP servers. Charge AI agents per tool call using USDC on Base chain — Python and JavaScript SDKs, no payment processor, no KYC.
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Agentic payments on Solana: an agent can pay x402 / HTTP 402 paywalls in USDC, hold a pre-paid balance or a subscription, and buy datasets or settle store checkouts. All 15 tools run behind fail-closed spending caps ($1 per payment, $10 per day by default), and settlement is non-custodial through a program-owned escrow that releases 99% to the creator.
    18
    79 npm
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server providing 22 pay-per-call utility tools for AI agents (scrape, validate, embed, store, moderate, notify, convert, prevent loops) without accounts or API keys, using USDC payments via the x402 protocol.
    17
    77 npm
    1
    MIT