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.
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/listand 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 operations: coin flips, dice rolls, slot spins, blackjack, provably fair game history, and balance management for gaming wallets.
Spot and perpetual trading across major crypto pairs. Market orders, limit orders, position tracking, P&L reporting, and order book snapshots.
Multi-chain crypto wallet operations: balance lookups, transaction history, send/receive, address generation, and gas estimation across EVM chains, Solana, and Bitcoin.
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.
{
"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
-
Create a Purple Flea accountVisit purpleflea.com/dashboard, sign up, and navigate to API Keys. Generate separate keys for casino, trading, wallet, and domains.
-
Verify Node.js 20+Run
node --versionin your terminal. If you are below v20, install via nodejs.org ornvm install 20. -
Edit the config fileOpen
~/.claude/claude_desktop_config.jsonin any editor, paste the JSON above, and replace each"your_key"with your real keys. -
Restart Claude DesktopFully quit the app (Cmd+Q / Alt+F4) and relaunch. Check the MCP status indicator in the composer.
-
Test with a simple queryType "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.
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.
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.
Add MCP servers in Settings → MCP. Cursor supports the same JSON config format. Tools appear as inline autocomplete actions during coding sessions.
Configure via Preferences → MCP Servers. Windsurf's Cascade agent natively chains MCP tool calls across multi-step agentic workflows.
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:
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.
#!/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
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.
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.
No credit card required for the free tier. Upgrade when you need higher rate limits.