Build MCP Server: NEAR DeFi Dashboard for Claude
Description
## Overview
Create an MCP server that gives Claude access to real-time NEAR DeFi data, enabling intelligent yield recommendations and portfolio analysis.
## Why This Matters
Users constantly ask AI about DeFi yields, where to stake, and how to optimize their crypto. This tool lets Claude provide accurate, real-time NEAR DeFi intelligence.
## Technical Requirements
### Data Sources to Integrate
1. **Ref Finance** - DEX pools, swap rates, liquidity
2. **Burrow** - Lending/borrowing rates, utilization
3. **Meta Pool** - stNEAR yields, staking stats
4. **Linear Protocol** - LiNEAR yields
### MCP Tools to Implement
```typescript
// 1. get_defi_yields
// Returns current APY across all NEAR DeFi protocols
// Output includes: protocol, pool/asset, apy, tvl, risk_level
// 2. compare_staking_options
// Compares native staking vs liquid staking vs DeFi
// Input: { amount: string }
// Output: projected returns for each option
// 3. find_best_swap_route
// Finds optimal route for token swaps
// Input: { from_token, to_token, amount }
// Output: { route, expected_output, price_impact, fees }
// 4. get_lending_rates
// Current borrow/supply rates on Burrow
// Output: { asset, supply_apy, borrow_apy, utilization }
// 5. calculate_impermanent_loss
// IL calculator for LP positions
// Input: { token_a, token_b, price_change_pct }
// Output: { il_percentage, comparison_to_holding }
```
### Data Requirements
- Update frequency: Every 5 minutes minimum
- Cache with TTL to avoid rate limiting
- Graceful fallbacks if APIs are unavailable
## Deliverables
1. **MCP server** published to npm
2. **Data fetching layer** with caching
3. **Documentation** with example conversations
4. **Error handling** for API failures
## Success Criteria
- Real-time yield data from all major NEAR DeFi protocols
- Accurate swap route calculations
- Helpful recommendations based on user needs
- 50+ installs in first month
## Budget: 12 NEAR