Agent and MCP
The in-app agent, connecting your own agent, and automation.
The in-app agent#
The Agent panel answers about funds, prices and your portfolio, and can act: launch a fund, deposit, redeem, rebalance, change a basket, withdraw a token, and turn automatic rebalancing on or off. It acts through your app wallet with the same rules as the buttons on screen. You can shape it in Agent: its identity, its knowledge, its rules, what it remembers about you, and skills you import from a skill.md link. It runs on platform credits.
It treats everything it reads — fund names, descriptions, web pages, token metadata — as data, never as instructions. Text inside a fund description cannot make it move money.
Connecting your own agent#
@dfm-fi/agent is DFM’s MCP server. Any MCP client — Claude, Cursor and others — can run it:
npx -y @dfm-fi/agent install
Nothing to install? Point any MCP client that supports remote servers at the read-only endpoint:
https://app.dfm.finance/api/v2/mcp
It serves funds, the live protocol numbers, tokens, prices and trader profiles. get_portfolio, zap_status and swap_quote read your own account and need your read-only API key as an Authorization: Bearer header. It cannot move money: launching, depositing, redeeming and swapping run on the local server above.
Authenticate it with an API key from Agent → Keys; a key can be revoked at any moment. Tools that move money also require DFM_AGENT_WRITE_ENABLED=true in the agent’s settings. Fund operations always run through your app wallet, never through a key on your machine.
API Keys
Build on DFM. Keys let agents and apps launch, deposit, and read data programmatically.
| Tools | What they do |
|---|---|
protocol_facts | The live protocol numbers: creation fee, seed, entry and exit fees, the Season 0 cap, basket and policy rules. |
whoami · list_dtfs · get_vault · get_portfolio · xp_status · trader_profile | Who you are, funds, a fund’s basket, weights, drift and fees, your positions, your XP and how to earn more, a trader’s profile. |
discover_tokens · get_token_price · swap_quote · swap | Find tokens and prices; swap tokens in the app wallet. |
launch_vault · attach_metadata · init_rebalancer | Launch a fund and finish its setup. |
deposit · redeem · zap_status · zap_v2_cancel · zap_v2_update_envelope | Deposit USDC, redeem shares, follow, cancel or loosen a deposit or redemption. |
rebalance_to_targets · update_vault_assets | Manage a fund you run. Handing a fund over is done from the in-app agent. |
app_wallet · list_app_wallet_assets · app_wallet_fund · app_wallet_withdraw · app_wallet_rearm · withdraw_asset · close_empty_accounts | Read and move your app wallet’s balances. |
onboard · create_identity_wallet · set_profile · create_api_key · create_app_wallet | Set up a headless agent: identity, profile, key and app wallet. |
follow_trader · unfollow_trader · report_bug | Follow traders; report a bug (it opens a ticket the DFM team is notified of). |
The agent can also read DFM’s skill file at SKILL.md (also served at https://app.dfm.finance/api/v2/agent/skill.md), which teaches it the product.
An agent with no human behind it uses its own identity key: onboard → set_profile → create_app_wallet → send USDC and SOL to its identity address → app_wallet_fund. An agent operating a person’s account uses a dfm_ key that person creates in Agent → Keys.
Autonomous rebalancing#
Available from the in-app agent only: ask it to arm, set up or disarm. Through the MCP server, rebalancing is manual (rebalance_to_targets).
- Arm. You sign the creation of a session key that can only rebalance your fund. It can never deposit, withdraw or move principal out of the basket, and it rebalances only into the fund’s own assets. It expires on its own, and you can disarm it at any time.
- Set up. Choose one trigger: rebalance when drift passes a threshold, or on a schedule. The automation runs only while DFM has automatic execution switched on for the platform; when it is off, the automation is saved and armed but does not fire.
- Disarm. Revokes and closes the key and pauses the automation. You can arm again at any time.