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
Getting Started
What You Need
- A Solana wallet (Phantom, Solflare, etc.) set to Devnet
- Some devnet SOL — use a faucet or
solana airdrop 2 - Node.js 18+ installed (for running the MCP server)
Step 1: Create a Vault
- Go to the Fuin Dashboard
- Connect your wallet (make sure it's set to Devnet)
- Click Create Vault
- 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.
# 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
- Go to your vault in the Dashboard
- Click Issue Delegate
- Paste the agent's public key
- Choose permissions (e.g. Transfer, Swap)
- Set a spending cap and expiry
- 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.
npx -y @fuin-labs/mcp-serverClaude Desktop
Add to ~/Library/Application Support/Claude/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:
{
"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:
{
"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
| Variable | Required | Default | Description |
|---|---|---|---|
DELEGATE_PRIVATE_KEY | Yes | — | Base58-encoded secret key of the delegate keypair |
SOLANA_RPC_URL | No | https://api.devnet.solana.com | Solana RPC endpoint |
Available Tools
The MCP server exposes the following tools. All destructive operations are validated on-chain by the policy engine.
| Tool | Description | Type |
|---|---|---|
get-balance | Get vault SOL balance, state, spending caps, and program allow/deny lists | Read-only |
get-delegate-info | Get delegate permissions, limits, usage, expiry, and status | Read-only |
list-delegates | List all delegates issued to this agent's keypair | Read-only |
transfer-sol | Execute SOL transfer from vault using delegate permissions | Destructive |
transfer-spl | Execute SPL token transfer from vault. Supports Pyth price feeds for USD valuation | Destructive |
swap | Execute token swap on Meteora DLMM from vault. Requires DLMM program in allow-list | Destructive |
request-program | Request guardian to add a program to the vault's allow-list | Request |
What Agents Can Do
SOL Transfer
Once the MCP server is configured, ask your AI assistant to transfer SOL:
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:
# Send tokens to the vault ATA (creates it if needed)
spl-token transfer <MINT_ADDRESS> 500000 <VAULT_PDA> --fund-recipientThen ask your assistant:
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:
Swap 1 token of mint <INPUT_MINT> on pool <POOL_ADDRESS> with 1% slippageThe 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
Wrong Permission
CAN_SWAP (1), no CAN_TRANSFERPaused Delegate
Managing Delegates
From the Guardian Dashboard you can pause, resume, or permanently revoke delegates at any time.
| Code | Action | Reversible |
|---|---|---|
| 0 | Revoke (permanent) | No |
| 1 | Pause | Yes |
| 2 | Resume | Yes |
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
| Permission | What It Allows |
|---|---|
CAN_SWAP | Token swaps on approved DEX programs |
CAN_TRANSFER | SOL and SPL token transfers to any address |
CAN_STAKE | Staking operations (coming soon) |
CAN_LP | Liquidity 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:
SDK (for developers)
Building a custom integration? The SDK is available on npm:
npm install @fuin-labs/sdkSee the GitHub repository for SDK documentation and examples.
Program ID
E6GkTAh6m3DacsKuUKQ64gn85mZof4D96dTNPLQAoSiyBuilt on Solana. Powered by Pyth Network and Helius.