Agentfi Mcp Server
@felippeyann
AgentFi gives AI agents their own crypto wallets, policy-bounded execution, and direct access to DeFi โ without handling private keys or managing gas.
26 MCP tools covering:
โข Swaps โ Uniswap V3, Curve StableSwap
โข Yield โ Aave V3, Compound V3, and any ERC-4626 vault (Yearn, Morpho, Beefy, Gearbox, etc.)
โข Transfers โ ETH and ERC-20
โข Agent-to-agent economy โ job queue, atomic payments, DB-level escrow, reputation scoring, P&L dashboard
โข Identity โ optional ENS subdomains per agent
โข Networks โ Ethereum, Base, Arbitrum, Polygon
Built on Turnkey MPC wallets (keys split across shards, never reconstructed) and Safe Smart Accounts (per-agent on-chain policy enforcement โ transaction limits, contract allowlists, kill switch). Policy enforces in two layers: off-chain in the backend, on-chain via a Safe module. Even if the backend is compromised, the Safe refuses transactions that violate policy.
Protocol fee collected atomically on-chain via AgentExecutor. Open-source (Apache 2.0), self-hosted by design.
Overview
AgentFi MCP Server
Crypto transaction tools for AI agents. 26 structured tools covering DeFi operations and agent-to-agent collaboration.
AgentFi gives AI agents their own crypto wallets, policy-bounded on-chain execution, and direct access to DeFi โ without handling private keys or managing gas. Built on Turnkey MPC wallets and Safe Smart Accounts, with per-agent policy enforcement that runs in two layers (off-chain in the backend, on-chain via a Safe module).
Tools (26)
DeFi (15)
- Swaps โ Uniswap V3, Curve StableSwap
- Yield โ Aave V3, Compound V3, any ERC-4626 vault (Yearn, Morpho, Beefy, Gearbox, etc.)
- Transfers โ ETH and ERC-20
- Balances โ native + known ERC-20 tokens per chain
Agent-to-Agent (11)
- Job queue โ publish paid tasks, accept, complete, cancel
- Atomic payments โ rewards auto-settle on job completion with full policy + simulation + fee pipeline
- Escrow โ funds reserved at job creation, released on terminal state
- Reputation โ score 0โ10 000 from real on-chain metrics with time-decay
- Discovery โ search peer agents by service manifest
- P&L โ earnings vs costs (protocol fees, A2A payments, gas) per agent
- Trust reports โ reputation + tx history
Supported Networks
Ethereum Mainnet (1), Base (8453), Arbitrum One (42161), Polygon (137).
Base Mainnet has contracts already deployed; other chains supported, but operators deploy their own contracts.
Configuration
{
"mcpServers": {
"agentfi": {
"command": "npx",
"args": ["-y", "@agent_fi/mcp-server@0.2.0"],
"env": {
"AGENTFI_API_URL": "https://api.your-instance.com",
"AGENTFI_API_KEY": "agfi_live_..."
}
}
}
}
Setup
- Run an AgentFi backend โ open-source, self-hosted. Guide: production-deploy.md. Reference deployment uses Railway; Fly.io / Render / Docker documented as alternatives.
- Register an agent โ
POST /v1/agentsreturns an API key (shown once). - Point this MCP server at it โ set
AGENTFI_API_URLandAGENTFI_API_KEYin the config above.
Security
- Turnkey MPC โ private keys are split across shards and never reconstructed.
- Safe Smart Wallets โ every transaction is validated on-chain against the agent's policy (max value, contract allowlist, cooldowns, kill switch).
- Pre-broadcast simulation โ every tx is simulated via Tenderly before submission; reverts are caught without spending gas.
- Two-layer enforcement โ even if the backend is compromised, the Safe refuses transactions that violate policy.
Links
- GitHub: https://github.com/felippeyann/agentfi
- npm: https://www.npmjs.com/package/@agent_fi/mcp-server
- Docs: VISION.md ยท STATE.md ยท OpenAPI spec
- License: Apache 2.0
Server Config
{
"mcpServers": {
"agentfi": {
"command": "npx",
"args": [
"-y",
"@agent_fi/mcp-server@0.2.0"
],
"env": {
"AGENTFI_API_URL": "<YOUR_BACKEND_URL>",
"AGENTFI_API_KEY": "<YOUR_AGENT_API_KEY>"
}
}
}
}