Teaching Claude DeFi: How We Built a Skill for Our MCP Server
MCP gives Claude tools. Skills teach Claude workflows.
Our @y0exchange/mcp server has been live for a while — 8 tools that give any AI agent real-time access to DeFi: balances, prices, gas, swap quotes, transaction history, and the ability to execute swaps and transfers across 5 chains.
But connecting an MCP server to Claude is only half the story. Without guidance, Claude calls tools in isolation. Ask it to swap tokens and it might execute without checking your balance first. Ask about gas and it won't suggest a cheaper chain. It has access but not expertise.
That's where Agent Skills come in — a new standard from Anthropic for teaching Claude domain-specific workflows. We built one for our MCP server.
What the y0 Skill does
The skill is a single folder with a SKILL.md file and reference documents. When a user has both the y0 MCP connector and the skill installed, Claude automatically follows DeFi best practices:
Pre-swap safety checks
Instead of blindly executing a swap, Claude now:
- Checks your balance to verify you have enough
- Checks gas costs on the target chain
- Gets a quote and shows you the expected output
- Waits for your explicit confirmation
- Only then builds the unsigned transaction
Gas optimization
When gas on Ethereum is expensive (>50 gwei), Claude proactively suggests L2 alternatives like Arbitrum or Base — where the same swap costs cents instead of dollars.
Smart slippage
The skill embeds slippage recommendations based on token type:
- Stablecoin swaps (USDC/USDT): 0.1-0.3%
- Major pairs (ETH/USDC): 0.5%
- Default for other tokens: 1%
- Large swaps (>$5k): reduced slippage to minimize impact
Native token reserve
If you try to swap your entire ETH balance, Claude warns you to keep some for gas — a mistake that catches even experienced DeFi users.
Portfolio analysis
Ask "check my portfolio" and Claude doesn't just list numbers. It flags concentration risk (>80% in one asset), shows per-chain distribution, and suggests rebalancing if the allocation is skewed.
The architecture: MCP + Skill
Think of it like a professional kitchen (Anthropic's own analogy):
- MCP server = the kitchen: ovens, knives, ingredients. It provides access to blockchain data and transaction building.
- Skill = the recipes: step-by-step instructions for creating something valuable. It provides expertise on how to combine tools effectively.
Together, a user says "swap 100 USDC to ETH on the cheapest chain" and Claude handles the entire workflow: check balances across chains, compare gas costs, find the best quote, show the breakdown, wait for confirmation, execute.
8 workflows, zero hand-holding
The skill covers the workflows that matter most in DeFi:
| Workflow | What Claude does |
|---|---|
| Portfolio Check | Aggregates holdings across 5 chains with USD values and risk flags |
| Token Swap | Balance check → gas check → quote → confirmation → execute |
| Send Tokens | Address verification → balance check → gas estimate → confirmation |
| Gas Optimization | Cross-chain comparison with cost estimates per operation type |
| Price Research | Current prices with 24h change, volatility warnings |
| Transaction History | Filtered history with type classification |
| Portfolio Rebalance | Multi-swap plan with individual confirmations and gas totals |
| Cross-Chain Comparison | Find the cheapest chain for any operation |
Non-custodial, always
The most important thing the skill enforces: never skip user confirmation for write operations. The MCP server builds unsigned transactions — the user always signs on their own device. The skill adds an extra layer by requiring Claude to show all details and wait for explicit approval before calling swap or send.
y0 never touches private keys. Not in the MCP server, not in the skill, not anywhere.
Try it
Install the MCP connector:
- In Claude.ai → Settings → Connectors → Add custom connector
- URL:
https://mcp.y0.exchange/mcp?key=YOUR_API_KEY
Install the skill:
- Download the skill folder from GitHub
- Zip it and upload in Claude.ai → Settings → Capabilities → Skills
Or use via npm (Claude Code, Cursor):
npx @y0exchange/mcp
The MCP server is open source under MIT license. The skill is included in the same repo.
Get your API key at app.y0.exchange. Read-only tools work without a key — try asking Claude about any wallet's portfolio or current gas prices.