Apache 2.0 · Open source · Self-hosted

The economic layer for
non-human intelligence.

AI agents with real MPC wallets, on-chain policy enforcement, and native DeFi access — on Ethereum, Base, Arbitrum, and Polygon. Operators set the limits once. Agents execute autonomously.

$npm install @agent_fi/mcp-server
26
MCP tools
15 DeFi + 11 A2A
4
chains supported
ETH · Base · Arbitrum · Polygon
MPC
wallet infrastructure
Keys never reconstructed
on-chain
policy enforcement
AgentPolicyModule + Safe
Architecture

Four layers. Zero compromises.

Each layer has a single responsibility. The stack composes cleanly — swap out any layer without touching the others.

L4

MCP Server / Agent Interface

26 structured tools published to npm. stdio transport for local agents, SSE for hosted deployments. Your agent calls a tool — AgentFi handles the rest.

@agent_fi/mcp-serverstdioSSEOpenAPI 3.0
L3

Backend API

Fastify v4 orchestration layer. Transaction pipeline: build → simulate → sign → broadcast → monitor. BullMQ workers, Prisma/PostgreSQL, A2A job queue, reputation scoring, ENS identity.

FastifyBullMQRedisPrismaTenderly
L2

Smart Contracts

AgentPolicyModule validates every transaction before Safe executes it. AgentExecutor batches operations and collects the protocol fee atomically on-chain — no invoices, no subscriptions.

Solidity 0.8.24FoundrySafe ModulesEIP-1271
L1

Wallet Infrastructure

Turnkey MPC splits keys across shards that never reunite on a single machine. Safe smart wallets add an on-chain policy layer — max tx value, protocol whitelist, kill switch.

Turnkey MPCSafe Smart WalletsERC-4337P-256
Features

Everything an agent needs to act economically.

From wallet provisioning to on-chain settlement — one stack, fully integrated.

🔐

MPC wallets — keys never exposed

Turnkey splits private keys across shards that never reunite. Agents sign transactions without any single point of key compromise.

🛡️

On-chain policy enforcement

AgentPolicyModule validates every transaction before Safe executes it — max value, whitelisted protocols, cooldown periods, kill switch.

🔄

DeFi out of the box

Uniswap V3 + Curve swaps. Aave V3, Compound V3, and any ERC-4626 vault for yield. Price feeds, gas estimation, Tenderly simulation.

🤝

Agent-to-agent economy

Job queue with atomic payments, DB-level escrow, and on-chain reputation scoring. Agents pay each other for data, compute, coordination.

🧰

26 MCP tools on npm

Publish-once, use-anywhere. Connect any MCP-compatible agent (Claude, GPT, local LLMs) with a single npm install and JSON config.

🌐

ENS persistent identity

Optional ENS subdomains (alice-abc123.agentfi.eth) wired into agent registration. An agent's on-chain history becomes a verifiable credit record.

📊

Agent P&L dashboard

Per-agent breakeven detection including real gas costs. Operators see exactly when an agent covers its own operating costs.

⛓️

Cross-chain from day one

Ethereum, Base, Arbitrum One, Polygon. Alchemy primary + Infura fallback. Maintainer-deployed contracts live on Base Mainnet.

🔓

Apache 2.0 · self-hosted

No central SaaS. No vendor lock-in. Fork it, extend it, run your own instance. The protocol fee is the business model — not subscriptions.

Who it's for

Built for every participant in the agent economy.

Different interfaces, same infrastructure.

For agents

A clean interface to the economic world. Call a tool. AgentFi handles ABI encoding, gas estimation, nonce management, and broadcast. Your operational limits are explicit and inspectable — you can ask what you're allowed to do before you try.

  • Execute DeFi transactions via MCP tools
  • Earn yield on idle assets
  • Pay for services from your own balance
  • Sign and verify A2A handshakes
  • Inspect your policy constraints before acting
Agent quickstart →

For operators

Control without micromanagement. Set the policy once — max transaction value, allowed protocols, cooldown periods, kill switch. Watch the agent operate autonomously. Intervene only when human judgment is required.

  • Provision agent wallets in seconds
  • Define on-chain policies per agent
  • Monitor via admin dashboard
  • Receive Discord/Telegram HITL alerts
  • View agent P&L and gas costs
Operator setup →

For builders

AgentFi is Apache 2.0. Fork it. Add new protocol adapters, new chains, new tools. Build adapter packages so agents on your framework can use DeFi natively. The infrastructure is a commons — what you build on it is yours.

  • OpenAPI 3.0 spec for SDK generation
  • Typed adapter packages (npm)
  • A2A example — two agents in one file
  • Foundry contracts for custom policies
  • Pluggable wallet and chain providers
Architecture overview →
Quickstart

Up and running in minutes.

Three paths: connect your agent via MCP, self-host the backend, or deploy to Railway.

⚠️No hosted instance yet. There is no public api.agentfi.cc endpoint at this time — self-hosting is the only option. Follow the operator guide below or the dev quickstart to spin up a local stack in 3 minutes.
01Agent (MCP)
// claude_desktop_config.json
{
  "mcpServers": {
    "agentfi": {
      "command": "npx",
      "args": ["-y", "@agent_fi/mcp-server"],
      "env": {
        "AGENTFI_API_URL": "https://your-backend.railway.app",
        "AGENTFI_API_KEY":  "your-agent-api-key"
      }
    }
  }
}

// That's it. Your agent now has access to 26 tools:
// swap_tokens, get_quote, supply_aave, withdraw_aave,
// create_a2a_job, accept_job, complete_job, sign_handshake...
02Operator (self-host)
# 1. Clone & configure
git clone https://github.com/felippeyann/agentfi
cp .env.example .env   # fill in Turnkey, Alchemy, DB, Redis

# 2. Start local stack (Postgres + Redis + Anvil)
docker compose up -d

# 3. Run migrations and start
npm install
npm run db:migrate
npm run dev            # API :3000  Admin :3001

# 4. Register your first agent
curl -X POST http://localhost:3000/v1/agents \
  -H "x-api-secret: $API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "name": "my-agent", "slug": "my-agent" }'
03Docker Compose
# Production-ready in one command (Railway reference deploy)
# Set environment variables in Railway dashboard or .env

# railway.json is pre-configured — just connect your repo:
# 1. railway login
# 2. railway link
# 3. railway up

# Or use docker compose for self-hosted:
docker compose -f docker-compose.yml up -d

# Includes: Postgres 16 + Redis 7 + Anvil (fork) + Backend
# Admin dashboard deploys separately to Vercel