@y0exchange/mcp
An MCP server that gives AI agents real-time access to DeFi across multiple chains, enabling non-custodial crypto trading, portfolio queries, and transaction execution.
README
<p align="center"> <strong>@y0exchange/mcp</strong> </p>
<p align="center"> <em>Let AI agents trade crypto. Non-custodial. Multi-chain. One MCP server.</em> </p>
<p align="center"> <a href="https://www.npmjs.com/package/@y0exchange/mcp"><img src="https://img.shields.io/npm/v/@y0exchange/mcp.svg?style=flat-square&color=4f46e5" alt="npm version"></a> <a href="https://www.npmjs.com/package/@y0exchange/mcp"><img src="https://img.shields.io/npm/dm/@y0exchange/mcp.svg?style=flat-square&color=34d399" alt="npm downloads"></a> <a href="https://github.com/y0exchange/y0exchange/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license"></a> <a href="https://y0.exchange"><img src="https://img.shields.io/badge/y0-exchange-4f46e5?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMCIgY3k9IjEwIiByPSIxMCIgZmlsbD0iIzRmNDZlNSIvPjwvc3ZnPg==" alt="y0.exchange"></a> </p>
What is this?
@y0exchange/mcp is a Model Context Protocol server that gives AI agents real-time access to DeFi — balances, prices, gas, swap quotes, transaction history, and the ability to execute swaps and transfers.
Connect it to Claude, ChatGPT, or any MCP-compatible AI client. Your users talk to AI, AI talks to the blockchain.
User → AI Agent → @y0exchange/mcp → Blockchain
↓
y0 Signing Service (user signs on their device)
Non-custodial by design. y0 never touches private keys. Write operations build unsigned transactions — the user always signs on their own device.
Quick Start
1. Get your API key
Sign in at app.y0.exchange → API Keys → copy your key.
2. Add connector (recommended)
The simplest way — works on Claude Desktop, claude.ai, Claude Mobile, and ChatGPT:
- Open your AI app → Settings → Connectors → Add custom connector
- Name:
y0 - URL:
https://mcp.y0.exchange/mcp?key=YOUR_API_KEY - Save — done!
No installs, no config files, no terminal. The API key links to your wallet — the AI agent automatically knows your address and permissions.
For developer IDEs (Cursor, Windsurf)
Add to your MCP config (e.g. .cursor/mcp.json):
{
"mcpServers": {
"y0": {
"command": "npx",
"args": ["-y", "@y0exchange/mcp"],
"env": {
"Y0_API_KEY": "y0_your_api_key_here"
}
}
}
}
Claude Code
claude mcp add --transport http y0 https://mcp.y0.exchange/mcp?key=YOUR_API_KEY
Any MCP client (stdio)
Y0_API_KEY=y0_... npx @y0exchange/mcp
The server communicates over stdio — compatible with any MCP client.
Read-only mode
Without Y0_API_KEY, read-only tools (balances, prices, gas, quotes, history) still work. Omit the key to experiment without an account.
Remote Server (HTTP)
The hosted remote server at mcp.y0.exchange powers the connector approach above. You can also self-host it.
Self-host the remote server
# Build
pnpm --filter @y0exchange/mcp build
# Run
pnpm --filter @y0exchange/mcp start:remote
# Or with Docker
docker build -f mcp/Dockerfile -t y0-mcp-remote .
docker run -p 3100:3100 \
-e SIGNING_SERVICE_URL=https://api.y0.exchange \
-e ZEROX_API_KEY=your_key \
y0-mcp-remote
The remote server exposes:
POST /mcp— Streamable HTTP MCP endpointGET /health— health check
Environment variable PORT controls the listening port (default: 3100).
How it differs from stdio
stdio (npx) |
Remote (HTTP) | |
|---|---|---|
| Runs on | User's machine | Your server |
| Transport | stdin/stdout | Streamable HTTP |
| Works on mobile | No | Yes |
| Works on claude.ai | No | Yes |
| Auth | Y0_API_KEY env var |
?key= in URL or Authorization header |
| Deployment | None (npm) | Docker / any Node.js host |
Tools
Read-only — work out of the box, no API keys required
| Tool | Description |
|---|---|
get_balance |
Native + ERC-20 token balances for any wallet |
get_portfolio |
Aggregated portfolio across all chains with USD values |
get_price |
Real-time token prices with 24h change |
get_quote |
Swap quotes with routing preview, fees, and gas estimate |
get_gas |
Gas prices across chains with USD cost estimates |
get_history |
Transaction history with smart classification |
Write — requires Y0_API_KEY
| Tool | Description |
|---|---|
swap |
Build unsigned swap tx → user approves on device |
send |
Build unsigned transfer tx → user approves on device |
Write tools use your API key to identify your wallet. The AI agent never needs to ask for your address — it's resolved automatically from the key.
Supported Chains
| Chain | ID | Status |
|---|---|---|
| Ethereum | 1 |
Production |
| BNB Chain | 56 |
Production |
| Arbitrum | 42161 |
Production |
| Base | 8453 |
Production |
| Polygon | 137 |
Production |
Configuration
All configuration is via environment variables. None are required for read-only tools.
Core
| Variable | Description | Default |
|---|---|---|
Y0_API_KEY |
Your y0 API key (required for swap/send) | — |
SIGNING_SERVICE_URL |
y0 Signing Service endpoint | https://api.y0.exchange |
Swap Providers
| Variable | Description |
|---|---|
ZEROX_API_KEY |
0x swap API key (tried first) |
ONEINCH_API_KEY |
1inch swap API key (fallback) |
Block Explorers (for get_history)
| Variable | Description |
|---|---|
ETHERSCAN_API_KEY |
Etherscan API key |
BSCSCAN_API_KEY |
BSCScan API key |
ARBISCAN_API_KEY |
Arbiscan (falls back to Etherscan key) |
BASESCAN_API_KEY |
BaseScan (falls back to Etherscan key) |
POLYGONSCAN_API_KEY |
PolygonScan (falls back to Etherscan key) |
Pricing
| Variable | Description |
|---|---|
COINGECKO_API_KEY |
CoinGecko Pro key (optional, free tier works) |
How Swaps Work
1. User says: "Swap 1 ETH to USDC"
2. AI calls get_quote → shows price, fees, slippage
3. User confirms → AI calls swap (no wallet address needed — resolved from API key)
4. MCP authenticates with y0 Signing Service via Y0_API_KEY
→ builds unsigned transaction
→ sends push notification to user's mobile app
5. User reviews and signs on their device (biometric + wallet)
6. Transaction executes on-chain
Your keys never leave your device. The MCP server and y0 Signing Service only handle unsigned transaction payloads.
Example Conversations
"What's my portfolio worth?"
AI calls
get_portfolio→ returns breakdown by chain, token allocations, total USD value
"How much gas would a swap cost on Base right now?"
AI calls
get_gaswith chainId 8453 → returns gas price + USD estimates for different tx types
"Swap 500 USDC to ETH on Arbitrum"
AI calls
get_quote→ shows expected output → user confirms →swapbuilds unsigned tx → user signs
"Send 0.5 ETH to vitalik.eth"
AI calls
send→ builds unsigned transfer → user signs on device
Skill: Smarter DeFi Workflows
The MCP server gives Claude access to DeFi tools. The y0 DeFi Skill teaches Claude how to use them well — checking balances before swaps, warning about gas costs, recommending optimal chains, and following DeFi best practices automatically.
What it adds
- Pre-swap safety checks (balance, gas, slippage recommendations)
- Portfolio analysis with concentration risk warnings
- Cross-chain gas comparison and routing suggestions
- Confirmation gates before any write operation
- Domain expertise: stablecoin slippage, native token reserves, test transaction recommendations
Install the skill
Claude.ai:
- Download skill.zip
- Go to Settings → Capabilities → Skills
- Click Upload skill and select the downloaded
skill.zip - Make sure your y0 MCP connector is also connected
Claude Code:
# Place the skill folder in your Claude Code skills directory
cp -r skill/ ~/.claude/skills/y0-defi-assistant/
Verify it works
Ask Claude: "Check my crypto portfolio" — it should automatically call get_portfolio, present a clear breakdown, and note any concentration risks or gas optimization opportunities.
For B2B Partners
Building an AI-powered trading product? y0 provides the infrastructure:
- MCP server — this package, plug into any AI agent
- Signing UI — white-label transaction approval widget
- Signing Service — managed backend for transaction building + lifecycle
- B2B Portal — API keys, usage dashboards, billing
Get in touch to set up your integration.
Architecture
┌───────────────────────────────────────────────────────────┐
│ AI Agents │
│ Claude Desktop / Claude Code / Cursor / GPT / custom │
│ claude.ai / Claude Mobile │
└──────────┬───────────────────────────────┬────────────────┘
│ stdio (local) │ HTTP (remote)
│ npx @y0exchange/mcp │ .../mcp?key=YOUR_API_KEY
▼ ▼
┌──────────────────────────────────────────────────────────┐
│ @y0exchange/mcp │
│ │
│ ┌─────────────────┐ ┌──────────────────┐ │
│ │ Read Tools │ │ Write Tools │ │
│ │ │ │ │ │
│ │ get_balance │ │ swap ─────────────► y0 Signing │
│ │ get_portfolio │ │ send ─────────────► Service │
│ │ get_price │ │ │ │
│ │ get_quote │ └──────────────────┘ │
│ │ get_gas │ │
│ │ get_history │ │
│ └────────┬─────────┘ │
└───────────┼───────────────────────────────────────────────┘
│
┌────────▼─────────┐
│ Blockchain RPCs │
│ CoinGecko API │
│ 0x / 1inch APIs │
│ Block Explorers │
└───────────────────┘
Mobile / Web (claude.ai, Claude Mobile):
Uses remote HTTP server — no local process needed.
Desktop / CLI (Claude Desktop, Claude Code, Cursor):
Can use either stdio (npx) or remote HTTP.
Development
# Clone the monorepo
git clone https://github.com/y0exchange/y0exchange.git
cd y0exchange
# Install dependencies
pnpm install
# Build
pnpm --filter @y0exchange/mcp build
# Run stdio server (local dev)
pnpm --filter @y0exchange/mcp start
# Run remote HTTP server (local dev)
pnpm --filter @y0exchange/mcp start:remote
# Watch mode (rebuilds on change)
pnpm --filter @y0exchange/mcp dev
License
MIT — use it freely in your products. See LICENSE for details.
<p align="center"> Built by <a href="https://y0.exchange"><strong>y0.exchange</strong></a> — AI-native DeFi infrastructure </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。