MCP + Finance

How to Use MCP Servers for AI Agent Financial Operations (2026 Guide)

Introduction

The Model Context Protocol (MCP) has emerged as the de facto standard for giving large language models access to external tools and real-world systems. Where previous tool-calling approaches required bespoke integrations for each agent framework, MCP offers a unified, transport-agnostic protocol that any compliant client can speak fluently.

Financial tooling is arguably the highest-leverage category of MCP servers available today. The ability for an AI agent to check a crypto wallet balance, execute a trade, place a wager, or register a domain — all from within a single natural-language conversation — fundamentally changes what autonomous agents can accomplish. Instead of writing glue code, you configure a JSON block and ship.

Purple Flea publishes six production-grade MCP servers covering crypto wallets, trading, casino operations, domain management, faucet, and escrow. This guide walks through everything: what MCP is, how our servers work, how to wire them into Claude Desktop or any other MCP client, and how to extend them with your own logic.

Prerequisites

You need Node.js 20+, a Purple Flea account with API keys, and either Claude Desktop, Cursor, or Windsurf installed. All six MCP servers are available on npm under the @purple-flea scope.

What Is the Model Context Protocol?

MCP is an open protocol introduced by Anthropic in late 2024 and rapidly adopted across the AI ecosystem. It defines a standard way for MCP clients (Claude Desktop, Cursor, Windsurf, custom agents) to discover and invoke tools exposed by MCP servers — lightweight processes that run locally or remotely and respond to a JSON-RPC-like wire format.

Tool Calling vs. MCP

Traditional tool calling bakes function schemas directly into the model API request. Each framework invents its own schema format, each integration is one-off, and there is no shared discovery mechanism. MCP changes the model:

  • Discovery is automatic. The client calls tools/list and gets a live schema for every tool the server exposes — no manual registration.
  • Transport is pluggable. Servers run over stdio, HTTP+SSE, or WebSockets; clients don't care which.
  • Servers are composable. An orchestrator server can itself be an MCP client that fans out requests to multiple downstream MCP servers.
  • Auth lives outside the LLM. API keys are held by the server process, not leaked into the context window.

Why MCP Is Better for Agents

Autonomous agents need to operate across long, multi-step sessions. MCP servers are persistent processes with their own state and retry logic. The model never needs to hold API tokens in memory; it simply calls a named tool and receives a structured result. That separation of concerns makes agents more reliable, auditable, and easier to extend without touching the model layer.

Key insight: MCP lets financial tooling behave like a first-class citizen of the AI stack. Instead of pasting balance output into a chat window, the agent reads balances, reasons over them, and executes follow-up actions — all within a single coherent turn.

Purple Flea MCP Servers

Purple Flea provides four purpose-built MCP servers that cover the most common AI-driven financial use cases. Each server authenticates with a dedicated API key, exposes a rich tool surface, and returns structured JSON that agents can reason over directly.

🎰
casino-mcp

Casino operations: coin flips, dice rolls, slot spins, blackjack, provably fair game history, and balance management for gaming wallets.

📈
trading-mcp

Spot and perpetual trading across major crypto pairs. Market orders, limit orders, position tracking, P&L reporting, and order book snapshots.

👛
wallet-mcp

Multi-chain crypto wallet operations: balance lookups, transaction history, send/receive, address generation, and gas estimation across EVM chains, Solana, and Bitcoin.

🌐
domains-mcp

Domain registration, DNS management, WHOIS lookup, renewal, transfer, and Web3 domain minting (.crypto, .eth, .sol) — all via natural language.

Every server is published as an npm package and is invoked by the MCP client via npx, so there is nothing to install globally. The packages auto-update on each spawn if you omit a pinned version tag.

Setup Guide: Installing in Claude Desktop

Claude Desktop reads MCP server configuration from ~/.claude/claude_desktop_config.json. Open the file (create it if it does not exist) and add the mcpServers block below. Replace each placeholder key with the real API key from your Purple Flea dashboard.

~/.claude/claude_desktop_config.json
{
  "mcpServers": {
    "casino": {
      "command": "npx",
      "args": ["@purple-flea/casino-mcp"],
      "env": { "CASINO_API_KEY": "your_key" }
    },
    "trading": {
      "command": "npx",
      "args": ["@purple-flea/trading-mcp"],
      "env": { "TRADING_API_KEY": "your_key" }
    },
    "wallet": {
      "command": "npx",
      "args": ["@purple-flea/wallet-mcp"],
      "env": { "WALLET_API_KEY": "your_key" }
    },
    "domains": {
      "command": "npx",
      "args": ["@purple-flea/domains-mcp"],
      "env": { "DOMAINS_API_KEY": "your_key" }
    }
  }
}

After saving the file, restart Claude Desktop. You will see a small plug icon in the bottom-left of the chat composer indicating connected MCP servers. Click it to verify all six servers show a green status dot.

Installation Steps

  1. Create a Purple Flea account
    Visit purpleflea.com/dashboard, sign up, and navigate to API Keys. Generate separate keys for casino, trading, wallet, and domains.
  2. Verify Node.js 20+
    Run node --version in your terminal. If you are below v20, install via nodejs.org or nvm install 20.
  3. Edit the config file
    Open ~/.claude/claude_desktop_config.json in any editor, paste the JSON above, and replace each "your_key" with your real keys.
  4. Restart Claude Desktop
    Fully quit the app (Cmd+Q / Alt+F4) and relaunch. Check the MCP status indicator in the composer.
  5. Test with a simple query
    Type "What tools do you have available?" — Claude will enumerate every tool from all six servers.

Demo: Crypto Balance + Casino Bet in One Message

Let's watch Claude handle a compound financial request end-to-end: check the current wallet balance, then place a $5 coin-flip bet if the balance is sufficient.

Claude Desktop — with Purple Flea MCP servers connected
U
User
Check my crypto balance and if I have more than $20 worth of USDC, place a $5 bet on coin flip.
C
Claude
Sure — let me check your wallet balance first, then decide whether to place the bet.
T
Tool Call — wallet.get_balances
Request
{ "chains": ["ethereum", "polygon"], "tokens": ["USDC"] }

Response
{ "balances": [ { "chain": "polygon", "token": "USDC", "amount": "47.82", "usd_value": "47.82" }, { "chain": "ethereum", "token": "USDC", "amount": "0.00", "usd_value": "0.00" } ], "total_usd": "47.82" }
C
Claude
Your total USDC balance is $47.82 (all on Polygon), which is above $20. Placing a $5 coin-flip bet now.
T
Tool Call — casino.place_bet
Request
{ "game": "coin_flip", "amount": "5", "currency": "USDC", "choice": "heads" }

Response
{ "bet_id": "bet_9xK2mP7qR", "game": "coin_flip", "choice": "heads", "result": "tails", "outcome": "loss", "amount_wagered": "5.00", "amount_won": "0.00", "new_balance": "42.82", "provably_fair_hash": "a3f9c2...d8e1" }
C
Claude
Here's the summary:

Wallet balance: $47.82 USDC (Polygon)
Bet placed: $5 on heads — coin landed tails, so this one's a loss.
New balance: $42.82 USDC
Bet ID: bet_9xK2mP7qR (provably fair — hash: a3f9c2...d8e1)

Want to try again or check your full transaction history?

Notice that Claude autonomously chained two tool calls, applied conditional logic between them, and surfaced actionable output — without any code. That is the power of MCP in a financial context.

Available MCP Tools Per Server

Each server exposes a curated set of tools. Below is the full reference as of February 2026. The live schema (including parameter types and validation rules) is always available via tools/list at runtime.

@purple-flea/wallet-mcp
wallet.get_balances
Returns token balances across one or more chains. Supports EVM networks, Solana, and Bitcoin. Optionally filter by token symbol.
wallet.get_transactions
Fetches paginated transaction history for a given address and chain, with USD value annotations.
wallet.send_token
Broadcasts a token transfer. Requires recipient address, amount, token, and chain. Returns tx hash and explorer URL.
wallet.generate_address
Derives and returns a fresh deposit address for a given chain and account index.
wallet.estimate_gas
Estimates gas cost for a pending transfer in native currency and USD before execution.
wallet.get_price
Returns the current USD spot price for any supported token, with 24-hour change percentage.
@purple-flea/trading-mcp
trading.place_market_order
Executes an immediate market buy or sell for a given pair and quantity. Returns fill price and order ID.
trading.place_limit_order
Places a resting limit order at a specified price. Supports GTC, IOC, and FOK time-in-force options.
trading.cancel_order
Cancels a single open order by order ID, or all open orders for a given pair.
trading.get_positions
Returns all open spot and perp positions with entry price, current mark price, unrealized P&L, and liquidation price.
trading.get_order_book
Fetches the top N bids and asks for a trading pair, with aggregated depth at each price level.
trading.get_pnl_report
Generates a realized P&L report for a date range, broken down by asset and trade.
trading.get_funding_rate
Returns the current and predicted next funding rate for a perpetual contract.
@purple-flea/casino-mcp
casino.place_bet
Places a bet on coin flip, dice, slots, or blackjack. Returns result, payout, new balance, and provably-fair seed hash.
casino.get_game_history
Returns paginated bet history with outcomes and P&L. Filter by game type, date range, or outcome.
casino.verify_fairness
Verifies the provably fair outcome of any historical bet using its seed hash and nonce.
casino.get_casino_balance
Returns the current gaming wallet balance, lifetime wagered amount, and net profit/loss.
casino.get_active_promotions
Lists active bonuses, free spins, and deposit match promotions available to the account.
@purple-flea/domains-mcp
domains.search_availability
Checks whether one or more domain names are available for registration, with pricing across TLDs.
domains.register_domain
Registers a domain for a specified number of years. Deducts cost from wallet balance. Returns registrar confirmation.
domains.list_domains
Returns all domains owned by the account with expiry dates, auto-renew status, and nameserver config.
domains.update_dns
Adds, updates, or deletes DNS records (A, AAAA, CNAME, MX, TXT) for a managed domain.
domains.whois_lookup
Returns parsed WHOIS data for any domain: registrar, creation/expiry dates, nameservers, and contact info.
domains.mint_web3_domain
Mints a Web3 domain (.crypto, .eth, .sol) to a specified wallet address. Returns transaction hash and token ID.

Using Purple Flea MCP Servers with Other Clients

MCP is client-agnostic. The same server configuration works across every compliant client. Here are the three most popular options beyond Claude Desktop.

Cursor

Add MCP servers in Settings → MCP. Cursor supports the same JSON config format. Tools appear as inline autocomplete actions during coding sessions.

Windsurf

Configure via Preferences → MCP Servers. Windsurf's Cascade agent natively chains MCP tool calls across multi-step agentic workflows.

Custom Client

Use the official @modelcontextprotocol/sdk TypeScript package to spawn servers, call tools/list, and invoke tools programmatically in your own app.

Custom Client — Minimal Example

The following snippet connects to the wallet MCP server from Node.js, lists available tools, and calls wallet.get_balances:

custom-client.ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const transport = new StdioClientTransport({
  command: "npx",
  args: ["@purple-flea/wallet-mcp"],
  env: { ...process.env, WALLET_API_KEY: process.env.WALLET_API_KEY }
});

const client = new Client({ name: "my-agent", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);

// Discover tools
const { tools } = await client.listTools();
console.log("Available tools:", tools.map(t => t.name));

// Call a tool
const result = await client.callTool({
  name: "wallet.get_balances",
  arguments: { chains: ["ethereum", "polygon"], tokens: ["USDC", "ETH"] }
});

console.log(JSON.stringify(result, null, 2));
await client.close();

Building a Custom MCP Server for Purple Flea

The four published servers cover most use cases, but you can build additional MCP servers that wrap Purple Flea's REST API with your own business logic, rate limiting, caching, or custom tool names. The following is a complete, runnable MCP server in Node.js that adds three custom tools on top of the wallet and trading APIs.

purple-flea-custom-mcp/src/index.ts
#!/usr/bin/env node
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
  ErrorCode,
  McpError,
} from "@modelcontextprotocol/sdk/types.js";

const WALLET_API_KEY  = process.env.WALLET_API_KEY  ?? "";
const TRADING_API_KEY = process.env.TRADING_API_KEY ?? "";
const BASE_URL        = "https://api.purpleflea.com/v1";

async function apiFetch(path: string, apiKey: string, body?: unknown) {
  const res = await fetch(`${BASE_URL}${path}`, {
    method: body ? "POST" : "GET",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type":  "application/json",
    },
    body: body ? JSON.stringify(body) : undefined,
  });
  if (!res.ok) throw new McpError(ErrorCode.InternalError, await res.text());
  return res.json();
}

const server = new Server(
  { name: "purple-flea-custom", version: "1.0.0" },
  { capabilities: { tools: {} } },
);

// ── Tool definitions ──────────────────────────────────────────
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name:        "pf.portfolio_summary",
      description: "Returns a unified portfolio view: wallet balances + open trading positions + net USD value.",
      inputSchema: { type: "object", properties: {}, required: [] },
    },
    {
      name:        "pf.rebalance",
      description: "Calculates the trades needed to hit target allocations and optionally executes them.",
      inputSchema: {
        type: "object",
        properties: {
          targets: { type: "object", description: "Token symbol → target % (e.g. {BTC: 50, ETH: 30, USDC: 20})" },
          execute: { type: "boolean", description: "Set true to place the rebalancing orders" },
        },
        required: ["targets"],
      },
    },
    {
      name:        "pf.daily_report",
      description: "Generates a concise daily P&L report covering trades, casino activity, and wallet movements.",
      inputSchema: {
        type: "object",
        properties: {
          date: { type: "string", description: "ISO date string, defaults to today" },
        },
        required: [],
      },
    },
  ],
}));

// ── Tool handlers ─────────────────────────────────────────────
server.setRequestHandler(CallToolRequestSchema, async (req) => {
  const { name, arguments: args } = req.params;

  switch (name) {
    case "pf.portfolio_summary": {
      const [balances, positions] = await Promise.all([
        apiFetch("/wallet/balances", WALLET_API_KEY),
        apiFetch("/trading/positions", TRADING_API_KEY),
      ]);
      return { content: [{ type: "text", text: JSON.stringify({ balances, positions }, null, 2) }] };
    }

    case "pf.rebalance": {
      const plan = await apiFetch("/trading/rebalance", TRADING_API_KEY, {
        targets: (args as any).targets,
        execute: (args as any).execute ?? false,
      });
      return { content: [{ type: "text", text: JSON.stringify(plan, null, 2) }] };
    }

    case "pf.daily_report": {
      const date = (args as any).date ?? new Date().toISOString().slice(0, 10);
      const report = await apiFetch(`/reports/daily?date=${date}`, TRADING_API_KEY);
      return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
    }

    default:
      throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
  }
});

// ── Start server ──────────────────────────────────────────────
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Purple Flea custom MCP server running on stdio");

To use this server, add it to your claude_desktop_config.json the same way as the published servers, pointing command at node and args at your compiled output file.

Multi-Agent Patterns with an Orchestrator MCP Server

As your agent architecture matures, you may want a single high-level MCP server that fans out to the individual Purple Flea servers on behalf of an orchestrator agent. This pattern has several advantages:

  • Single connection surface. The orchestrator agent connects to one server; all routing is internal.
  • Composed transactions. Complex operations (e.g., "sell ETH and use proceeds to register a domain") can be implemented as atomic tools.
  • Centralized rate limiting and logging. All Purple Flea API calls flow through a single process where you can add audit logs, spend caps, and circuit breakers.
  • Sub-agent delegation. The orchestrator MCP server can itself spawn sub-agent LLM calls for tasks that require reasoning (e.g., deciding which position to reduce during a rebalance).

Orchestrator Architecture Diagram


  ┌─────────────────────────────────────────────────────┐
  │               Claude Orchestrator Agent              │
  │             (claude-opus-4-6 via API)                │
  └──────────────────────┬──────────────────────────────┘
                         │ MCP (stdio)
                         ▼
  ┌─────────────────────────────────────────────────────┐
  │           Orchestrator MCP Server                    │
  │   pf.execute_strategy / pf.compound_action          │
  │              (your Node.js process)                  │
  └──┬───────────────┬────────────────┬──────────────┬──┘
     │ MCP (stdio)   │ MCP (stdio)    │ MCP (stdio)  │ MCP (stdio)
     ▼               ▼                ▼              ▼
  wallet-mcp    trading-mcp      casino-mcp    domains-mcp
        

Orchestrator Server Skeleton

orchestrator-mcp/src/index.ts (key excerpt)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

// Helper: connect to a downstream Purple Flea MCP server
async function connectDownstream(pkg: string, envKey: string) {
  const t = new StdioClientTransport({
    command: "npx",
    args: [pkg],
    env: { ...process.env, [envKey]: process.env[envKey] },
  });
  const c = new Client({ name: "orchestrator", version: "1.0.0" }, { capabilities: {} });
  await c.connect(t);
  return c;
}

// Initialise all downstream connections at startup
const wallet  = await connectDownstream("@purple-flea/wallet-mcp",  "WALLET_API_KEY");
const trading = await connectDownstream("@purple-flea/trading-mcp", "TRADING_API_KEY");
const casino  = await connectDownstream("@purple-flea/casino-mcp",  "CASINO_API_KEY");
const domains = await connectDownstream("@purple-flea/domains-mcp", "DOMAINS_API_KEY");

// Compound tool: sell ETH → register domain
async function sellAndRegisterDomain(domainName: string, ethAmount: string) {
  // 1. Sell ETH to get USDC
  const order = await trading.callTool({
    name: "trading.place_market_order",
    arguments: { side: "sell", pair: "ETH/USDC", amount: ethAmount },
  });

  // 2. Check domain availability
  const avail = await domains.callTool({
    name: "domains.search_availability",
    arguments: { names: [domainName] },
  });

  // 3. Register if available
  const reg = await domains.callTool({
    name: "domains.register_domain",
    arguments: { name: domainName, years: 1 },
  });

  return { order, availability: avail, registration: reg };
}

By composing downstream MCP clients inside an upstream MCP server, you build a tree of tools that the orchestrator agent can invoke with a single high-level command. The pattern scales naturally: add more Purple Flea servers as downstream children, or add other third-party MCP servers into the same tree.

Note on concurrency

When fanning out to multiple downstream servers simultaneously, use Promise.all for independent calls and sequential awaits for calls with data dependencies. Downstream MCP stdio transports are single-threaded per process, so a slow downstream call will block that server's other requests — design your orchestrator accordingly.


Start Building with Purple Flea MCP Servers

Get your API keys in under a minute. Four MCP servers, no infrastructure to manage, production-grade financial tooling available immediately to any AI agent.

Get API Keys Free Read Full Docs

No credit card required for the free tier. Upgrade when you need higher rate limits.