home / mcp / defi trading agent mcp server
DeFi Trading Agent MCP Server - Transform your AI into an autonomous crypto trading agent
Configuration
View docs{
"mcpServers": {
"edkdev-defi-trading-mcp": {
"command": "npx",
"args": [
"defi-trading-mcp"
],
"env": {
"USER_ADDRESS": "0xYourWalletAddress",
"ALCHEMY_API_KEY": "your_alchemy_api_key",
"USER_PRIVATE_KEY": "your_private_key_here",
"COINGECKO_API_KEY": "CG-your_coingecko_api_key"
}
}
}
}You can transform your AI assistant into an autonomous DeFi trading agent that analyzes markets in real time, manages multi-chain portfolios, and executes trades with smart risk controls. This MCP server enables you to access advanced market intelligence, portfolio metrics, and gasless trade execution across 17+ blockchains from a single integration point.
You interact with the trading agent through your MCP client to perform tasks like scanning for new liquidity events, analyzing OHLCV data, and executing trades. Start by loading the MCP server in your client, then issue natural-language prompts or scripted commands to retrieve portfolio insights, run technical analyses, or place trades. The agent can continuously monitor portfolios, identify entry points, manage positions with stop-loss rules, and execute gasless swaps when you authorize.
Prerequisites: ensure you have Node.js and npm installed on your machine.
# Install the MCP package globally
npm install -g defi-trading-mcp
```
```bash
# Optional: Create a new wallet for secure trading
npx defi-trading-mcp --create-walletThe MCP server requires crypto and API credentials to operate. You provide these through environment variables in your MCP client configuration.
{
"mcpServers": {
"defi_trading": {
"command": "npx",
"args": ["defi-trading-mcp"],
"env": {
"USER_PRIVATE_KEY": "your_private_key_here",
"USER_ADDRESS": "0xYourWalletAddress",
"COINGECKO_API_KEY": "CG-your_coingecko_api_key",
"ALCHEMY_API_KEY": "your_alchemy_api_key"
}
}
}
}Private keys stay on your device and are used only to sign transactions locally. No sensitive data is transmitted to external servers. Ethereum transactions receive MEV protection, private mempool routing, and fair pricing without manipulation.
The system is designed to protect trades from front-running and sandwich attacks while maintaining automatic protection with default safeguards. No extra configuration is needed to enable MEV protection.
Autonomous Portfolio Management, Intelligent Market Analysis, Advanced Trade Execution, and Risk Management & Security are core capabilities. You can run multi-chain portfolio analysis, detect trending pools, pull OHLCV data for technical analysis, and execute optimized swaps across supported networks.
The agent exposes a suite of tools to support multi-chain trading and analysis, including portfolio management, market intelligence, smart trading, gasless trading, and utility tools for unit conversions. You can query prices, get swap quotes, execute trades, and monitor gasless swap status.
Key tool areas include: portfolio management, market intelligence and analysis, smart trading, gasless trading, and utility tools for unit conversions.
Trade across 17+ blockchains, including Ethereum, Base, Polygon, Arbitrum, Optimism, BSC, Avalanche, Linea, Scroll, Mantle, and more. Use the agent to discover supported chains and execute cross-chain strategies.
Join the community for support, discussions, and updates. Open issues for bugs, start conversations for improvements, and review guides for API usage and loading data.
Multi-chain portfolio analysis with prices and metadata
Fast balance checking across all chains
Complete transaction history analysis
Identify hot trading opportunities with volume metrics
Discover newly launched tokens and liquidity pools
Technical analysis with OHLCV candlestick data
Analyze recent trading activity and whale movements
Real-time pricing with 24h change indicators
Deep token research with metadata and social links
Comprehensive token analysis including descriptions
Find specific pools by token symbol or contract address
Get best prices across all DEXes
Get executable quotes with transaction data
Execute trades with optimal routing
List all 17+ supported blockchains
Get prices for gas-free trades
Get gasless swap quotes
Execute trades without holding ETH
Monitor gasless transaction status
Convert blockchain units to human-readable form
Convert amounts to blockchain format