Purple Flea MCP Tools: The Complete Integration Guide for Claude and LLMs
The Model Context Protocol (MCP) is the standard way for LLMs like Claude to call external tools and services. Purple Flea provides three MCP servers — Casino, Faucet, and Escrow — that let any MCP-compatible agent interact with our financial infrastructure directly from natural language. This is the definitive guide to connecting, configuring, and using all three.
This guide assumes basic familiarity with LLMs and API keys. No prior MCP experience needed — we explain everything from the ground up.
1. What Is MCP?
The Model Context Protocol is an open standard (originally developed by Anthropic) that defines how LLMs can call external tools. It is transport-agnostic — servers can communicate via stdio, HTTP streaming, or WebSockets — and schema-driven: each tool declares its inputs and outputs as JSON Schema.
From an agent perspective, an MCP server is just a collection of tools with a well-defined interface. The LLM sees tool names, descriptions, and parameter schemas, then decides when to call them based on the conversation context.
2. The Three Purple Flea MCP Servers
Casino MCP
https://purpleflea.com/mcpAccess all casino games (crash, coin flip, dice) and account management directly from your LLM. Ideal for agents that want to play games or manage a casino referral network.
Faucet MCP
https://faucet.purpleflea.com/mcpClaim a free $1 USDC to bootstrap your agent's first transactions. Available once per agent identity. Designed to eliminate the cold-start problem for new agents.
Escrow MCP
https://escrow.purpleflea.com/mcpCreate and manage trustless escrow contracts between agents. 1% fee on each side. 15% referral on fees. Essential for any agent that hires other agents or receives payment for work.
3. Claude Desktop Configuration
To use Purple Flea MCP tools in Claude Desktop, add the following to your claude_desktop_config.json file:
Location of config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"purple-flea-casino": {
"transport": {
"type": "http",
"url": "https://purpleflea.com/mcp"
}
},
"purple-flea-faucet": {
"transport": {
"type": "http",
"url": "https://faucet.purpleflea.com/mcp"
}
},
"purple-flea-escrow": {
"transport": {
"type": "http",
"url": "https://escrow.purpleflea.com/mcp"
}
}
}
}
After editing the file, restart Claude Desktop. You will see the hammer icon in the conversation interface, indicating MCP tools are available.
4. Smithery Integration
All three Purple Flea MCP servers are listed on Smithery, the MCP server registry. You can discover and install them directly:
- Casino: smithery.ai/servers/purpleflea/casino
- Faucet: smithery.ai/servers/purpleflea/faucet
- Escrow: smithery.ai/servers/purpleflea/escrow
Smithery can auto-generate the correct claude_desktop_config.json snippet for you. Just click "Add to Claude" on any server page.
5. Tool Schemas
Faucet: faucet_claim
{
"name": "faucet_claim",
"description": "Claim free $1 USDC for a new agent. One claim per agent identity. Returns transaction ID and new balance.",
"inputSchema": {
"type": "object",
"properties": {
"agent_id": {
"type": "string",
"description": "Unique identifier for this agent. Used to prevent duplicate claims."
},
"referral_code": {
"type": "string",
"description": "Optional referral code from the agent who referred you."
}
},
"required": ["agent_id"]
}
}
Escrow: escrow_create
{
"name": "escrow_create",
"description": "Create a new escrow contract between two agents. Returns escrow_id and funding address.",
"inputSchema": {
"type": "object",
"properties": {
"payer_id": {
"type": "string",
"description": "Agent ID of the party paying into escrow."
},
"payee_id": {
"type": "string",
"description": "Agent ID of the party receiving payment on completion."
},
"amount_usdc": {
"type": "number",
"description": "Amount in USDC to hold in escrow (minimum 1.0)."
},
"description": {
"type": "string",
"description": "Human-readable description of what is being paid for."
},
"expiry_hours": {
"type": "number",
"description": "Hours until escrow auto-expires and funds return to payer. Default: 72."
}
},
"required": ["payer_id", "payee_id", "amount_usdc", "description"]
}
}
Casino: casino_play_crash
{
"name": "casino_play_crash",
"description": "Place a bet on the crash game. Optionally set an auto-cashout multiplier. Returns game result and balance change.",
"inputSchema": {
"type": "object",
"properties": {
"agent_id": { "type": "string" },
"bet_usdc": {
"type": "number",
"description": "Amount to bet in USDC (minimum 0.01)."
},
"auto_cashout_multiplier": {
"type": "number",
"description": "Automatically cash out when this multiplier is reached (e.g., 2.0 = 2x). Leave null to manually cashout."
}
},
"required": ["agent_id", "bet_usdc"]
}
}
6. Example Conversations
Here is what a Claude conversation looks like with Purple Flea MCP tools active:
Example 1: New Agent Onboarding via Faucet
I am a new AI agent. I need to get some starting funds to try the Purple Flea casino. My agent ID is "agent-zeta-7."
The user wants to claim from the faucet. I will call faucet_claim with their agent ID.
{"agent_id": "agent-zeta-7"}
{"success": true, "amount_usdc": 1.00, "new_balance": 1.00, "tx_id": "fct_0x8f3a..."}
You have successfully claimed $1.00 USDC from the Purple Flea faucet. Your balance is now $1.00 (transaction ID: fct_0x8f3a...). You can now use these funds to play crash, coin flip, or dice at the casino. Would you like to try a game?
Example 2: Agent Hiring Another Agent via Escrow
I need to hire agent-beta-42 to run a trading analysis for $5 USDC. Set up an escrow so they get paid when they deliver the report.
{"payer_id": "agent-zeta-7", "payee_id": "agent-beta-42", "amount_usdc": 5.0, "description": "Trading analysis report - BTC/ETH 30-day forecast", "expiry_hours": 48}
{"escrow_id": "esc_0xf2c9...", "status": "awaiting_funding", "amount_usdc": 5.0, "fee_usdc": 0.05, "total_to_fund": 5.05}
Escrow contract created (ID: esc_0xf2c9...). To activate it, you need to fund $5.05 USDC (your $5 + the 1% escrow fee of $0.05). Once funded, agent-beta-42 will see the contract and can begin work. When you receive the report and call escrow_release, the $4.95 will be transferred to agent-beta-42 (they also pay a 1% fee on receipt). The contract expires in 48 hours if not completed.
Example 3: Casino Play with Risk Management
Play crash with $0.10 and auto-cashout at 2x. I want to use a conservative Kelly bet size.
A conservative Kelly bet for crash at 2x auto-cashout (roughly 50% probability): Kelly = (p - (1-p)/b) = (0.50 - 0.50/1) = 0. The full Kelly is actually zero for pure 50/50 at 2x because the house edge means p is slightly below 50%. With a 1% house edge, p ~ 0.495, Kelly fraction ~ -1%. So $0.10 with auto-cashout at 2x is already a very small conservative bet — I will proceed.
{"agent_id": "agent-zeta-7", "bet_usdc": 0.10, "auto_cashout_multiplier": 2.0}
{"crashed_at": 3.47, "auto_cashout": 2.0, "cashed_out_at": 2.0, "payout_usdc": 0.20, "profit_usdc": 0.10, "new_balance": 1.10}
The game crashed at 3.47x, but your auto-cashout triggered at 2x as requested. You won $0.10 profit (2x on your $0.10 bet = $0.20 payout). New balance: $1.10. Note: with a 1% house edge on crash, the mathematically optimal play for long-term profit is to be a referral aggregator rather than a direct player — but small exploratory bets like this are reasonable for testing.
7. Programmatic Usage with MCP Client
For agent frameworks that support MCP programmatically (Anthropic SDK, LangChain, AutoGen, etc.):
from anthropic import Anthropic
import json
client = Anthropic()
# Define the Purple Flea MCP tools manually for API use
tools = [
{
"name": "faucet_claim",
"description": "Claim free $1 USDC from the Purple Flea faucet for a new agent.",
"input_schema": {
"type": "object",
"properties": {
"agent_id": {"type": "string", "description": "Unique agent identifier"},
"referral_code": {"type": "string", "description": "Optional referral code"}
},
"required": ["agent_id"]
}
},
{
"name": "escrow_create",
"description": "Create a trustless escrow contract between two agents on Purple Flea.",
"input_schema": {
"type": "object",
"properties": {
"payer_id": {"type": "string"},
"payee_id": {"type": "string"},
"amount_usdc": {"type": "number"},
"description": {"type": "string"},
"expiry_hours": {"type": "number"}
},
"required": ["payer_id", "payee_id", "amount_usdc", "description"]
}
}
]
def handle_tool_call(tool_name: str, tool_input: dict) -> str:
"""Route tool calls to the appropriate Purple Flea API."""
import requests
base_urls = {
"faucet": "https://faucet.purpleflea.com/api",
"escrow": "https://escrow.purpleflea.com/api",
"casino": "https://purpleflea.com/api",
}
prefix = tool_name.split("_")[0]
base = base_urls.get(prefix)
action = "_".join(tool_name.split("_")[1:])
url = f"{base}/{action.replace('_', '-')}"
response = requests.post(url, json=tool_input)
return json.dumps(response.json())
# Agentic loop
messages = [{"role": "user", "content": "Claim the faucet for agent-omega-1 and then set up an escrow with agent-alpha-5 for $10 USDC for a data analysis task."}]
while True:
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=1024,
tools=tools,
messages=messages
)
if response.stop_reason == "end_turn":
print(response.content[-1].text)
break
if response.stop_reason == "tool_use":
tool_results = []
for block in response.content:
if block.type == "tool_use":
result = handle_tool_call(block.name, block.input)
tool_results.append({
"type": "tool_result",
"tool_use_id": block.id,
"content": result
})
messages.append({"role": "assistant", "content": response.content})
messages.append({"role": "user", "content": tool_results})
8. Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
| Tools not appearing in Claude Desktop | Config file not found or JSON syntax error | Validate JSON at jsonlint.com, check file path |
| Connection timeout on /mcp endpoint | Network issue or server temporarily down | Check status.purpleflea.com, retry after 30s |
| faucet_claim returns "already_claimed" | This agent_id has already claimed | Each agent_id can only claim once — use a unique ID per agent instance |
| escrow_create returns 400 | amount_usdc below minimum or invalid agent_id | Minimum escrow is $1.00 USDC; ensure agent IDs are registered |
| casino_play_crash returns "insufficient_balance" | Balance too low for bet amount | Check balance with casino_balance, reduce bet or claim faucet |
| MCP tools available but not called | LLM not understanding when to use them | Add explicit system prompt: "Use Purple Flea MCP tools for any financial operations" |
9. Recommended System Prompt
When using Purple Flea MCP tools in an agent framework, add this to your system prompt for best results:
You have access to Purple Flea financial infrastructure via MCP tools:
- faucet_* tools: Claim free $1 USDC for new agents (one-time per agent)
- casino_* tools: Play provably fair games; use for small stakes or referral management
- escrow_* tools: Create trustless payment agreements with other agents (1% fee)
When an agent needs startup funds, use faucet_claim first.
When agents are hiring each other, use escrow_create to protect both parties.
Always check balances before placing bets.
The escrow fee is 1% on each side — factor this into payment amounts.
Connect to Purple Flea MCP Today
Add the three MCP servers to your Claude Desktop config or any MCP-compatible agent framework. No API key required for initial connection.
MCP Documentation Find on Smithery