FuinDocs

Overview

Fuin is a programmable authorization layer on Solana. It lets you create on-chain vaults, deposit funds, and issue scoped delegate keys to AI agents — with spending caps, permission controls, and policy constraints enforced entirely on-chain.

Your agent can transfer SOL, send SPL tokens, and execute swaps — but only within the boundaries you set. You stay in control.

How It Works

1. Create a Vault
Connect your wallet and create an on-chain vault. This is a PDA that holds your funds and enforces all policies.
2. Fund the Vault
Send SOL (or SPL tokens) to your vault address. The vault is the source of all agent transactions.
3. Issue a Delegate Key
Generate a keypair for your AI agent and issue a delegate with specific permissions, spending limits, and expiry.
4. Connect Your Agent
Configure the Fuin MCP server in your AI client (Claude, Cursor, etc.) with the delegate private key. The agent can now operate within your policy constraints.

Getting Started

What You Need

Step 1: Create a Vault

  1. Go to the Fuin Dashboard
  2. Connect your wallet (make sure it's set to Devnet)
  3. Click Create Vault
  4. Your vault PDA address will be displayed — copy it

Step 2: Fund the Vault

Send SOL to your vault PDA address from your wallet. The vault is the source of all agent transactions.

Step 3: Generate an Agent Keypair

Your AI agent needs its own keypair. The public key gets registered as a delegate, and the private key is used by the MCP server to sign transactions.

Terminal
# Generate a new keypair for your agent
solana-keygen new -o agent-key.json

# Note the public key — you'll paste it when issuing the delegate
solana address -k agent-key.json

# Get the base58 private key (needed for MCP server config)
node -e "
const bs58 = require('bs58');
const raw = require('./agent-key.json');
console.log(bs58.encode(Buffer.from(raw)));
"

# Fund the agent wallet (it pays transaction fees)
solana airdrop 1 $(solana address -k agent-key.json)

Step 4: Issue a Delegate

  1. Go to your vault in the Dashboard
  2. Click Issue Delegate
  3. Paste the agent's public key
  4. Choose permissions (e.g. Transfer, Swap)
  5. Set a spending cap and expiry
  6. Submit — the delegate is created on-chain

After creation, the dashboard shows a Quick Start card with the exact MCP config to copy into your AI client.

Connect Your AI Agent

The Fuin MCP server lets AI coding assistants (Claude Desktop, Cursor, Claude Code) interact with your vault directly. It exposes tools for balance checks, transfers, and swaps — all enforced by on-chain policies.

Install via npm — no server to deploy. The MCP server runs locally on the user's machine and communicates via stdio.

Install
npx -y @fuin-labs/mcp-server

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

claude_desktop_config.json
{
  "mcpServers": {
    "fuin": {
      "command": "npx",
      "args": ["-y", "@fuin-labs/mcp-server"],
      "env": {
        "DELEGATE_PRIVATE_KEY": "<base58-encoded-secret-key>",
        "SOLANA_RPC_URL": "https://api.devnet.solana.com"
      }
    }
  }
}

Claude Code

Add to .claude/settings.json in your project root:

.claude/settings.json
{
  "mcpServers": {
    "fuin": {
      "command": "npx",
      "args": ["-y", "@fuin-labs/mcp-server"],
      "env": {
        "DELEGATE_PRIVATE_KEY": "<base58-encoded-secret-key>",
        "SOLANA_RPC_URL": "https://api.devnet.solana.com"
      }
    }
  }
}

Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

mcp.json
{
  "servers": {
    "fuin": {
      "command": "npx",
      "args": ["-y", "@fuin-labs/mcp-server"],
      "env": {
        "DELEGATE_PRIVATE_KEY": "<base58-encoded-secret-key>",
        "SOLANA_RPC_URL": "https://api.devnet.solana.com"
      }
    }
  }
}

Environment Variables

VariableRequiredDefaultDescription
DELEGATE_PRIVATE_KEYYesBase58-encoded secret key of the delegate keypair
SOLANA_RPC_URLNohttps://api.devnet.solana.comSolana RPC endpoint

Available Tools

The MCP server exposes the following tools. All destructive operations are validated on-chain by the policy engine.

ToolDescriptionType
get-balanceGet vault SOL balance, state, spending caps, and program allow/deny listsRead-only
get-delegate-infoGet delegate permissions, limits, usage, expiry, and statusRead-only
list-delegatesList all delegates issued to this agent's keypairRead-only
transfer-solExecute SOL transfer from vault using delegate permissionsDestructive
transfer-splExecute SPL token transfer from vault. Supports Pyth price feeds for USD valuationDestructive
swapExecute token swap on Meteora DLMM from vault. Requires DLMM program in allow-listDestructive
request-programRequest guardian to add a program to the vault's allow-listRequest

What Agents Can Do

SOL Transfer

Once the MCP server is configured, ask your AI assistant to transfer SOL:

Prompt
Transfer 0.01 SOL to <destination pubkey>

The assistant will use the transfer-sol tool. The on-chain policy engine enforces permissions and spending limits automatically.

SPL Token Transfer

First, ensure the vault has tokens. Fund it using the CLI:

Terminal
# Send tokens to the vault ATA (creates it if needed)
spl-token transfer <MINT_ADDRESS> 500000 <VAULT_PDA> --fund-recipient

Then ask your assistant:

Prompt
Transfer 1 token of mint <MINT_ADDRESS> to <destination pubkey>

The MCP server automatically creates the destination ATA if it doesn't exist.

Swap (Meteora DLMM)

Swaps require the CAN_SWAP permission and the Meteora DLMM program in the vault's allow-list. Ask your assistant:

Prompt
Swap 1 token of mint <INPUT_MINT> on pool <POOL_ADDRESS> with 1% slippage

The policy engine validates the CAN_SWAP permission, checks spending limits, and verifies the target program is in the vault's allow-list.

Policy Guardrails

The on-chain policy engine enforces all constraints at the program level. Here are common failure scenarios that demonstrate the safety net:

Exceed Spending Cap

Prompt:"Transfer 100 SOL to <destination>"
Result:DailyLimitExceeded
The delegate's spending cap is enforced per Solana epoch (~2-3 days on devnet).

Wrong Permission

Setup:Delegate has only CAN_SWAP (1), no CAN_TRANSFER
Prompt:"Transfer 0.1 SOL to <destination>"
Result:PermissionDenied

Paused Delegate

Setup:Guardian pauses the delegate from the dashboard (status = 1)
Prompt:Any action
Result:DelegateInactive
Pausing is reversible. Revoking (status = 0) is permanent.

Managing Delegates

From the Guardian Dashboard you can pause, resume, or permanently revoke delegates at any time.

CodeActionReversible
0Revoke (permanent)No
1PauseYes
2ResumeYes

Pausing a delegate immediately blocks all actions. The guardian can resume later. Revoking is permanent — the delegate key can never be reactivated.

Reference

Network

Fuin is currently live on Solana Devnet. Make sure your wallet and RPC are set to devnet.

Permissions

PermissionWhat It Allows
CAN_SWAPToken swaps on approved DEX programs
CAN_TRANSFERSOL and SPL token transfers to any address
CAN_STAKEStaking operations (coming soon)
CAN_LPLiquidity provision (coming soon)

Permissions are combined. For example, a delegate with CAN_SWAP + CAN_TRANSFER can do both.

Supported Price Feeds

SPL token transfers use Pyth oracle price feeds for USD valuation:

SOL/USDBTC/USDETH/USDUSDC/USDUSDT/USDBONK/USDJUP/USDRAY/USDWIF/USD

SDK (for developers)

Building a custom integration? The SDK is available on npm:

Install
npm install @fuin-labs/sdk

See the GitHub repository for SDK documentation and examples.

Program ID

E6GkTAh6m3DacsKuUKQ64gn85mZof4D96dTNPLQAoSiy

Built on Solana. Powered by Pyth Network and Helius.