Connect any MCP-compatible AI agent — Claude, GPT, AutoGen, LangChain — to Purple Flea's Casino, Trading, Wallet, and Domains APIs. 22 financial tools, zero API boilerplate.
The Model Context Protocol (MCP) is an open standard developed by Anthropic that lets AI models call external tools and data sources through a standardized interface. Instead of writing custom API integration code for every service, you configure an MCP server once, and the AI model can call tools by name with typed parameters.
MCP works like a universal adapter between AI models and APIs. The AI model doesn't need to know the HTTP method, headers, or authentication format of each API — it just calls casino_flip(amount=10, side="heads") and the MCP server handles the rest.
Purple Flea exposes four dedicated MCP servers (Casino, Trading, Wallet, Domains) plus StreamableHTTP endpoints for the Faucet and Escrow services. Together they expose 22+ tools that any MCP-compatible agent can call.
With direct REST: your agent needs to know the endpoint URL, HTTP method, Authorization header format, request body schema, and response parsing logic — for every single endpoint. With MCP: configure the server once, and the model receives the full tool schema automatically. Tool calls look like function calls, not HTTP requests. Errors are typed and structured.
POST to any Purple Flea service registration endpoint. Your API key is returned instantly — no email verification, no KYC, no dashboard.
Add the Purple Flea server config to your claude_desktop_config.json or agent MCP configuration. Paste your API key as an environment variable.
Your agent now has 22+ financial tools. Ask Claude to "flip a coin for $5" or "open a long ETH position with 5x leverage" — it works out of the box.
Step 1 — Get your API key:
# Register on Casino (also works for Trading, Wallet, Domains) curl -X POST https://api.purpleflea.com/api/v1/register \ -H 'Content-Type: application/json' \ -d '{"username":"my-agent","email":"agent@example.com"}' # Response: { "api_key": "sk_live_abc123...", "referral_code": "ref_xyz789", "agent_id": "ag_000001" }
Step 2 — Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{ "mcpServers": { "purpleflea-casino": { "command": "npx", "args": ["-y", "@purpleflea/casino-mcp"], "env": { "PURPLEFLEA_API_KEY": "sk_live_abc123..." } }, "purpleflea-trading": { "command": "npx", "args": ["-y", "@purpleflea/trading-mcp"], "env": { "PURPLEFLEA_API_KEY": "sk_live_abc123..." } }, "purpleflea-wallet": { "command": "npx", "args": ["-y", "@purpleflea/wallet-mcp"], "env": { "PURPLEFLEA_API_KEY": "sk_live_abc123..." } }, "purpleflea-domains": { "command": "npx", "args": ["-y", "@purpleflea/domains-mcp"], "env": { "PURPLEFLEA_API_KEY": "sk_live_abc123..." } } } }
Step 3 — It just works. Ask Claude anything:
User: "Flip a coin for $5 and show me the proof" Claude: [calls casino_flip(amount=5, side="heads")] → You won $9.80. Proof hash: sha256:a8f3c2...7d1e. Cryptographically verified. User: "Open a long ETH position with $1000 at 5x leverage" Claude: [calls trading_open(market="ETH-PERP", side="long", size=1000, leverage=5)] → Position opened. Entry: $3,240. Liquidation: $2,592. Position ID: pos_abc123 User: "Create a new HD wallet and show me my addresses" Claude: [calls wallet_create()] → Wallet created. ETH: 0x7a3f... BTC: bc1q... SOL: 7xKm... (mnemonic shown once — store it safely)
Every tool available across the four Purple Flea MCP servers.
| Tool | Description | Key params |
|---|---|---|
| casino_flip | Provably fair coin flip | amount, side (heads|tails) |
| casino_dice | Dice roll with custom target | amount, target (over|under), target_value |
| casino_custom | Custom win probability (1-99%) | amount, win_probability |
| casino_crash | Crash game with target multiplier | amount, target_multiplier |
| casino_roulette | European roulette | amount, bet_type, bet_value |
| casino_verify | Verify any past bet outcome | bet_id |
| casino_balance | Check current balance | (none) |
| casino_history | Past bets with proofs | limit? |
| Tool | Description | Key params |
|---|---|---|
| trading_markets | List 275+ perpetual markets | (none) |
| trading_open | Open a position (up to 50x leverage) | market, side, size, leverage |
| trading_close | Close an open position | position_id |
| trading_stop_loss | Set a stop-loss order | position_id, price |
| trading_take_profit | Set a take-profit order | position_id, price |
| trading_positions | List open positions with P&L | (none) |
| trading_orders | List open orders | (none) |
| Tool | Description | Key params |
|---|---|---|
| wallet_create | Generate BIP-39 HD wallet (8 chains) | (none) |
| wallet_balance | Check on-chain balance | address, chain |
| wallet_send | Sign and broadcast transaction | chain, to, amount, private_key, token? |
| wallet_swap_quote | Get cross-chain swap quote via Wagyu | from_chain, to_chain, from_token, to_token, amount |
| wallet_swap | Execute cross-chain swap | from_chain, to_chain, from_token, to_token, amount, to_address |
| Tool | Description | Key params |
|---|---|---|
| domains_search | Check domain availability + price | query, tlds[] |
| domains_register | Register a domain (crypto payment) | domain, years, auto_renew |
| domains_list | List your registered domains | (none) |
| domains_add_record | Add a DNS record (A, CNAME, TXT, MX) | domain, type, name, value, ttl |
| domains_delete_record | Delete a DNS record | domain, record_id |
Purple Flea MCP servers are compatible with any framework that supports the MCP protocol or OpenAI-compatible tool calling. Here's how to connect the most popular ones.
Use the official langchain-anthropic library with MCP tool binding:
# pip install langchain-anthropic mcp from langchain_anthropic import ChatAnthropic from langchain_mcp_adapters.client import MultiServerMCPClient async with MultiServerMCPClient({ "purpleflea-casino": { "command": "npx", "args": ["-y", "@purpleflea/casino-mcp"], "env": {"PURPLEFLEA_API_KEY": "sk_live_..."} } }) as client: tools = await client.get_tools() llm = ChatAnthropic(model="claude-sonnet-4-6").bind_tools(tools) result = await llm.ainvoke("Flip a coin for $5") print(result.content)
Use langchain-purpleflea (wraps the MCP tools for CrewAI compatibility):
# pip install crewai langchain-purpleflea from crewai import Agent, Task, Crew from langchain_purpleflea import CasinoTool, TradingTool, WalletTool trader = Agent( role="Crypto Trader", goal="Execute profitable perpetual futures trades", backstory="Expert algorithmic trader using Purple Flea APIs", tools=[TradingTool(api_key="sk_live_...")] ) task = Task( description="Open a long ETH position at 5x leverage with $1000", agent=trader ) Crew(agents=[trader], tasks=[task]).kickoff()
The Faucet and Escrow services use StreamableHTTP MCP endpoints directly:
{ "mcpServers": { "purpleflea-faucet": { "type": "streamable-http", "url": "https://faucet.purpleflea.com/mcp" }, "purpleflea-escrow": { "type": "streamable-http", "url": "https://escrow.purpleflea.com/mcp" } } }
MCP makes financial tool integration dramatically simpler than raw REST.
No headers, no HTTP methods, no response parsing. The MCP server handles auth and serialization. Your agent just calls tool names with typed params.
Every tool comes with a full JSON Schema definition. The LLM sees parameter names, types, and descriptions — reducing hallucinations and invalid calls.
MCP errors are typed and descriptive. Instead of parsing HTTP status codes and error bodies, your agent receives structured McpError objects it can handle programmatically.
Claude, GPT-4, Gemini, Mistral — any model with tool-calling support can use MCP tools via the client library. One server, every model.
No. Your casino API key works across Casino, Trading (if registered on trading.purpleflea.com), and Escrow. The Wallet and Domains services each have their own registration, but all share the same PURPLEFLEA_API_KEY environment variable name in the config.
The Wallet MCP supports Ethereum, Base, Solana, Bitcoin, Tron, Polygon, Arbitrum, and BNB. All addresses are derived from a single BIP-39 mnemonic. Cross-chain swaps route through Wagyu (aggregating 1inch, Paraswap, Jupiter, Li.Fi, 0x for best rates).
No — Purple Flea also provides direct REST APIs, Python and TypeScript SDKs, and npm packages for LangChain, CrewAI, and other frameworks. MCP is the fastest way to get started if you're using Claude Desktop or a framework with native MCP support. See the docs for all integration options.
Referral codes are embedded at registration time, not at tool-call time. When you call casino_flip, commissions flow to whoever referred the account associated with your API key. To earn commissions, refer other agents to register with your referral code — see for-agents for templates.
Get an API key, add 5 lines of config, and have 22+ financial tools available in Claude in minutes.