# Onchain Agent Wallets [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/nirholas/onchain-agent-wallets  
**GitHub Stars:** 9  
**npm Downloads (last month):** 390  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/onchain-agent-wallets

## Description
Give an AI agent a Solana spending allowance instead of your key. Chain-enforced cap, x402.

## Tools
Capabilities this server exposes over MCP:

- **create_agent_wallet** — Generate the agent's keypair, create the vault, delegate a capped allowance, set guardrails. One call.
- **fund_agent_wallet** — Move tokens into the vault, and SOL to the agent for its fees.
- **approve_agent_allowance** — Raise, lower, or refill the on-chain ceiling. Replaces the previous allowance.
- **withdraw_from_vault** — Take funds back. Works with or without a live delegation.
- **revoke_agent_wallet** — The kill switch. Optionally sweeps the balance home in the same transaction.
- **send_signed_transaction** — Broadcast a transaction your wallet signed.
- **set_guardrails** — per_tx, daily, allow_recipients, allow_hosts, expires_at, confirm_over, paused. Instant, free, no transaction.
- **agent_pay** — Send tokens to a recipient, inside the limits.
- **pay_x402** — Call an x402 API, paying from the allowance.
- **agent_wallet_status** — Live on-chain state, guardrails, 24h and 7d totals, and warnings.
- **list_agent_wallets** — Every agent, with live balances.
- **spend_log** — The audit trail, refusals included.
- **deploy_agent_onchain** — Mint the agent a Metaplex Agent Registry identity with its payment address in the on-chain attributes.
- **export_agent_runtime** — The mcp.json and identity card needed to run this agent somewhere else.

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

```json
"mcpServers": {
  "onchain-agent-wallets": {
    "command": "npx",
    "args": ["-y","@three-ws/onchain-agent-wallets"]
  }
}
```

## Documentation

## What Onchain Agent Wallets does

Onchain Agent Wallets MCP server manages delegated spending for AI agents on Solana. The owner retains the vault and its funds, while the agent receives its own keypair and a capped SPL Token delegation. The delegation limits what the agent can spend at the token-program level; the agent does not receive the owner's private key or ownership of the vault.

The server supports token funding, allowance changes, withdrawals, revocation, ordinary recipient payments, and x402 API payments. It also records spending activity and refusals, reports current balances and limits, and can create an on-chain Metaplex Agent Registry identity for an agent. Runtime export produces the MCP configuration and identity card needed to operate the agent elsewhere.

## How it works

Creating an agent wallet generates an agent keypair, creates a vault, applies an allowance, and configures guardrails. The owner can optionally transfer tokens into the vault and SOL to the agent for transaction fees. Agent spending reduces the delegated amount enforced by the SPL Token program. The agent cannot raise its own allowance, withdraw from the vault, or change the vault owner.

Local checks add controls around the on-chain ceiling. Supported rules include a maximum per transaction, a rolling 24-hour limit, recipient and x402 host allowlists, an expiration time, a pause switch, and a confirmation threshold. These checks depend on the server's local state and ledger, while the allowance and vault balance remain on-chain controls.

`pay_x402` checks an endpoint before payment, determines the requested price, and then pays from the allowance when the request satisfies the configured limits. It rejects unsupported chains, cluster mismatches, non-denominated assets, and prices above its per-call maximum.

## Setup and configuration

Install the package globally or run it with `npx`:

```bash
npm install -g @three-ws/onchain-agent-wallets
npx -y @three-ws/onchain-agent-wallets
```

The server uses stdio and can be added to Claude Code with its MCP command or configured in an MCP client's `mcp.json`. No owner key is needed to start. Without `OWNER_SECRET_KEY`, owner actions return unsigned transactions for signing in a wallet; with that variable set, the server can sign for the owner.

Configuration variables are:

- `OAW_NETWORK`: `mainnet` or `devnet`; defaults to `mainnet`.
- `SOLANA_RPC_URL`: an HTTPS Solana RPC endpoint; the public endpoint is the default.
- `OAW_STATE_DIR`: location for keypairs, guardrails, and the spend ledger; defaults to `~/.onchain-agent-wallets`.
- `REQUIRE_CONFIRM`: defaults to `true` and requires `confirm:true` for value-moving tools.

## Tools and capabilities

Onchain Agent Wallets MCP server exposes tools in five practical groups:

- **Wallet custody:** create wallets, fund vaults, approve or replace allowances, withdraw funds, revoke agents, and broadcast owner-signed transactions.
- **Guardrails:** update spending limits, allowlists, expiry, confirmation thresholds, and pause state.
- **Agent spending:** send tokens to a recipient or pay an x402 endpoint.
- **Visibility:** inspect one wallet's live state, list wallets and balances, and read the spend ledger, including refusals.
- **Deployment:** register an agent on-chain through the Metaplex Agent Registry and export its runtime configuration.

## Limitations and notes

The local guardrails are not the same as the on-chain allowance. If the machine running the server is compromised, local rules may be bypassed, but the SPL Token delegation still limits the delegated spend. The documentation therefore recommends keeping the allowance to the smallest workable amount and topping it up when needed.

The agent needs some SOL for fees, but its keypair is intended to hold no other funds. Revocation can set the delegation to zero and may sweep the balance back to the owner in the same transaction. Changing the allowance requires an owner-signed approval. State, guardrails, and the spend ledger are stored locally and separately by network.

_Full upstream README: https://allmcps.com/mcp/onchain-agent-wallets/readme_

