Skip to main content
The Deframe MCP Server exposes the full Deframe API as a set of discoverable, typed tools for any MCP-compatible AI host — Claude Desktop, Cursor, Windsurf, and others. Your AI assistant can quote swaps, generate deposit bytecode, check wallet positions, and scaffold SDK projects without ever constructing a raw HTTP request.
Machine-readable resources:

When to Use What

Use CaseRecommendedWhy
Execute DeFi operations from a backendAPIDirect HTTP calls, full control
Build a frontend with yield and swap UISDK WidgetsHandles wallets, signing, execution
AI agent in an MCP-compatible hostMCP ServerZero-config tool discovery, typed inputs and outputs
Scaffold a new project inside your AI IDEMCP ServerGenerates all files for Next.js, React, Remix, Gatsby
Decode errors inline while developingMCP Serverget_error_explanation returns causes, retryability, and fixes
Integrate without additional dependenciesAPISimple HTTP, no runtime required
For AI agents running inside MCP-compatible hosts like Claude, Cursor, or Windsurf, the MCP Server is the most streamlined path — it exposes every core endpoint as a discoverable tool with typed parameters so the agent never has to construct raw HTTP requests.

Capabilities

The server ships with 21 tools and 7 prompts across four categories.

Swap

Get quotes, generate signed bytecode, and track status for same-chain and cross-chain swaps

Yield

List strategies, get quotes, deposit and withdraw, check open positions and transaction history

SDK Widgets

Scaffold frontend projects, validate provider configs, check SDK compatibility, and write env files

Diagnostics

Health checks, API key validation, token listing, and error code explanations

Minimal Tool Set

These five tools cover the most common agent workflows.

1. Recommend Integration Path

Analyzes your stack and recommends API Direct or SDK Widgets. Tool: recommend_integration_path Key inputs: frontendFramework, walletProvider, backendLanguage, features Returns: recommended path with rationale.

2. Get a Swap Quote

Request a ready-to-execute quote for a token swap. Tool: get_swap_quote Key inputs: fromChain, toChain, fromToken, toToken, fromAmount, fromAddress Returns: quote object with transactionRequest and expiry timestamp.
Quotes expire after 5 minutes. Call execute_swap_bytecode promptly after receiving one.

3. Get Deposit Bytecode

Generate transactions for depositing into a yield strategy. Tool: get_deposit_bytecode Key inputs: strategyId, amount, wallet, action Returns: ordered array of transactions to sign and broadcast.
The array may contain multiple transactions (e.g. token approval + deposit). Execute them in order.

4. Check Wallet Positions

Get all open yield positions for a wallet address. Tool: get_wallet_positions Key inputs: wallet Returns: positions with current value, principal, profit, and APY per strategy, plus a total balance summary.

5. Explain an Error

Decode a Deframe error code with causes, retry guidance, and resolution steps. Tool: get_error_explanation Key inputs: errorCode Returns: human-readable description, causes, whether it is retryable, and fix suggestions.

Pre-built Prompts

The server ships with 7 conversation starters for common integration scenarios. Invoke them by name from your AI host.
PromptWhat It Does
choose_integration_pathWizard that picks API Direct vs SDK Widgets for your stack
troubleshootDiagnoses errors given a code, tx state, and description
api_quickstartStep-by-step guide for a given feature and language
api_integration_wizardFull flow: quote → bytecode → signing → status tracking
sdk_quickstartFast path: scaffold → env setup → validate config
sdk_integration_wizardComplete SDK setup: compatibility → scaffold → validate
sdk_migration_guideBreaking changes and migration steps between SDK versions

Decision Rules

API Direct vs SDK Widgets

  • API Direct — your backend generates transactions and your frontend signs them with any wallet library (ethers.js, viem, wagmi)
  • SDK Widgets — you want pre-built React components that handle the full swap or yield UX with built-in wallet connection
Call recommend_integration_path if you are unsure which path fits your stack.

Handling Swap Status

Status: PENDING
└── Poll every 10–30 seconds

Status: DONE
├── substatus: COMPLETED → Transfer successful
├── substatus: PARTIAL   → User received a different token (still success)
└── substatus: REFUNDED  → Tokens returned to sender

Status: FAILED
└── Check error message, may need user intervention

Observability

In HTTP mode, the server includes a built-in dashboard at /dashboard showing tool call counts, latency, error rates, and session quality. Events are logged to NDJSON files and can be forwarded to a central collector for aggregation across multiple instances.

Next Steps

Setup Guide

Install and configure the MCP server in your AI host

Tools Reference

Complete reference for all 21 tools and 7 prompts

Quickstart

Make your first API call in 5 minutes

API Reference

Full REST API documentation with all endpoints