envexx/aura-mcp-chatgpt
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)
Tool | Description | Cost | Input |
---|---|---|---|
analyze_portfolio | AI portfolio analysis | FREE | wallet_address |
get_strategies | Investment strategies | FREE | wallet_address, risk_tolerance |
execute_trade | Execute trades | FREE | wallet_address, from_token, to_token, amount |
setup_automation | Trading automation | FREE | wallet_address, automation_type, parameters |
š Uniswap Integration Tools (PAID)
Tool | Description | Cost | Input |
---|---|---|---|
get_swap_quote | Real-time swap quotes | 0.005 USDC | wallet_address, token_in, token_out, amount_in |
execute_swap | Execute Uniswap swaps | 0.005 USDC | wallet_address, token_in, token_out, amount_in |
get_supported_tokens | List supported tokens | FREE | chain (optional) |
š³ Payment Tools
Tool | Description | Cost | Input |
---|---|---|---|
create_payment | Create micropayment | Free | wallet_address, service |
verify_payment | Verify payment status | Free | payment_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
-
Install dependencies:
npm install
-
Configure environment (
.env
):WALLET_PRIVATE_KEY=your_private_key INFURA_KEY=your_infura_key OPENAI_API_KEY=your_openai_key
-
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
- Clone the repository:
git clone https://github.com/your-username/aura-mcp.git
cd aura-mcp
- Install dependencies:
npm install
- 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
- Run the development server:
npm run dev
- 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
-
Portfolio Management
- Track and analyze crypto holdings
- Get diversification recommendations
- Monitor risk exposure
-
Automated Trading
- Set up automated trading rules
- Execute trades with AI assistance
- Monitor and adjust strategies
-
DeFi Strategy Optimization
- Get yield farming suggestions
- Analyze liquidity opportunities
- Track and optimize gas costs
-
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
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- 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:
- Join our Telegram Group
- Create an issue in this repository
- Email: support@aura-mcp.com
Built with ā¤ļø for the AdEx AURA API Hackathon