Skip to main content

FDX — Agent Wallet CLI

FDX is a command-line interface to the Finance District MCP wallet server. It gives AI agents crypto wallet capabilities — hold, send, swap, and earn yield on assets across multiple chains — without managing private keys. FDX is designed for AI agents and agent frameworks that need wallet tooling but don’t natively support the Model Context Protocol (MCP). Instead of integrating an MCP client, agents invoke fdx call <method> from the command line and parse JSON output.
  • No Key Management — OAuth 2.1 secured. No seed phrases. No private key files.
  • Agent-Native — Structured JSON input/output designed for tool-calling agents.
  • Multi-Chain — Ethereum, BSC, Arbitrum, Base, Solana. One wallet, all chains.
  • DeFi Enabled — Transfer, swap, and earn yield through integrated DeFi protocols.
  • Smart Accounts — Account abstraction with multi-signature support (ERC-4337).
For full documentation, architecture details, and development instructions, see the FDX GitHub repository.

Quick Start

Install globally:
npm install -g @financedistrict/fdx
Run the setup:
fdx setup
Check that authentication succeeded:
fdx status

Authentication

FDX uses OAuth 2.1 with the Device Authorization Grant (RFC 8628). Authentication is always tied to a user identity — the agent acts as a delegate on the user’s behalf. When you run fdx setup, the CLI retrieves a short one-time code and prints it alongside a verification URL:
──────────────────────────────────────────────────────────
  Verification URL: https://microsoft.com/devicelogin
  Enter code:       ABCD-1234
──────────────────────────────────────────────────────────
Open the URL on any device (or have your agent navigate to it), enter the code, and complete sign-in. The CLI polls in the background and stores the token once authorization is confirmed. The agent never needs a browser. The token is still issued to a user — identity and accountability stay intact. This works everywhere — Docker containers, CI pipelines, remote servers, and autonomous agents.
No API keys or bearer tokens to manage. Tokens are stored securely in the OS credential store (Keychain on macOS, libsecret on Linux, DPAPI on Windows) and refreshed automatically.
To remove stored credentials:
fdx logout

Usage

Invoke any MCP tool via the CLI:
# Check wallet overview
fdx call getWalletOverview --chainKey ethereum

# Send tokens
fdx call transferTokens --chainKey ethereum --recipientAddress 0xABC... --amount 0.1

# Discover yield strategies
fdx call discoverYieldStrategies --chainKey base
All output is JSON, making it easy for agents to parse:
fdx call getMyInfo | jq '.email'
Run fdx call without arguments to see all available methods.

SDK Usage

FDX can also be used as a Node.js library:
const { createClientFromEnv } = require("@financedistrict/fdx");

const client = createClientFromEnv();
const result = await client.getWalletOverview({ chainKey: "ethereum" });
console.log(result.data);

Configuration

VariableDescriptionDefault
FDX_MCP_SERVERMCP server URLhttps://mcp.fd.xyz
FDX_STORE_PATHToken store path~/.fdx/auth.json
FDX_LOG_PATHLog file path~/.fdx/fdx.log
FDX_LOG_LEVELLog verbosity (debug | info | warn | error | off)info

Using FDX with Agent Frameworks

FDX is designed to work with agent frameworks where the agent can execute shell commands.

Tool-calling agents

Most agent frameworks let you define custom tools. Wrap FDX as a shell tool:
import subprocess
import json

def wallet_command(method: str, **kwargs) -> dict:
    """Execute an FDX wallet command and return JSON result."""
    args = ["fdx", "call", method]
    for key, value in kwargs.items():
        args.extend([f"--{key}", str(value)])
    result = subprocess.run(args, capture_output=True, text=True)
    return json.loads(result.stdout)

# Check wallet overview
overview = wallet_command("getWalletOverview", chainKey="ethereum")

# Transfer tokens
wallet_command("transferTokens", chainKey="ethereum", recipientAddress="0x1234...5678", amount="5")

Script-based automation

#!/bin/bash
BALANCE=$(fdx call getWalletOverview --chainKey base | jq -r '.balances[0].amount')
echo "Current balance: $BALANCE"
For deeper integration patterns with specific frameworks, see Agent Frameworks.

FDX vs. MCP Server

FDX and MCP server connect to the same backend and offer the same capabilities:
AspectMCP ServerFDX CLI
InterfaceMCP protocol (tool calls)Terminal commands (fdx call)
ConnectionMCP client → serverFDX → MCP client → server
Best forAI agents in MCP clientsScripts, automation, agent frameworks with shell access
SetupConfig file in MCP clientnpm install -g + fdx setup
AuthOAuth PKCEDevice Authorization Grant
OutputMCP tool responsesJSON
Choose MCP when your agent or AI client supports MCP natively. Choose FDX when you need terminal access or are integrating with a framework that runs shell commands.