Factor MCP Server
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | Logging level: debug, info, warn, or error. | |
| DEFAULT_CHAIN | No | Default chain. Valid values: ARBITRUM_ONE, BASE, MAINNET. | |
| STATELESS_MODE | No | Set to true to enable stateless/gateway mode, where each tool call carries its own chainId and environment parameters. Default is stdio mode. | |
| ALCHEMY_API_KEY | Yes | Alchemy API key for RPC access. | |
| SIMULATION_MODE | No | Set to true to enable dry-run/simulation mode. | |
| FACTOR_ENVIRONMENT | No | Factor environment: production, staging, or testing. | |
| FACTOR_ARTIFACTS_DIR | No | Directory to persist generated forge scripts, useful in Docker/ephemeral environments. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Factor MCP Server — DeFi vault management on Factor Protocol.
Getting started:
Use factor_get_config to check current chain, wallet, and environment.
Use factor_wallet_setup to create or import a wallet — you MUST include model_name with your own LLM model ID (e.g., "claude-opus-4-6", "gpt-4o", "grok-4.1").
ALWAYS call factor_vault_templates with NO parameters first when creating a vault. This returns a guided questionnaire with available vault types and tokens fetched live from the chain. Present the questions to the user, collect their answers, then call factor_vault_templates again with vaultType, strategyTokens, and depositWithdrawTokens to get the final template. Do NOT skip the questionnaire — even if the user mentions a specific token or protocol, use the guided flow so they can see all available options and confirm their choices.
Follow the workflow from factor_vault_templates: approve the token, then create the vault.
If the wallet has no funds and you need to simulate, call factor_create_vault directly (skip approval) — it returns an INSUFFICIENT_ALLOWANCE error with a simulationHint containing a ready-to-use Solidity forge script. Pass that scriptContent directly to factor_run_forge_script. Do NOT try to write forge scripts from scratch — always use the pre-built script from the simulationHint.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| factor_set_chainA | Set the active blockchain network for Factor Protocol operations. Supported chains: ARBITRUM_ONE (default), BASE, MAINNET (Ethereum), ROBINHOOD (4663). |
| factor_set_rpcB | Configure a custom RPC endpoint for blockchain interactions. Overrides the default Alchemy RPC. |
| factor_get_configA | Get the current Factor MCP server configuration including active chain, RPC endpoint, simulation mode, and wallet info. |
| factor_wallet_setupB | Import or generate a wallet. REQUIRES model_name (your LLM model ID, e.g. "claude-opus-4-6", "gpt-4o"). Optionally encrypt with a password. Stored securely in ~/.factor-mcp/wallets/ |
| factor_get_address_bookA | Get the SDK address book (Pro adapters only) for the current chain and environment. Returns all known Pro contract addresses including adapters, accounting adapters, factory, and protocol addresses. Use this to find the correct adapter address before adding it to a vault. |
| factor_get_owned_vaultsA | Get all Factor Pro vaults owned by an address. If no address is provided, uses the active wallet address. |
| factor_get_vault_infoB | Get detailed information about a Factor Pro vault including name, symbol, assets, fees, managers, and supported adapters. |
| factor_get_sharesB | Get the user's shares in a vault, including the total supply, price per share, and calculated value. |
| factor_get_executionsB | Get the execution history of a vault, showing all manager transactions with decoded adapter calls. |
| factor_preview_depositA | Preview a deposit to a Factor Pro vault. Returns expected shares to receive. This is a read-only operation. |
| factor_preview_withdrawB | Preview a withdrawal from a Factor Pro vault. Returns expected assets to receive. This is a read-only operation. |
| factor_depositB | Execute a deposit to a Factor Pro vault. Will automatically approve tokens if needed. Requires a configured wallet with sufficient balance. |
| factor_withdrawA | Execute a withdrawal (redeem shares) from a Factor Pro vault. Requires a configured wallet with sufficient share balance. |
| factor_create_vaultA | Deploy a new Factor Studio Pro vault. IMPORTANT: Always call factor_vault_templates first to get ready-to-use createVaultParams. If the task involves lending, call factor_vault_templates with lendingProtocol set (aave/compoundV3/morpho) — each protocol has its own token design and the template pre-configures the correct adapters and tokens. Fees are in percentage (0-100). Requires token approval via factor_give_approval before deployment. |
| factor_execute_managerB | Execute a strategy on a vault as a manager. This allows swapping, lending, borrowing and other DeFi operations within the vault. |
| factor_get_factory_addressesA | Get whitelisted assets, adapters, and their accounting addresses from the factory. Use this to find the correct accounting adapter for an asset before creating a vault. TIP: Pass a "search" address to filter results and get only the matching asset/adapter instead of the full list. |
| factor_validate_vault_configA | Validate vault configuration before deployment. Checks if all adapters, assets, and accounting addresses are whitelisted in the factory. |
| factor_add_adapterA | Add a manager adapter to a Factor Pro vault. This allows the vault to interact with specific DeFi protocols (e.g., Uniswap, Aave, Pendle). Use factor_get_factory_addresses to see available adapters. |
| factor_vault_templatesA | ALWAYS call this with NO parameters first when creating a vault. Returns a guided questionnaire with vault types and available tokens fetched live from the chain. You MUST present the questions to the user, collect their answers, then call this tool again with vaultType, strategyTokens, and depositWithdrawTokens to get the final template. Do NOT skip the questionnaire even if the user mentions a specific protocol or token — always let them see the options and confirm. The only exception is if you are resuming a previous flow where the user already answered the questions. |
| factor_set_withdraw_feeA | Set the withdraw fee for a Factor Pro vault. Fee is in basis points (0-10000, where 10000 = 100%). Only callable by vault owner. |
| factor_set_deposit_feeB | Set the deposit fee for a Factor Pro vault. Fee is in basis points (0-10000, where 10000 = 100%). Only callable by vault owner. |
| factor_set_performance_feeA | Set the performance fee for a Factor Pro vault. Fee is in basis points (0-10000, where 10000 = 100%). Only callable by vault owner. |
| factor_set_management_feeA | Set the annual management fee for a Factor Pro vault. Fee is in basis points (0-10000, where 10000 = 100%). Only callable by vault owner. |
| factor_charge_performance_feeA | Charge the accrued performance fee on a Factor Pro vault. This mints fee shares to the fee receiver. Callable by anyone. |
| factor_set_fee_receiverA | Set the fee receiver address for a Factor Pro vault. All accrued fees (deposit, withdraw, performance, management) are sent to this address. Only callable by vault owner. |
| factor_set_max_capA | Set the maximum deposit cap for a Factor Pro vault. The cap is in the vault denominator token base units (wei). Set to 0 for no cap. Only callable by vault owner. |
| factor_set_max_debt_ratioB | Set the maximum debt ratio for a Factor Pro vault. Ratio is in basis points (0-10000, where 10000 = 100%). Only callable by vault owner. |
| factor_set_price_deviation_allowanceA | Set the cumulative price deviation allowance for a Factor Pro vault. This controls how much price deviation is tolerated before operations are blocked. Value is in basis points (0-10000). Only callable by vault owner or risk manager. |
| factor_add_vault_managerA | Add a manager address to a Factor Pro vault. Managers can execute strategies (swaps, lending, etc.) on the vault via executeByManager. Only callable by vault owner. |
| factor_remove_vault_managerA | Remove a manager address from a Factor Pro vault. The removed address will no longer be able to execute strategies. Only callable by vault owner. |
| factor_set_risk_managerA | Set the risk manager address for a Factor Pro vault. The risk manager can adjust risk parameters like price deviation allowance. Only callable by vault owner. |
| factor_transfer_ownershipA | Transfer ownership of a Factor Pro vault to a new address. The new owner will have full control (fees, managers, risk settings, upgrades). Only callable by the current vault owner. WARNING: This is irreversible. |
| factor_vault_analyticsA | Get detailed vault position breakdown with per-token balances, USD values, APY/APR by protocol (Aave, Compound, Morpho, Pendle, idle tokens), aggregate stats (weighted APY, TVL breakdown, net return), and — when the vault has lending positions — a |
| factor_get_lending_tokensA | Get lending token information from the tokenlist for a specific protocol. Returns aTokens, debt tokens, and underlying asset info needed to set up a vault for lending. Use this BEFORE supplying to a lending protocol to know which tokens (assets/debts) the vault needs. |
| factor_add_vault_tokenA | Add an asset or debt token to a Factor Pro vault using the AssetDebtAdapter via executeByManager. Use this to register aTokens (as assets) or debt tokens (as debts) before lending/borrowing. The accounting address must match a whitelisted pair in the factory (use factor_get_factory_addresses to find the correct one). |
| factor_give_approvalA | Approve an ERC20 token for spending by a spender address (e.g., a vault). This MUST be called before depositing tokens into a vault if the vault does not have sufficient allowance. Use "max" amount for unlimited approval, or specify an exact amount in base units. Always call this before factor_deposit if the vault needs allowance. |
| factor_lend_supplyA | Supply/deposit assets to a lending protocol (Aave, Compound V3, Morpho, or Silo V2) through a Factor vault. Use amount "all" to supply the entire vault balance of the asset. For Morpho, set collateral=true to supply as collateral instead of lending. |
| factor_lend_withdrawA | Withdraw supplied assets from a lending protocol (Aave, Compound V3, Morpho, or Silo V2) through a Factor vault. Use amount "all" to withdraw the entire supplied balance. For Morpho, set collateral=true to withdraw collateral. |
| factor_lend_borrowB | Borrow assets from a lending protocol (Aave, Compound V3, Morpho, or Silo V2) through a Factor vault. Requires collateral to be supplied first. |
| factor_lend_repayB | Repay borrowed assets to a lending protocol (Aave, Compound V3, Morpho, or Silo V2) through a Factor vault. Use amount "all" to repay the entire debt. |
| factor_save_profileA | Save or update the profile for the active wallet address on the Factor Studio Stats API. Set display name, description, profile image (IPFS hash from factor_upload_ipfs), and social links. Requires a configured wallet for signing. |
| factor_get_profileA | Get a profile for an address from the Factor Studio Stats API. If no address is provided, uses the active wallet address. No wallet or signature required. |
| factor_upload_ipfsA | Upload a file to IPFS via the Factor Stats API. Use this to upload profile images and vault logos. Provide either a filePath (local file) or base64-encoded content. Returns an IPFS hash that can be used in factor_save_profile (image field) or factor_save_vault_metadata (logoCID field). |
| factor_save_vault_metadataA | Save or update vault display metadata (name, description, logo) on the Factor Studio Stats API. This information appears on the discover page. Upload a logo image first via factor_upload_ipfs, then pass the IPFS hash as logoCID. Include hash to update existing metadata. |
| factor_list_adaptersA | List available protocol adapters for building strategies. Adapters connect to DeFi protocols like Aave, Morpho, Uniswap, etc. Results are filtered by the current chain. Use adapter IDs with factor_build_strategy or factor_execute_manager. |
| factor_save_strategyA | Save or update a strategy on the Factor Studio Stats API. Requires a configured wallet for signing. The strategy field contains the strategy data (canvas array or steps array). If vault_address is provided, type defaults to "pro-vault" and position_address is set to the same vault_address. Include hash to update an existing strategy. |
| factor_delete_strategyB | Delete a strategy from the Factor Studio Stats API by its hash. Requires a configured wallet for signing. |
| factor_get_strategyA | Get a strategy by its hash or vault address from the Factor Studio Stats API. No wallet or signature required. |
| factor_get_strategiesA | Get all strategies by owner address from the Factor Studio Stats API. If no owner is provided, uses the active wallet address. No signature required. |
| factor_swap_uniswapA | Swap tokens through Uniswap V3 via a Factor vault (exact input). NOT available on Base — use factor_swap_openocean on Base. Supports "all", percentage amounts like "50%", or exact amounts in base units (wei). Fee tiers: 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%). |
| factor_swap_uniswap_exact_outputB | Swap tokens through Uniswap V3 via a Factor vault, specifying the exact output amount desired. Use amountInMax to set the maximum input you are willing to spend, or use "all" to allow spending the entire vault balance of tokenIn. Fee tiers: 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%). |
| factor_swap_openoceanA | Swap tokens through OpenOcean DEX aggregator via a Factor vault. Works on all chains including Base. Automatically fetches the best swap route from OpenOcean. Supports "all" to swap entire vault balance, percentage amounts like "50%", or exact amounts in base units (wei). |
| factor_swap_pendleB | Swap between tokens and Pendle Principal Tokens (PT) or Yield Tokens (YT) via a Factor vault. Directions: tokenToPT, tokenToYT, ptToToken, ytToToken. For tokenToPT and tokenToYT, "all" swaps entire vault balance. |
| factor_lp_create_positionC | Create a concentrated liquidity position through a Factor vault. Supports Uniswap V3 (Ethereum). |
| factor_lp_add_liquidityB | Add liquidity to an existing concentrated liquidity position through a Factor vault. Supports Uniswap V3 (Ethereum). |
| factor_lp_remove_liquidityB | Remove liquidity from a concentrated liquidity position through a Factor vault. Supports Uniswap V3 (Ethereum). Use liquidity "all" to remove all liquidity. |
| factor_lp_collect_feesB | Collect accumulated fees from a concentrated liquidity position through a Factor vault. Supports Uniswap V3 (Ethereum). |
| factor_hl_open_positionB | Open a HyperLiquid perp position (long or short) sized in USD through a Factor vault on HyperEVM (chain 999). Main-dex symbols (BTC, ETH, ...) route on-chain via the HL adapter; HIP-3 builder-dex symbols (xyz:GOLD, xyz:BRENTOIL, xyz:COPPER, xyz:AAPL, ...) route off-chain via the HL Exchange API. |
| factor_hl_close_positionA | Reduce / close a HyperLiquid perp position (reduce-only order) sized in USD through a Factor vault. HyperEVM (chain 999) only. Main-dex symbols (BTC, ETH, ...) route on-chain; HIP-3 builder-dex symbols (xyz:GOLD, xyz:BRENTOIL, ...) route off-chain via the HL Exchange API. |
| factor_hl_set_leverageA | Set leverage and margin mode (cross/isolated) for a HL perp via an off-chain EIP-712 action signed by the vault agent. HyperEVM (chain 999) only. Returns submitted=true (no on-chain tx). |
| factor_hl_add_isolated_marginA | Adjust isolated margin (positive = add, negative = withdraw) on a HL perp position via an off-chain EIP-712 action signed by the vault agent. HyperEVM (chain 999) only. |
| factor_hl_add_api_walletA | Register a HyperLiquid API wallet (agent EOA) for a vault via CoreWriter action 9. The agent is authorized to sign off-chain EIP-712 actions (setLeverage, addIsolatedMargin, etc.) on behalf of the vault. HyperEVM (chain 999) only. |
| factor_hl_deposit_to_perpA | Bridge USDC from a Factor vault on HyperEVM to its HyperLiquid perp account. Amount is in float dollars (e.g. 5.5 = $5.50). HyperEVM (chain 999) only. |
| factor_hl_withdraw_to_evmB | Withdraw USDC from a vault's HyperLiquid perp account back to HyperEVM in one composite batch (perp → spot → EVM bridge). HyperEVM (chain 999) only. |
| factor_hl_get_navA | Read a HyperLiquid-enabled vault's tri-ledger NAV: HyperEVM USDC balance + HL spot USDC + per-dex HL perp account equity (main + every builder dex the vault has equity on). HyperEVM (chain 999) only. |
| factor_hl_get_positionsA | List all active HyperLiquid perp positions held by a Factor vault. Returns size, entry price, leverage, margin mode, and unrealized PnL. HyperEVM (chain 999) only. |
| factor_hl_set_slippage_capA | View the HL adapter's MAX_SLIPPAGE_BPS constant (the hard upper bound any open/close order will accept). Read-only; no on-chain action. HyperEVM (chain 999) only. |
| factor_hl_transfer_to_builder_dexA | Move USDC from a Factor vault's main HL perp ledger to an HIP-3 builder-dex ledger (e.g. xyz). Required before trading xyz:GOLD / xyz:BRENTOIL / xyz:COPPER / ... HyperEVM (chain 999) only. Returns an on-chain executeByManager envelope (CoreWriter action 13). |
| factor_hl_transfer_from_builder_dexA | Sweep USDC from an HIP-3 builder-dex ledger (e.g. xyz) back to the vault's main HL perp ledger. Inverse of factor_hl_transfer_to_builder_dex. HyperEVM (chain 999) only. Returns an on-chain executeByManager envelope (CoreWriter action 13). |
| factor_hl_list_perpsA | List every perp available on a HyperLiquid dex with its metadata + mark price. Pass dex="main" (default) for the 230+ canonical crypto perps, dex="xyz" for the HIP-3 builder dex (xyz:GOLD, xyz:BRENTOIL, xyz:COPPER, xyz:AAPL, ...), or any other builder-dex name. HyperEVM (chain 999) only. |
| factor_hl_list_instrumentsA | List every HyperLiquid instrument a Factor vault can see — perps on the main + builder dexes, plus spot tokens — with category tags, mark price, max leverage, and a |
| factor_hl_search_instrumentA | Fuzzy-search the HyperLiquid instrument catalog for matches against |
| factor_hl_resolve_instrumentA | Resolve a single HyperLiquid instrument by id, qualifiedSymbol, or bare symbol. Throws on ambiguity (same symbol on multiple dexes) or no match. Use |
| factor_hl_compile_openA | Compile (do NOT broadcast) a |
| factor_hl_compile_closeA | Compile (do NOT broadcast) a |
| factor_hl_initialize_builder_dexA | Diagnose + initialise a Factor vault's HyperLiquid user-account on a HIP-3 builder dex. Reads the dex's collateral-token (USDC=0, USDH=360, USDE=235, USDT0=268, ...), calls agentEnableDexAbstraction to flag the master as HIP-3-aware, and polls clearinghouseState for credit. Returns a structured report — if the dex uses non-USDC collateral, surfaces the requirement that the adapter's on-chain transferUsdcBetweenLedgers (hardcoded to USDC) cannot fund it without an adapter upgrade. HyperEVM (chain 999) only. |
| factor_hl_sync_positionA | Reconcile a vault's on-chain activePerpIndices for a single perp against the live HyperLiquid position (read via precompile). Permissionless: the signer does NOT need to be the vault manager. Cannot move funds — only mutates the adapter's internal registry. Use after settlement to converge stored state with HL truth. HyperEVM (chain 999) only. |
| factor_hl_settle_pendingA | Clear a pending HyperLiquid cloid from the vault adapter's pendingActions map. Permissionless on-chain (signer does NOT need to be the vault manager), but gated by MIN_SETTLE_DELAY_BLOCKS=5 — the on-chain call reverts with HL__SettleTooEarly if too few blocks have passed since the action was registered. Cannot move funds. HyperEVM (chain 999) only. |
| factor_hl_cancel_orderA | Cancel a HyperLiquid main-dex perp order by cloid via CoreWriter (on-chain). HyperEVM (chain 999) only. Does NOT move funds — only kills the resting order. For HIP-3 builder-dex orders (xyz:GOLD, ...), use factor_hl_cancel_order_offchain. |
| factor_hl_cancel_order_offchainA | Cancel a HyperLiquid perp order by cloid via the off-chain HL Exchange API. Required for HIP-3 builder-dex orders (xyz:GOLD, etc) which CoreWriter does not route. Does NOT move funds — only kills the resting order. HyperEVM (chain 999) only. |
| factor_hl_place_order_rawB | Advanced HyperLiquid placeOrder with explicit limit price, TIF (Ioc/Alo/Gtc), and reduceOnly. Main-dex symbols (BTC, ETH, ...) route on-chain via CoreWriter; HIP-3 builder-dex symbols (xyz:GOLD, ...) route off-chain via the HL Exchange API. Does NOT move funds to third parties — orders fill into the vault's own positions. HyperEVM (chain 999) only. |
| factor_hl_force_forget_cloidA | OWNER-ONLY emergency cleanup: delete a pending cloid entry from adapter storage WITHOUT the time gate. Use only when HL clearly never processed an order (e.g. CoreWriter silently dropped due to oracle band) and |
| factor_hl_set_max_known_builder_dexA | OWNER-ONLY: bump the on-chain ceiling for |
| factor_hl_spot_sendA | Intra-HL spot transfer (CoreWriter action 6) RESTRICTED TO SELF. Destination is hardcoded to the vault itself in the adapter — this tool CANNOT transfer to a third-party HL account. Vault-to-vault only. Used for shuffling spot tokens between HL ledgers within the vault's own HyperCore accounts. HyperEVM (chain 999) only. |
| factor_hl_list_spot_tokensA | List every HyperLiquid spot token (USDC, HYPE, PURR, bridged equities AAPL/TSLA/NVDA/..., stablecoins) with index, name, szDecimals, weiDecimals and optional evmContract. Read-only — wraps HLVault.listSpotTokens (single spotMeta Info round-trip). Optional substring |
| factor_hl_list_dexesA | Explicit enumeration of HyperLiquid perp dexes (main + HIP-3 builder dexes). By default returns only SDK-supported dexes (main + xyz). Pass |
| factor_hl_vault_statsA | Aggregate analytics snapshot for a HyperLiquid-enabled FACTOR vault: tri-ledger NAV, ERC-4626 share price, open-position aggregates (count, notional, uPnL, margin used, funding accrued), and per-dex margin summary (main + builder dexes). Single dashboard-ready response. HyperEVM (chain 999) only. Read-only. |
| factor_hl_vault_positions_detailA | Detailed open positions for a HyperLiquid FACTOR vault — across main HL dex AND every HIP-3 builder dex the vault has equity on. Each position includes side, leverage, margin mode, entry/mark/liquidation prices, notional USD, unrealized PnL (USD + %), ROE on margin %, margin used, and cumulative funding accrued. HyperEVM (chain 999) only. Read-only. |
| factor_hl_vault_fillsA | Historical trade fills for a HyperLiquid FACTOR vault (HL userFills / userFillsByTime). Each fill: time, coin, dex (main / builder), side, price, size, realized PnL closed, fee. Optional startTime/endTime in unix ms; without a window the call returns recent fills. Optional |
| factor_hl_vault_fundingA | Funding-payment history for a HyperLiquid FACTOR vault (HL userFunding). Each event: time, coin, dex, signed USDC (positive = vault paid funding, negative = vault received funding), position size at the accrual, hourly funding rate. Returns |
| factor_hl_vault_realized_pnlA | Realized PnL aggregation over a time window for a HyperLiquid FACTOR vault. Sums |
| factor_pendle_lpC | Pendle LP operations through a Factor vault. Add/remove liquidity to Pendle markets and collect fees. Available on Arbitrum and Ethereum. |
| factor_flashloanA | Execute a flash loan strategy through a Factor vault. Borrows tokens within a single transaction, executes strategy steps, then repays. Uses Balancer flash loan provider (deployed on Arbitrum, Base, and Ethereum). The strategy steps define what to do with the borrowed funds (e.g., swap, supply collateral, etc.). |
| factor_preview_transactionA | Preview a transaction with gas estimates before execution. This is a read-only operation. |
| factor_get_transaction_statusA | Check the status of a transaction by its hash. Returns pending, success, or failed status along with block and gas information. |
| factor_check_foundryA | Check if Foundry suite (cast, anvil, forge) and Rust are installed. Foundry enables advanced features like transaction simulation on forked networks. |
| factor_cast_callB | Execute a read-only contract call using Foundry cast. Useful for checking balances, allowances, and contract state. |
| factor_simulate_transactionA | Simulate one or more transactions on a forked network using Foundry anvil. Supports balanceOverrides to set ETH balances before execution. Use "steps" for multi-step flows (e.g., approve + deploy vault) that need to run sequentially on the same fork. |
| factor_decode_errorB | Decode contract error data using Foundry cast. Useful for understanding why a transaction reverted. |
| factor_run_forge_scriptB | Run a Solidity forge script on a forked network. Pass EITHER scriptRef (a reference returned by other tools in simulationHint — preferred, just pass the string) OR scriptContent (inline Solidity source). No real tokens are spent. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |