# agentpay [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/romudille-bit/agentpay  
**GitHub Stars:** 4  
**npm Downloads (last month):** 1752  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agentpay-5

## Description
Budget-capped x402 payments for AI agents: verifiable receipts, trust routing, 17 free tools.

## Tools
Capabilities this server exposes over MCP:

- **token_price** — Get the current USD price of any cryptocurrency token

Use when: You need the current USD price, 24h change, or market cap of any cryptocurrency.
Not for: you need volume, ATH or a pair quote — token_market_data; a one-call macro + crypto overview — market_snapshot; pool depth or slippage — orderbook_depth.
Returns: price_usd, change_24h_pct, market_cap_usd, coin_id
Example response: {"symbol":"ETH","price_usd":2069.73,"change_24h_pct":-4.04,"market_cap_usd":250330787714.19,"source":"coingecko"}

Price: $0.000 USDC per call
- **gas_tracker** — Get current Ethereum gas prices (slow, standard, fast)

Use when: You need to know current Ethereum gas prices before submitting a transaction or estimating costs.
Not for: you need gas as part of a broader read — market_snapshot already includes standard gwei; only Ethereum mainnet gas is reported.
Returns: slow_gwei, standard_gwei, fast_gwei, base_fee_gwei, estimated confirmation times
Example response: {"slow_gwei":1.5,"standard_gwei":2,"fast_gwei":3,"base_fee_gwei":1.2,"source":"etherscan"}

Price: $0.000 USDC per call
- **yield_scanner** — Find best DeFi yield opportunities across protocols for a given token

Use when: You need to find the best yield/APY for a token across DeFi protocols.
Not for: you need a protocol's total TVL rather than pool APYs — defi_tvl; risk_level is a heuristic, run token_security on the pool's token before depositing.
Returns: list of pools with protocol, apy, tvl_usd, chain, risk_level sorted by APY descending
Example response: {"token":"USDC","pools":[{"protocol":"morpho","apy":8.74,"tvl_usd":312000000,"chain":"Ethereum","risk_level":"low"},{"protocol":"aave-v3","apy":5.21,"tvl_usd":1840000000,"chain":"Ethereum","risk_level":"low"},{"protocol":"compound-v3","apy":4.87,"tvl_usd":920000000,"chain":"Ethereum","risk_level":"low"}],"source":"defillama"}

Price: $0.000 USDC per call
- **open_interest** — Get total open interest in perpetual futures for any asset, with 1h and 24h change rates. Pairs with funding_rates to complete the derivatives picture — rising OI with high funding = overcrowded position.

Use when: You need to know total open interest in perpetual futures and whether it's rising or falling. Combine with funding_rates for a full derivatives picture.
Not for: you need the funding cost of holding a position — funding_rates; a single trade verdict — pre_trade_check.
Returns: total_oi_usd, oi_change_1h_pct, oi_change_24h_pct, long_short_ratio, per-exchange breakdown
Example response: {"asset":"ETH","price_usd":2069.73,"total_oi_usd":8420000000,"oi_change_1h_pct":1.2,"oi_change_24h_pct":12.4,"long_short_ratio":1.08,"long_short_ratios":{"Binance":1.08,"OKX":1.11,"Gate.io":1.02},"long_short_spread":0.09,"exchanges":[{"exchange":"Binance","oi_contracts":4066123.5,"oi_change_1h_pct":1.2,"oi_change_24h_pct":12.4,"long_short_ratio":1.08}],"source":"binance/bybit/okx + gate/bitget (L/S)","primary":"binance"}

Price: $0.000 USDC per call
- **orderbook_depth** — Get real bid/ask depth and slippage estimates at $10k, $50k, and $250k notional from Binance, Bybit and OKX. Use before sizing a position to know if you can execute without moving the market.

Use when: You need to estimate slippage before executing a large trade. Tells you how much a $10k, $50k, or $250k order will move the market.
Not for: you need market cap or 24h volume — token_market_data; a full pre-trade verdict at your size — pre_trade_check. Centralised-exchange books (Binance/Bybit/OKX) only, not DEX pools.
Returns: best_bid, best_ask, spread_pct, depth with slippage_pct at $10k/$50k/$250k notional, per-exchange best prices
Example response: {"asset":"ETH","pair":"ETH/USDT","best_ask":2071.5,"best_bid":2071.2,"spread_pct":0.0145,"depth":[{"notional_usd":10000,"slippage_pct":0.002,"executable":true},{"notional_usd":50000,"slippage_pct":0.008,"executable":true},{"notional_usd":250000,"slippage_pct":0.031,"executable":true}],"exchanges":[{"exchange":"Binance","best_ask":2071.5,"best_bid":2071.2},{"exchange":"Bybit","best_ask":2071.6,"best_bid":2071.1}],"source":"binance/bybit/okx"}

Price: $0.000 USDC per call
- **wallet_balance** — Get the token balances for any Ethereum or Stellar wallet address

Use when: You need to look up the token holdings of an Ethereum or Stellar wallet address.
Not for: you want a token's price or market data rather than one address's holdings — token_price / token_market_data; large transfers across many wallets — whale_activity. Ethereum addresses are 0x…, Stellar addresses G…; no other chains.
Returns: list of token balances (symbol, amount) for the given address
Example response: {"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","chain":"ethereum","balances":[{"token":"ETH","amount":"1.234"},{"token":"USDC","contract":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","amount":"500.00"}]}

Price: $0.000 USDC per call
- **fear_greed_index** — Crypto Fear & Greed Index (0=extreme fear, 100=extreme greed) with optional history

Use when: You need to gauge overall crypto market sentiment or mood — whether the market is fearful or greedy.
Not for: you want token-specific sentiment — crypto_news (per-token headlines) or funding_rates (leveraged positioning).
Returns: value (0–100), value_classification (e.g. 'Greed'), optional history[]
Example response: {"value":10,"value_classification":"Extreme Fear","timestamp":1774137600,"source":"alternative.me"}

Price: $0.000 USDC per call
- **crypto_news** — Latest crypto news and community sentiment from r/CryptoCurrency for any token

Use when: You need recent news headlines or community sentiment for one or more crypto tokens.
Not for: you need general web news or documentation — web_search; a specific article's text — url_reader; a numeric sentiment gauge — fear_greed_index.
Returns: headlines[] with title, url, sentiment (bullish/neutral/bearish), score, published_at
Example response: {"currencies":"ETH","headlines":[{"title":"Ethereum devs confirm Pectra upgrade timeline","url":"https://reddit.com/r/CryptoCurrency/...","sentiment":"bullish","score":1842,"published_at":"2026-03-22T08:14:00Z"},{"title":"ETH gas fees drop to yearly lows","url":"https://reddit.com/r/CryptoCurrency/...","sentiment":"bullish","score":934,"published_at":"2026-03-22T06:31:00Z"}],"source":"reddit"}

Price: $0.000 USDC per call
- **defi_tvl** — DeFi protocol Total Value Locked from DeFiLlama. Returns top 10 or a specific protocol.

Use when: You need the Total Value Locked in a specific DeFi protocol or want to compare the top protocols by TVL.
Not for: you want the best yield for a token — yield_scanner; protocol revenue or custom metrics — dune_query.
Returns: tvl, change_1h, change_1d, change_7d, chains[], category for the protocol (or top 10 list)
Example response: {"protocol":"aave","tvl":23800000000,"change_1h":0.12,"change_1d":-1.43,"change_7d":3.21,"chains":["Ethereum","Polygon","Avalanche","Base"],"category":"Lending","source":"defillama"}

Price: $0.000 USDC per call
- **token_market_data** — Get market cap, 24h volume, ATH, and price change for any token. Note: does NOT return pool depth or slippage — for pre-trade liquidity estimates, use a dedicated orderbook tool.

Use when: You need 24h trading volume, market cap, or all-time high for a token pair on decentralized exchanges.
Not for: you only need the spot price — token_price is lighter; you need pool depth or slippage — orderbook_depth.
Returns: volume_24h_usd, market_cap_usd, price_usd, ath_usd, price_change_24h_pct
Example response: {"token_a":"ETH","token_b":"USDC","price_usd":2071.45,"volume_24h_usd":312847293,"volume_change_24h_pct":-8.3,"market_cap_usd":249800000000,"ath_usd":4878.26,"price_change_24h_pct":-3.91,"source":"coingecko"}

Price: $0.000 USDC per call
- **token_security** — Scan any token contract for honeypot, rug pull, and security risks

Use when: You need to check if a token contract is safe before trading or investing.
Not for: the asset is a native coin (BTC, ETH, SOL) with no contract — nothing to scan; you want liquidity or price — orderbook_depth / token_price. Ethereum and BSC contracts only.
Returns: risk_level, is_honeypot, buy_tax, sell_tax, holder_count, owner_address, is_mintable, can_take_back_ownership
Example response: {"contract_address":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","chain":"ethereum","risk_level":"low","is_honeypot":false,"buy_tax":0,"sell_tax":0,"holder_count":842341,"is_mintable":false,"can_take_back_ownership":false,"source":"goplus"}

Price: $0.000 USDC per call
- **funding_rates** — Get perpetual futures funding rates across Binance, Bybit, and OKX

Use when: You need funding rates to gauge leveraged market sentiment or cost of holding a perp position.
Not for: you need open interest or long/short ratio — open_interest; one verdict combining funding, OI, slippage and security for a trade — pre_trade_check.
Returns: funding_rate_pct, annualized_rate_pct, sentiment (bullish/neutral/bearish) per exchange
Example response: {"asset":"BTC","rates":[{"exchange":"binance","funding_rate_pct":0.012,"annualized_rate_pct":13.14,"sentiment":"bullish"},{"exchange":"bybit","funding_rate_pct":0.011,"annualized_rate_pct":12.04,"sentiment":"bullish"},{"exchange":"okx","funding_rate_pct":0.009,"annualized_rate_pct":9.85,"sentiment":"neutral"}],"source":"binance/bybit/okx"}

Price: $0.000 USDC per call
- **dune_query** — Run any Dune Analytics query and return live onchain results by query ID. Use fast_only=True for live bots — returns cached result instantly or raises immediately, never blocks.

Use when: You need deep onchain analytics from a specific Dune query — protocol revenue, user counts, custom metrics.
Not for: you have no Dune query ID — the other tools cover prices, derivatives, TVL and security without one; you need sub-second answers — set fast_only=true or use a cached tool.
Returns: rows[], columns[], row_count, generated_at from the Dune Analytics query result
Example response: {"query_id":3810512,"row_count":2,"columns":["protocol","revenue_usd"],"rows":[{"protocol":"Uniswap V3","revenue_usd":1243800},{"protocol":"Aave V3","revenue_usd":987200}],"generated_at":"2026-03-22T00:00:00Z","source":"dune"}

Price: $0.000 USDC per call
- **url_reader** — Convert any URL to clean, LLM-ready markdown. Strips ads, nav, and boilerplate — returns just the content. No API key needed.

Use when: You need to read the content of a web page or article and get clean, structured text for further processing.
Not for: you do not have a URL yet — web_search returns pages with content; the page requires a login or renders only in a browser.
Returns: content (markdown), url, length, truncated flag
Example response: {"url":"https://example.com","content":"# Example Domain\n\nThis domain is for use in illustrative examples...","length":1256,"truncated":false,"source":"jina_reader"}

Price: $0.000 USDC per call
- **web_search** — Search the web and return the top 5 results with their full content as clean markdown. Better than DIY because zero setup and results include page content, not just links.

Use when: You need to find current information on any topic — news, documentation, prices, events, or anything else on the web.
Not for: you already have the URL — url_reader; you want crypto headlines with sentiment — crypto_news.
Returns: results[] with url, title, description, content; query; count
Example response: {"query":"ETH gas fees today","count":5,"results":[{"url":"https://etherscan.io/gastracker","title":"Ethereum Gas Tracker","description":"Real-time Ethereum gas price tracker","content":"Current gas: 2 Gwei..."}],"source":"jina_search"}

Price: $0.000 USDC per call
- **session_create** — Open a budget-capped agent session on AgentPay. Pay $0.01 USDC once — get a session_id, budget config, and gateway URL. Enforces a hard max_spend cap across all subsequent tool calls via the AgentPay SDK. The entry point for agents discovering AgentPay on Base Bazaar.

Use when: You want to start an AgentPay session with a hard spend cap and get a session_id for tracking.
Not for: you only need a session for free tools — the SDK's quickstart() opens one at no cost; this call settles $0.01 on-chain.
Returns: session_id, max_spend, agent_address, gateway_url, tools_endpoint, created_at, receipt (tx_hash + network)
Example response: {"session_id":"f47ac10b-58cc-4372-a567-0e02b2c3d479","max_spend":"0.10","agent_address":"GBCVQCNFWPM3GDO4GPT4YEQ42ZHPY67QTJA3WN5ERQIKQDXKBX62SLNJ","label":null,"gateway_url":"https://agentpay.tools","tools_endpoint":"https://agentpay.tools/tools","created_at":"2026-05-27T12:00:00Z","receipt":{"tx_hash":"0xabc...def","network":"base","amount_usdc":"0.01"},"sdk_hint":"Use `from agentpay import Session` to enforce the max_spend cap client-side."}

Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)
- **market_snapshot** — Fed rate, inflation proxy, S&P 500, BTC, ETH, and gas in one call. Replaces three separate API integrations with a single normalized response — the only tool that gives you macro + crypto in one shot.

Use when: You need a combined macro + crypto market overview in one call: S&P 500, Treasury yield, BTC, ETH, and Ethereum gas.
Not for: you need one asset in depth — token_price, gas_tracker or funding_rates; history or time series — dune_query.
Returns: sp500_price, sp500_change_pct, treasury_yield_10y, btc_price_usd, eth_price_usd, gas_standard_gwei, timestamp
Example response: {"sp500_price":5234.18,"sp500_change_pct":-0.42,"treasury_yield_10y":4.31,"btc_price_usd":67200,"eth_price_usd":3450,"gas_standard_gwei":5.2,"timestamp":"2026-05-26T12:00:00Z","source":"yahoo_finance+coingecko+etherscan"}

Price: $0.000 USDC per call
- **pre_trade_check** — One-call pre-trade sanity check: 'I want to long $X of SYMBOL — is now sane?' Combines live orderbook slippage at YOUR size, cross-exchange funding (carry cost), open-interest crowding, and contract security (GoPlus) into a single ok/caution/avoid verdict with a per-factor breakdown. Major ERC-20 addresses (LINK, UNI, ARB, OP, AAVE, PEPE, SHIB) resolve automatically; native assets (BTC, ETH, SOL, ...) report security n/a; an unrecognized token without token_address reads 'unknown' and caps the verdict at caution — an unscreened contract can never read 'ok'. Replaces four API integrations and the judgment layer on top of them. Raw component data embedded so you can apply your own thresholds. Stacks tokens (STX, sBTC, USDCx, stSTX, ZEST, LEO, USDh, aeUSDC, stBTC) add the Bitflow DEX venue: price impact at YOUR size from a live route quote, the pools and bins the swap crosses, and their TVL; STX and sBTC keep their CEX perp legs, DEX-only tokens report funding/OI n/a and contract risk unscreened (no GoPlus coverage on Stacks).

Use when: An agent (or human) is about to enter a position and wants one verdict covering liquidity, carry, crowding, and security — instead of four raw feeds plus its own synthesis.
Not for: you need a single raw factor — funding_rates, open_interest, orderbook_depth or token_security are free; you are not about to size a position. This call settles $0.01 on-chain.
Returns: verdict (ok/caution/avoid), factors{liquidity,carry,crowding,security} each with level + reason, components{orderbook_depth,funding_rates,open_interest}, symbol, side, size_usd
Example response: {"symbol":"ETH","side":"long","size_usd":50000,"venue":"cex","verdict":"caution","factors":{"liquidity":{"level":"ok","slippage_pct":0.011,"bucket_usd":50000,"reason":"fills within 0.011% of best ask"},"carry":{"level":"caution","median_funding_pct":0.062,"annualized_pct":67.9,"reason":"longs paying elevated funding"},"crowding":{"level":"ok","long_short_ratio":1.4,"oi_change_24h_pct":3.2,"reason":"positioning unremarkable"},"security":{"level":"n/a","reason":"ETH is a native chain asset — no token contract to screen"}},"not_checked":["security"]}

Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)
- **whale_activity** — Detect recent large wallet movements for a token (whale tracking)

Use when: You need to detect large token transfers that may signal institutional moves, accumulation, or sell-offs.
Not for: you need one address's holdings — wallet_balance; exchange order-book size rather than on-chain transfers — orderbook_depth. Ethereum ERC-20 transfers only.
Returns: large_transfers[] with from, to (full addresses), amount, usd_value, minutes_ago, tx_hash; total_volume_usd
Example response: {"token":"USDC","large_transfers":[{"from":"0xabababababababababababababababababababab","to":"0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd","amount":5000000,"usd_value":5000000,"minutes_ago":12,"tx_hash":"0x9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f"},{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","amount":2500000,"usd_value":2500000,"minutes_ago":34,"tx_hash":"0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a"}],"total_volume_usd":7500000,"source":"etherscan"}

Price: $0.000 USDC per call
- **verified_route** — Buyer-side trust oracle for the x402 marketplace: "I need X, budget $Y — which tool is real?" Vets Coinbase Bazaar (discover → drop stubs/factory clones → rank by real unique-payer usage → budget-gate).  This MCP runs the FREE single-query PREVIEW: it returns the vetted pick (name + usage stats + why) and survivor count to PROVE a real provider exists, but WITHHOLDS the provider URL + ready-to-pay x402 challenge. To get those — plus the full multi-query sweep + usage-based sybil-collapse + trust allowlist — fund this install's wallet with USDC on Base and set AGENTPAY_ENABLE_PAID=1 (the paid verified_route costs $0.01), or use the agentpay-x402 SDK. No payment happens while paid mode is off.  Use when: "which x402 tool for X", "find a real/trustworthy paid API for X", "avoid a scam or dead stub", "vet this provider before I pay".
- **route** — Legacy alias of verified_route (kept for back-compat). Find and judge the best paid x402 tool for a need, within a budget. Discovers across Coinbase Bazaar, drops stubs (no schema / factory clones), ranks survivors by real usage (unique payers × 3 + calls + recency bonus), enforces the budget, price- tiebreaks quality-equal candidates. Returns ranked candidates + a recommendation + ready-to-pay details. Advise-only — no payment happens here. Prefer verified_route (same vetting, matches the paid tool + Bazaar listing).  Use when: "which x402 tool for X", "find a paid API for X under $Y".
- **estimate_plan** — Price a multi-tool plan BEFORE spending anything. Submits the tool calls an agent intends to make to the gateway's free /v1/plan/estimate and returns per-step cost, total, a fits-budget verdict, and a cheaper alternative per paid step. No payment, no wallet needed.  Use when: planning a multi-step task with paid tools, "what would this cost", "does this plan fit my budget", or before committing a Session cap.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "agentpay": {
    "command": "npx",
    "args": ["-y","@romudille/agentpay-mcp"],
    "env": {
      "AGENTPAY_ENABLE_PAID": ""
    }
  }
}
```

**Requires environment variables:** `AGENTPAY_ENABLE_PAID` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What agentpay does

agentpay combines finance and web-research tools with controls for agent spending. Its free tools cover token prices, Ethereum gas, market snapshots, wallet balances, DeFi TVL and yields, derivatives metrics, order-book depth, token security, crypto news, Dune results, URL reading, and web search. The service also exposes tools for finding and evaluating paid x402 services.

The main use case is an agent that needs current crypto information while keeping tool costs explicit. A session can enforce a maximum spend, record each call, and produce a receipt containing costs, timestamps, transaction hashes, and settlement networks. The SDK can also estimate a multi-tool plan before spending and suggest cheaper alternatives for paid steps.

## How it works

The Python quickstart registers an agent, creates a wallet, and returns a budget-capped session. A session may use the managed wallet or a caller-supplied wallet, with a maximum spend such as `0.50`. Calls are session-tracked, and the cap is checked before a payment is signed.

Free tools can be used without USDC, a wallet, or API keys through `quickstart()`. Paid calls use x402 over MCP: an unpaid request returns `PaymentRequired`, and payment is supplied through `_meta` with `x402/payment`. Supported settlement paths include USDC on Base and Stellar, plus sBTC on Stacks mainnet.

## Setup and configuration

Install the Python package with:

```bash
pip install agentpay-x402
```

Use the `[base]` extra for payment tools that settle on Base, or `[stacks]` for the Stacks/sBTC option. A minimal session can be created as follows:

```python
from agentpay import quickstart

session = quickstart(max_spend="0.50")
result = session.call("token_price", {"symbol": "ETH"})
```

Sessions can be configured with an allowed-tool list, per-tool limits, a call rate limit, a preferred chain, permitted recipients, a per-call maximum, and an approval threshold. `estimate_plan()` prices a sequence before execution, while `remaining_usd()`, `would_exceed()`, and `spending_summary()` expose budget state and receipts.

## Tools and capabilities

- Retrieve token prices, market capitalization, 24-hour changes, trading volume, all-time highs, and sentiment.
- Inspect Ethereum gas, perpetual funding, open interest, long/short ratios, and centralized-exchange order-book depth.
- Compare DeFi protocol TVL and token yield pools, including APY, chain, TVL, and heuristic risk level.
- Check Ethereum and BSC token contracts for honeypots, taxes, minting, ownership, and holder data.
- Read wallet balances on Ethereum or Stellar and track large Ethereum ERC-20 transfers.
- Search the web, extract clean page markdown, query Dune results, and read crypto headlines with sentiment.
- Run a pre-trade verdict combining liquidity, funding, crowding, and contract checks; Stacks assets can include Bitflow route data.
- Discover paid x402 services with `verified_route`, estimate planned costs with `estimate_plan`, and open a paid session with `session_create`.

## Limitations and notes

`wallet_balance` supports Ethereum and Stellar addresses only. `token_security` covers Ethereum and BSC contracts, while `whale_activity` covers Ethereum ERC-20 transfers. `orderbook_depth` uses centralized-exchange books from Binance, Bybit, and OKX rather than DEX pools, and `gas_tracker` reports Ethereum mainnet gas.

`verified_route` has a free preview that withholds the provider URL and ready-to-pay challenge. Paid mode requires funding the install wallet on Base and setting `AGENTPAY_ENABLE_PAID=1`; the paid call costs $0.01. `route` remains as a legacy alias. `session_create` and `pre_trade_check` also cost $0.01, while the listed data and research tools are free.

_Full upstream README: https://allmcps.com/mcp/agentpay-5/readme_

