ONEDeFi MCP Server
Enables AI-powered DeFi operations across Ethereum, Polygon, and Solana with automated portfolio optimization, risk assessment, and yield farming strategies. Provides intelligent portfolio diagnostics, investment strategy generation, and multi-chain DeFi protocol integration through natural language.
README
ONEDeFi - AI-Powered Multi-Chain DeFi MCP Server
🚀 Project Information
Primary Contact: J Madhan - (https://t.me/MadhanJ)
Team: Solo
Project Title: ONEDeFi - AI-Powered Multi-Chain DeFi MCP Server
💡 One-Sentence Elevator Pitch
ONEDeFi is an AI-powered Model Context Protocol (MCP) server that enables intelligent DeFi operations across Ethereum, Polygon, and Solana with automated portfolio optimization, risk assessment, and yield farming strategies.
📋 Detailed Project Description
ONEDeFi revolutionizes DeFi interaction by combining blockchain technology with advanced AI capabilities. The platform serves as a comprehensive MCP server that allows AI agents to perform sophisticated DeFi operations including:
🎯 Core Features
- Multi-Chain Portfolio Management: Real-time tracking across Ethereum, Polygon, and Solana
- AI Portfolio Doctor: Health diagnostics with personalized treatment plans
- Strategy Sommelier: Wine-themed AI investment strategies based on risk profiles
- Smart Chat Assistant: Intelligent DeFi guidance and market insights
- Automated Yield Optimization: AI-driven recommendations for maximizing returns
- Risk Assessment: Comprehensive portfolio analysis and risk management
🏗️ Technical Architecture
- Backend: Python Flask with SQLite database
- Blockchain Integration: Web3.py for Ethereum/Polygon, Solana SDK for Solana
- AI Integration: Comput3 AI API with LLaMA models
- Protocol Compliance: Model Context Protocol (MCP) JSON-RPC 2.0
- Frontend: Bootstrap 5 responsive design
- Deployment: Gunicorn on Replit infrastructure
🔧 DeFi Protocols Supported
- DEX Operations: Uniswap V2/V3, SushiSwap, QuickSwap, Raydium, Orca
- Lending: Aave V3, Compound V3, Solend
- Yield Farming: Liquidity provision and reward farming
- Staking: Liquid staking through Lido
🛠️ Installation Steps
-
Clone the repository:
git clone [your-repo-url] cd onedefi -
Install dependencies (handled automatically by Replit):
uv sync -
Set up environment variables (see Environment Variables section)
-
Run the application:
python main.py
The application will start on http://0.0.0.0:5000 and be accessible via Replit's web interface.
🔐 Environment Variables
Create a .env file or set the following environment variables:
# Required for AI features
OPENAI_API_KEY=your_comput3_api_key_here
# Blockchain RPC URLs (optional - uses public RPCs by default)
ETHEREUM_RPC_URL=https://cloudflare-eth.com
POLYGON_RPC_URL=https://polygon-rpc.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Development settings
USE_TESTNET=true
DEBUG=true
# Flask settings
FLASK_ENV=development
SECRET_KEY=your_secret_key_here
Note: For AI features to work, you'll need a Comput3 API key. Set it in the Replit Secrets tab as OPENAI_API_KEY.
📖 Usage Example
1. Web Interface
Navigate to your Replit URL to access the web interface:
- Dashboard: Portfolio overview and analytics
- AI Features: Access Portfolio Doctor, Strategy Sommelier, and Chat Assistant
- API Docs: Complete API documentation
2. MCP Protocol Usage
import requests
# Analyze portfolio
response = requests.post("https://your-repl-url/mcp", json={
"jsonrpc": "2.0",
"method": "defi.portfolio",
"params": {
"wallet_address": "0x742d35Cc6641C88c4f95bbCdDB96a2b0f0f3f6b7f",
"blockchain": "ethereum"
},
"id": 1
})
3. AI Features Usage
# Portfolio health check
response = requests.post("https://your-repl-url/api/v1/ai/portfolio-checkup", json={
"wallet_address": "0x742d35Cc6641C88c4f95bbCdDB96a2b0f0f3f6b7f",
"blockchain": "ethereum"
})
# Create investment strategy
response = requests.post("https://your-repl-url/api/v1/ai/create-strategy", json={
"goals": "I want steady 8% returns with low risk",
"wallet_address": "0x742d35Cc6641C88c4f95bbCdDB96a2b0f0f3f6b7f"
})
🐛 Known Issues
- Icon Warnings: Feather icons 'wallet' and 'brain' are not valid - these are cosmetic warnings that don't affect functionality
- Testnet Mode: Currently runs in testnet mode for safety - set
USE_TESTNET=falsefor mainnet operations - Rate Limits: Public RPC endpoints have rate limits - consider using premium RPC providers for production
- AI Dependencies: Some AI features require internet connectivity to Comput3 API
✅ MCP End-to-End Functionality
Status: Yes – fully functional
The MCP server is production-ready with:
- ✅ All 8 MCP methods implemented and tested
- ✅ JSON-RPC 2.0 compliance verified
- ✅ Multi-chain blockchain connections active
- ✅ AI integration working with Comput3 API
- ✅ Web interface fully operational
- ✅ Portfolio analytics and risk assessment functional
- ✅ Real-time DeFi protocol integration
Test Results:
🌐 Web Interface: ✅ ALL PASS
🤖 MCP Protocol: ✅ PASS
🧠 AI Agent: ✅ PASS
⛓️ Blockchain Connections: ✅ ALL CONNECTED
🔗 Chains Integrated
- ✅ Ethereum (Mainnet/Testnet)
- ✅ Solana (Mainnet/Devnet)
- ✅ Polygon (Mainnet/Testnet)
🖥️ Primary Compute Provider
Comput3 - Used for AI analysis, strategy generation, and chat assistance via their LLaMA model endpoints.
📜 License
MIT License - Open source and free to use, modify, and distribute.
🎯 Additional Information
🏆 Hackathon Features
This project showcases cutting-edge AI integration in DeFi:
- Portfolio Doctor: Medical-themed portfolio diagnostics with visual health scores
- Strategy Sommelier: Wine-themed investment strategies with personality descriptions
- Intelligent Risk Assessment: AI-powered analysis of DeFi positions
- Multi-Chain Orchestration: Seamless operations across 3 major blockchains
🔧 Technical Highlights
- Production-Ready: Comprehensive error handling, logging, and security measures
- Scalable Architecture: Modular design with clear separation of concerns
- Real-Time Data: Live blockchain integration with portfolio tracking
- AI-Native: Built from ground up with AI integration as core feature
🚀 Deployment
- Platform: Deployed on Replit with automatic scaling and SSL
- Uptime: 99.9% availability target with monitoring
- Performance: <200ms API response times
- Security: Environment variable management and testnet safety mode
📈 Future Roadmap
- Additional blockchain support (BSC, Avalanche)
- Advanced trading strategies and automated rebalancing
- Mobile app integration
- Enhanced risk management tools
Contact: For questions, issues, or contributions, please reach out via Telegram @MadhanJ
Built with ❤️ for the future of AI-powered DeFi
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。