Skip to main content
The Deframe MCP Server exposes 21 tools and 7 prompts. Tools are callable by the AI agent during a session. Prompts are pre-built conversation starters you can invoke by name from your AI host to begin a guided workflow.

Shared Tools

Available regardless of integration path.
Analyzes your developer stack and recommends whether to use API Direct or SDK Widgets.Inputs:
FieldTypeDescription
frontendFrameworkstringe.g. next, react, remix, gatsby
walletProviderstringe.g. privy, dynamic, wagmi, ethers
backendLanguagestringe.g. typescript, javascript, python, go
featuresstring[]Features needed: swap, yield, wallet-positions
Returns: recommended path (API Direct or SDK Widgets) with rationale and suggested first steps.
Checks Deframe API health status. Use this to verify connectivity before starting a session or before running diagnostics.Inputs: noneReturns: health status and API version.
Validates an API key and returns account information.Inputs:
FieldTypeDescription
apiKeystringThe API key to validate
Returns: key validity, account name, plan tier, and rate limit details.
Lists all tokens supported by Deframe with optional filtering by chain.Inputs:
FieldTypeDescription
chainIdnumber (optional)Filter tokens by EVM chain ID
Returns: array of token objects with address, symbol, decimals, and chainId.
Decodes a Deframe error code with causes, HTTP status, retryability flag, and resolution steps.Inputs:
FieldTypeDescription
errorCodestringError code string (e.g. QUOTE_EXPIRED, INSUFFICIENT_BALANCE)
Returns: description, causes, whether it is retryable, and suggested fixes.

API Direct — Swap

Request a quote for a same-chain or cross-chain token swap.Inputs:
FieldTypeDescription
fromChainnumberSource chain ID
toChainnumberDestination chain ID
fromTokenstringToken symbol or address
toTokenstringToken symbol or address
fromAmountstringAmount in smallest unit (e.g. wei)
fromAddressstringSender wallet address
Returns: quote object with transactionRequest, expected output amount, fees, and expiry timestamp.
Quotes expire after 5 minutes. Call execute_swap_bytecode promptly after receiving a quote.
Generate ready-to-sign transaction bytecode from a confirmed swap quote.Inputs:
FieldTypeDescription
quoteIdstringQuote ID returned by get_swap_quote
fromAddressstringSender wallet address
Returns: ordered array of transaction objects (to, data, value, chainId) to sign and broadcast.
Sign and broadcast each transaction in the returned order. Skipping any transaction will cause the swap to fail.
Poll the status of a submitted swap transaction.Inputs:
FieldTypeDescription
txHashstringTransaction hash from the source chain
fromChainnumber (optional)Source chain ID — speeds up lookup
toChainnumber (optional)Destination chain ID
Returns: status (PENDING, DONE, FAILED) and substatus (COMPLETED, PARTIAL, REFUNDED).Poll every 10–30 seconds while status is PENDING.

API Direct — Yield

List all available DeFi yield strategies.Inputs:
FieldTypeDescription
networkstring (optional)Filter by network name (e.g. polygon, arbitrum)
assetstring (optional)Filter by asset symbol (e.g. USDC)
Returns: paginated array of strategy objects with id, protocol, APY, fee, and available actions.
Retrieve a single strategy with full details.Inputs:
FieldTypeDescription
strategyIdstringStrategy identifier (e.g. Aave-USDC-polygon)
Returns: protocol details, asset, APY, supported actions, fees, and current state.
Calculate estimated output and fees for a deposit or withdrawal before generating bytecode.Inputs:
FieldTypeDescription
strategyIdstringStrategy identifier
amountstringAmount in asset’s smallest unit
actionstringlend or withdraw
walletstringWallet address
Returns: estimated output, fee charged, and slippage details.
Generate transaction bytecode for depositing into a yield strategy.Inputs:
FieldTypeDescription
strategyIdstringStrategy identifier
amountstringDeposit amount in asset’s smallest unit
walletstringWallet address
actionstringTypically lend
Returns: ordered array of transactions to sign and broadcast. May include a token approval transaction before the deposit.
Execute all transactions in order. Each transaction depends on the one before it.
Generate transaction bytecode for withdrawing from a yield strategy.Inputs:
FieldTypeDescription
strategyIdstringStrategy identifier
amountstringWithdrawal amount in asset’s smallest unit
walletstringWallet address
actionstringTypically withdraw
Returns: ordered array of transactions to sign and broadcast.
Retrieve all open yield positions for a wallet address.Inputs:
FieldTypeDescription
walletstringWallet address (checksummed or lowercase)
Returns: array of positions with current value, principal, profit, and APY per strategy, plus a total balance summary in USD.
Retrieve transaction history for a wallet in a specific strategy.Inputs:
FieldTypeDescription
walletstringWallet address
strategyIdstringStrategy identifier
Returns: paginated transaction history with timestamps, amounts, and status.
Find the highest-APY strategy matching an asset name or yield category.Inputs:
FieldTypeDescription
identifierstringAsset name (e.g. USDC) or category (e.g. stablecoin)
Returns: top-performing strategy matching the identifier, with full strategy details.

API Direct — Code Generation

Generate a complete, runnable code example for a given feature and programming language.Inputs:
FieldTypeDescription
featurestringswap, yield, or wallet-positions
languagestringtypescript, javascript, python, go, or curl
Returns: complete code snippet with comments, ready to copy into a project. Includes environment setup, API call, and response handling.

SDK Widgets

Generate all files needed to integrate Deframe SDK widgets into a frontend project.Inputs:
FieldTypeDescription
frameworkstringnext, react, remix, or gatsby
featuresstring[]swap, yield, or both
walletProviderstringWallet connection library in use
Returns: complete file tree — components, providers, and environment templates — ready to copy into your project.
Validate a DeframeProvider configuration object before using it in production.Inputs:
FieldTypeDescription
configobjectThe provider config object to validate
Returns: validation result with any errors or warnings and suggested fixes for each issue.
Check compatibility between deframe-sdk, React, and your wallet provider before installing or upgrading.Inputs:
FieldTypeDescription
sdkVersionstringInstalled version of deframe-sdk
reactVersionstringInstalled version of React
walletProviderstringWallet library name and version
Returns: compatibility matrix, known issues, and recommended version combinations.
Write Deframe environment variables to a .env or .env.local file.Inputs:
FieldTypeDescription
apiKeystringYour Deframe API key
filestring (optional)Target file path. Default: .env.local
Returns: confirmation of which variables were written and the target file path.
Ensure .env and .env.local are listed in your .gitignore before running this tool.

Prompts

Prompts are pre-built conversation starters. Invoke them by name from your AI host to begin a guided workflow.
Walks through a brief stack analysis and recommends API Direct or SDK Widgets for your project.Inputs: feature, frontendFramework, walletProvider, backendLanguageUse this at the start of a new integration to get a tailored recommendation before writing any code.
Diagnoses errors given an error code, transaction state, and description. Returns probable causes and resolution steps.Inputs: errorCode, txState, descriptionUse this when a transaction is failing or an API call returns an unexpected error.
Step-by-step guided session from first API call to a confirmed on-chain transaction, tailored to a specific feature and language.Inputs: feature, languageUse this to get from zero to working code as fast as possible.
Full integration session covering the complete flow: quote → bytecode → signing → status tracking. Walks through each step interactively.Inputs: none — the wizard collects everything it needs during the session.Use this when building an end-to-end swap or yield integration for the first time.
Fast-path SDK session: scaffold a project → write environment variables → validate the provider config.Inputs: none — the wizard collects framework and wallet provider during the session.Use this when you want working widget integration in the fewest possible steps.
Complete SDK setup session: compatibility check → project scaffolding → provider config validation.Inputs: none — the wizard collects all required details interactively.Use this for a thorough SDK setup with checks at each stage before proceeding.
Generates a migration guide for moving between deframe-sdk versions, including all breaking changes and required code updates.Inputs: fromVersion, toVersionUse this before upgrading the SDK in a production project.

Next Steps

Setup Guide

Install the MCP server in Claude Desktop, Cursor, or Windsurf

Quickstart

Make your first API call in 5 minutes without the MCP server