Skip to main content
FibX includes a built-in Model Context Protocol (MCP) server that exposes DeFi operations as callable tools. AI editors like Cursor, Claude Desktop, Antigravity, and any MCP-compatible client can connect to FibX and execute trades, transfers, and DeFi operations through natural language.

Quick Start

This starts an MCP server over stdio (standard input/output). The server speaks JSON-RPC 2.0 and is designed to be launched by an AI editor, not run manually.

How It Works

  1. Your AI editor spawns npx fibx mcp-start as a subprocess.
  2. The editor communicates with FibX over stdin/stdout using JSON-RPC 2.0 messages.
  3. Wallet-dependent tools read the local session file. Run fibx auth login or fibx auth import before using those tools; public tools such as quotes and Aave market discovery do not need a session.
  4. Transactional tools execute against live blockchains and carry the MCP destructiveHint annotation. A client may use that hint to request confirmation, depending on its behavior and configuration.
stderr is used for logging, while stdout is reserved for JSON-RPC protocol messages.

Editor Setup

Add the FibX MCP server to your AI editor. FibX uses stdio transport — the editor spawns npx fibx mcp-start and communicates over standard input/output.
Open MCP settings with Command + Shift + P and search for “Open MCP settings”. Create or edit .cursor/mcp.json in your project root:
Test by asking Cursor: “What tools do you have available?” — it should list the FibX MCP server.
You must be authenticated before the MCP server can execute wallet operations. Use fibx auth login or fibx auth import to authenticate.

Available Tools

FibX exposes 11 tools. The reference below groups them by read-only, transactional, and utility behavior.

Read-Only

get_quote needs no wallet and no session. An agent can answer “what would 1 ETH get me in USDC?” before the user has authenticated at all — useful as a first interaction.

Transactional

These tools carry the MCP destructiveHint annotation. Clients may use the hint to request confirmation, but confirmation behavior is client-dependent. All three accept simulate=true; its behavior is specific to each tool.
simulate=true returns a no-broadcast preview, but the available checks differ by tool. If a swap needs ERC-20 approval, the preview reports requiresApproval: true without submitting the approval or estimating swap gas. aave_action returns normalized request metadata without on-chain validation or a gas estimate. A preview does not guarantee that later execution will succeed.

Utility

Tool Details

get_quote

Get a swap quote without a wallet or session. Output: Routed swaps return input, output, rate, slippage, router, and chain. Direct native/wrapped-native pairs return input, output, rate, operation (wrap or unwrap), and chain.

get_auth_status

Check whether FibX is authenticated and the Fibrous API is reachable. Output: Object with authenticated, walletAddress, sessionType, chain, fibrousStatus

get_balance

Fetch token balances for the active wallet. The native-token entry is returned even when its balance is zero; ERC-20 entries are limited to non-zero balances. Output: Object with wallet, chain, and balances (e.g. ETH, USDC with amounts)

get_portfolio

Get a consolidated portfolio across all supported chains, including USD-valued token holdings and DeFi positions. Output: Object with total portfolio USD value, per-chain assets, and DeFi position summaries Example prompts: “Show me my portfolio” or “What’s my total net worth across all chains?“

swap_tokens

Execute a token swap through Fibrous. Handles routing and any required ERC-20 approval. Execution output: txHash, amountIn, amountOut, tokenIn, tokenOut, router, chain, and explorer when available. Preview output: Direct wrap/unwrap previews return success, mode, operation, amountIn, tokenIn, tokenOut, and chain. Routed previews also return amountOut, router, and requiresApproval; estimatedGas is included only when the swap can be estimated without first broadcasting an approval.
A live routed ERC-20 swap may confirm an approval transaction before estimating and submitting the swap. If the later swap step fails, that approval remains on-chain. simulate=true broadcasts neither transaction.
Example prompt: “Swap 0.1 ETH to USDC on Base”

send_tokens

Transfer native or ERC-20 tokens. Execution output: txHash, amount, token, recipient, chain, and explorer when available. Preview output: Both paths return success, mode, amount, token, recipient, and chain. Native-token previews also return estimatedGas; ERC-20 previews validate the transfer contract call without a gas field. Example prompt: “Send 50 USDC to 0x1234…“

get_tx_status

Look up a transaction receipt by hash. Output: Object with hash, status, blockNumber, from, to, gasUsed, chain, and explorer when available.

get_aave_status

Get Aave V3 account health on Base. Output: Object with wallet, healthFactor, totalCollateralUSD, totalDebtUSD, availableBorrowsUSD

get_aave_markets

List Aave V3 reserve markets on Base. No wallet or session is required. Output: Object with chain, marketCount, and markets. Each market includes symbol, supplyAPY, borrowAPY, totalSupply, totalBorrow, ltv, and isFrozen.

aave_action

Execute an Aave V3 operation on Base. ETH supply and repay can auto-wrap, ETH withdraw can auto-unwrap, and borrowing the ETH market returns WETH. Use max only for full repay or withdraw. Execution output: action, amount, token, txHash, chain, and explorer when available. A repay with no remaining debt instead returns status and no transaction hash. Preview output: success, mode (PREVIEW (no TX sent)), action, amount, token, chain, and note. The note states that no on-chain validation, gas estimate, or transaction was performed.
Live wrap, approval, Aave, and unwrap steps are separate transactions, so an earlier step remains on-chain if a later one fails. For an ETH withdrawal, the output transaction hash identifies the Aave withdrawal transaction, not the separate unwrap transaction. With action: "withdraw", amount: "max", and token: "ETH", FibX unwraps the wallet’s entire post-withdraw WETH balance, including WETH held before the request.
Example prompts: “Supply 0.5 ETH to Aave” or “Repay max USDC on Aave”

config_action

Manage custom RPC URLs. Useful when encountering rate limits on public endpoints. Output: Object with action, chain, url, or rpcUrls depending on the action Example prompts: “I’m getting rate limited on Base, set a custom RPC” or “Reset all RPCs to default”

Supported Chains

Environment Variables

If using Privy authentication, ensure fibx-server is running and accessible before starting the MCP server.

Troubleshooting