aura-mcp-chatgpt

envexx/aura-mcp-chatgpt

3.2

If you are the rightful owner of aura-mcp-chatgpt and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

AURA AI Trading Assistant MCP is an advanced Model Context Protocol server that integrates AURA API with ChatGPT, automated trading features, and x402 micropayments, designed for the AdEx AURA API Hackathon.

AURA AI Trading Assistant MCP

An advanced Model Context Protocol (MCP) server that integrates AURA API with ChatGPT, automated trading features, and x402 micropayments. This project is built for the AdEx AURA API Hackathon, combining the power of AI with DeFi analytics and automation.

🌟 Features

Aura MCP Server

Aura MCP (Model Context Protocol) Server adalah platform trading AI yang menyediakan analisis portfolio, rekomendasi strategi, dan eksekusi trade dengan sistem micropayment terintegrasi.

šŸš€ Available Tools

šŸ’° Core Trading Tools (FREE)

ToolDescriptionCostInput
analyze_portfolioAI portfolio analysisFREEwallet_address
get_strategiesInvestment strategiesFREEwallet_address, risk_tolerance
execute_tradeExecute tradesFREEwallet_address, from_token, to_token, amount
setup_automationTrading automationFREEwallet_address, automation_type, parameters

šŸ”„ Uniswap Integration Tools (PAID)

ToolDescriptionCostInput
get_swap_quoteReal-time swap quotes0.005 USDCwallet_address, token_in, token_out, amount_in
execute_swapExecute Uniswap swaps0.005 USDCwallet_address, token_in, token_out, amount_in
get_supported_tokensList supported tokensFREEchain (optional)

šŸ’³ Payment Tools

ToolDescriptionCostInput
create_paymentCreate micropaymentFreewallet_address, service
verify_paymentVerify payment statusFreepayment_id

🌐 Supported Chains

  • Ethereum (Chain ID: 1)
  • Optimism (Chain ID: 10)
  • Polygon (Chain ID: 137)
  • Arbitrum (Chain ID: 42161)
  • Base (Chain ID: 8453)

⚔ Quick Start

  1. Install dependencies:

    npm install
    
  2. Configure environment (.env):

    WALLET_PRIVATE_KEY=your_private_key
    INFURA_KEY=your_infura_key
    OPENAI_API_KEY=your_openai_key
    
  3. Start server:

    npm run dev
    

šŸ“ Usage Examples

Get Swap Quote (Paid)

{
  "name": "get_swap_quote",
  "arguments": {
    "wallet_address": "0x...",
    "token_in": "NATIVE",
    "token_out": "0xA0b86a33E6417c8C4e5F5B0b1e8C5C5F5E5D5C5B",
    "amount_in": "1.0",
    "chain": "ethereum"
  }
}

Response:

āœ… Uniswap Swap Quote (Payment Verified)

šŸ“Š Trade Details:
Input: 1.0 NATIVE
Output: 3000.50 USDC
Price: 1 NATIVE = 3000.50 USDC
Price Impact: 0.12%
Network: ETHEREUM (Chain ID: 1)

šŸ” Route Information:
Direct swap route

⛽ Gas Estimation:
Estimated Gas: 150,000 units

šŸ’° Minimum Received:
With 0.5% slippage: 2985.50 USDC

šŸš€ Ready to Execute?
Use execute_swap tool with same parameters to proceed.

Execute Swap (Paid - Fully Automated)

{
  "name": "execute_swap",
  "arguments": {
    "wallet_address": "0x...",
    "token_in": "NATIVE",
    "token_out": "0xA0b86a33E6417c8C4e5F5B0b1e8C5C5F5E5D5C5B",
    "amount_in": "1.0",
    "slippage": 0.5,
    "chain": "ethereum"
  }
}

Response:

šŸ” Starting Automated Swap Process
Network: ETHEREUM (Chain ID: 1)
Trade: 1.0 NATIVE → USDC
Slippage: 0.5%

šŸ” Step 1: Checking Balance & Allowance
āœ… Balance check passed
āœ… Expected output: 3000.50 USDC
āœ… Price impact: 0.12%

šŸ” Step 2: Executing Swap Transaction
ā³ Processing approval (if needed)...
ā³ Executing swap transaction...

āœ… Swap Completed Successfully!
Transaction Hash: 0x1234567890abcdef...
Amount In: 1.0 NATIVE
Amount Out: 3000.50 USDC
Gas Used: 147,832
Network: Ethereum

šŸ”— Transaction Links:
Explorer: https://etherscan.io/tx/0x1234...

šŸ’° Next Steps:
1. āœ… Transaction submitted to blockchain
2. ā³ Wait 2-5 minutes for confirmation
3. šŸ” Check explorer link for status
4. šŸ’± Tokens will appear in your wallet after confirmation

Portfolio Analysis (Free)

{
  "name": "analyze_portfolio",
  "arguments": {
    "wallet_address": "0x..."
  }
}

šŸ’” Key Features

šŸ¤– Fully Automated Execution

  • One-Click Swaps: Single command handles approval + swap
  • Real-time Balance Checks: Automatic validation before execution
  • Smart Error Handling: Detailed troubleshooting guidance
  • Transaction Tracking: Live status updates with explorer links

šŸ’° Smart Payment Model

  • Free Core Tools: Portfolio analysis, strategies, basic trading
  • Paid Premium Tools: Advanced Uniswap integration (0.005 USDC)
  • x402 Micropayments: Seamless USDC payments

🌐 Multi-Chain Excellence

  • 5 Major Networks: Ethereum, Optimism, Polygon, Arbitrum, Base
  • Smart Routing: Optimal price discovery across DEXs
  • Gas Optimization: Efficient transaction execution

šŸ“Š Advanced Analytics

  • AI Portfolio Insights: OpenAI-powered analysis
  • Price Impact Warnings: Smart slippage detection
  • Route Optimization: Best execution paths
  • Real-time Quotes: Live market data

šŸ”’ Security

  • Private keys di environment variables
  • Payment verification untuk setiap transaksi
  • Balance validation sebelum trade
  • Slippage protection
  • Comprehensive error handling

šŸ› ļø Development

aura-mcp/
ā”œā”€ā”€ lib/uniswap-integration.ts   # Uniswap integration
ā”œā”€ā”€ lib/x402-payment.js         # Payment system  
ā”œā”€ā”€ mcp-server.ts              # Main MCP server
└── pages/api/                 # API endpoints

šŸ“ž Support

Common Issues:

  • Check INFURA_KEY validity
  • Verify wallet balance
  • Ensure payment confirmation
  • Check slippage tolerance

Environment Setup:

  • Node.js 18+
  • Valid Ethereum wallet
  • Infura API access
  • USDC for payments

šŸ™ Acknowledgments

  • AdEx Network for the AURA API
  • OpenAI for GPT integration capabilities

šŸš€ Getting Started

Prerequisites

  • Node.js 16+
  • npm or yarn
  • MetaMask or compatible Web3 wallet

Installation

  1. Clone the repository:
git clone https://github.com/your-username/aura-mcp.git
cd aura-mcp
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory:
OPENAI_API_KEY=your_openai_api_key_here
NEXT_PUBLIC_AURA_API_URL=https://aura.adex.network/api
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

šŸ”§ API Endpoints

Portfolio Analysis

GET /api/asset?address={wallet_address}

Returns comprehensive portfolio analysis including:

  • Total portfolio value
  • Token holdings
  • Risk analysis
  • Diversification score

Strategy Recommendations

GET /api/strategies?address={wallet_address}

Provides AI-powered strategy recommendations with:

  • Risk-based categorization
  • Expected returns
  • Implementation steps
  • Platform suggestions

AI Chat Interface

POST /api/chat
{
  "address": "wallet_address",
  "message": "user_query"
}

Interactive AI assistant for portfolio and strategy discussions

Automated Trading

POST /api/trade
{
  "address": "wallet_address",
  "fromToken": "token_address",
  "toToken": "token_address",
  "amount": "amount",
  "automationRules": [
    {
      "type": "STOP_LOSS",
      "percentage": 5,
      "action": "SELL"
    }
  ]
}

šŸ’” Use Cases

  1. Portfolio Management

    • Track and analyze crypto holdings
    • Get diversification recommendations
    • Monitor risk exposure
  2. Automated Trading

    • Set up automated trading rules
    • Execute trades with AI assistance
    • Monitor and adjust strategies
  3. DeFi Strategy Optimization

    • Get yield farming suggestions
    • Analyze liquidity opportunities
    • Track and optimize gas costs
  4. Risk Management

    • Set up stop-loss orders
    • Monitor portfolio health
    • Get real-time risk alerts

šŸ” Security

  • All API endpoints are secured with proper authentication
  • Automated trading rules are validated and sanitized
  • Rate limiting implemented on all endpoints
  • No private keys are ever stored or required
  • All transactions require wallet signature

šŸ›  Tech Stack

  • Frontend: Next.js, React, TailwindCSS
  • Backend: Next.js API Routes
  • Blockchain: Wagmi, Ethers.js
  • AI: OpenAI GPT-3.5/4
  • Payments: x402 Protocol
  • Data: AURA API

šŸ“ˆ Performance

The MCP server is optimized for:

  • Low latency responses (<500ms)
  • High throughput capability
  • Efficient caching of portfolio data
  • Minimal gas costs for trades

šŸ¤ Contributing

  1. Fork the repository
  2. Create your feature branch:
    git checkout -b feature/amazing-feature
    
  3. Commit your changes:
    git commit -m 'Add amazing feature'
    
  4. Push to the branch:
    git push origin feature/amazing-feature
    
  5. Open a Pull Request

šŸ“ License

This project is licensed under the MIT License - see the file for details.

šŸ™ Acknowledgments

  • AdEx Network for the AURA API
  • OpenAI for GPT integration capabilities
  • x402 Protocol for micropayments infrastructure

šŸ“ž Support

For support and queries:


Built with ā¤ļø for the AdEx AURA API Hackathon