home / mcp / onedefi mcp server

ONEDeFi MCP Server

Provides multi-chain DeFi automation with AI insights, portfolio health checks, and yield optimization across Ethereum, Polygon, and Solana.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jmadhan1-onedefi-mcp": {
      "url": "https://your-repl-url/mcp",
      "headers": {
        "DEBUG": "true",
        "FLASK_ENV": "development",
        "SECRET_KEY": "YOUR_SECRET_KEY_PLACEHOLDER",
        "USE_TESTNET": "true",
        "OPENAI_API_KEY": "YOUR_API_KEY_PLACEHOLDER",
        "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com",
        "POLYGON_RPC_URL": "https://polygon-rpc.com",
        "ETHEREUM_RPC_URL": "https://cloudflare-eth.com"
      }
    }
  }
}

ONEDeFi is an AI-powered MCP server that coordinates DeFi operations across Ethereum, Polygon, and Solana. It provides real-time portfolio tracking, AI-driven health diagnostics, strategy generation, and guided DeFi actions, enabling automated optimization and risk assessment through a single, programmable endpoint.

How to use

You operate ONEDeFi through an MCP client by connecting to its MCP endpoint and issuing standardized requests for portfolio analysis, AI-assisted insights, and strategy recommendations. Use the server to analyze multi-chain portfolios, receive health diagnostics, and obtain yield optimization guidance. Treat the system as your DeFi operations cockpit: you can inspect health, get automated strategies aligned with your risk preferences, and query live DeFi data across Ethereum, Polygon, and Solana.

How to install

Prerequisites: ensure you have Python 3.8 or newer and Git installed on your system.

# Step 1: Clone the project
git clone [your-repo-url]
cd onedefi

# Step 2: Create and activate a virtual environment (recommended)
python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate.bat

# Step 3: Install Python dependencies
pip install -r requirements.txt

# Step 4: Create environment configuration
# Copy the template and populate values in a .env file
cp .env.template .env

Step 5: Run the application to start the MCP server.

python main.py

Additional information

Environment variables control AI features, blockchain access, and Flask behavior. You can customize these in a .env file or via your hosting platform's secrets management. The server exposes a web interface at the host URL and posts MCP requests to the /mcp endpoint for protocol interactions.

Available tools

Portfolio Doctor

AI-driven health diagnostics for your DeFi portfolio, with visual health scores and actionable improvement steps.

Strategy Sommelier

AI-generated investment strategies tailored to your risk profile and return goals.

Intelligent Risk Assessment

AI-powered analysis of DeFi positions to identify risks and mitigation opportunities.

Multi-Chain Orchestration

Coordinated operations across Ethereum, Polygon, and Solana for synchronized actions and analytics.