DeFi Trading Agentのロゴ

DeFi Trading Agent

コミュニティ
edkdev

DeFi Trading Agent MCP Server - Transform your AI into an autonomous crypto trading agent

公開者edkdev
リポジトリdefi-trading-mcp
言語JavaScript
フォーク
25
スター
54
利用可能なツール
32
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    DeFi Trading Agentは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 32個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには54件のスターと25件のフォークがあります。

DeFi Trading Agent MCP Server

Transform your AI assistant into an autonomous crypto trading agent with real-time market analysis, portfolio management, and seamless trade execution across 17+ blockchains.

🎯 Starting Prompt Examples

Simple Quote

Get me a quote for 0.1 eth to usdc on Base chain.

Quote and Swap

Get me a quote for 0.1 eth on ethereum chain and execute the swap.

Memecoin Opportunity Scanner

"Scan for newly launched memecoins on Base with >$100K liquidity, pick one or two tokens and analyze the best entry opportunities"

Advanced Analysis Process:

  1. Discovery Phase: Uses get_new_pools to find tokens launched in last 24h
  2. Volume Filtering: Identifies pools with >$100K liquidity and high trading activity
  3. Technical Analysis: Pulls OHLCV data to analyze price patterns and momentum
  4. Risk Assessment: Evaluates liquidity depth, holder concentration, and volatility
  5. Entry Strategy: Determines optimal entry price, position size, and risk management
  6. Execution: Places gasless swap with calculated slippage and stop-loss levels

Example AI Analysis:

"Found 3 promising new tokens:
🚀 $ROCKET (0x123...): 2M volume, bullish OHLCV pattern, 85% liquidity locked
📈 Entry: $0.0001 (current support level)
💰 Size: 2% portfolio allocation
🛡️ Stop: $0.000085 (-15%)
🎯 Target: $0.00015 (+50%)
Executing gasless swap now..."

Risk Management Agent

"Monitor my portfolio and alert me if any position drops more than 15%"

Agent Actions:

  1. Continuously monitors portfolio values
  2. Calculates position changes
  3. Provides alerts and recommendations
  4. Can execute protective trades

🚀 Quick Start

Installation

bash
npm install -g defi-trading-mcp

Create a New Wallet (Recommended)

bash
npx defi-trading-mcp@latest --create-wallet

This generates a new wallet with private key and address for secure trading.

💰 Need crypto? See our guide: How to Load Crypto into Your Wallet

⚙️ Configuration

Required Keys

  • USER_PRIVATE_KEY: Your private key (for signing transactions locally, stays local, never transmitted)
  • USER_ADDRESS: Your Ethereum wallet address
  • COINGECKO_API_KEY: CoinGecko API key for market data (How to get your CoinGecko API key)

Optional Configuration

  • ALCHEMY_API_KEY: Add an Alchemy API key to use your own RPCs, otherwise public rpcs will be used.

🔧 Premium RPC Integration

Your ALCHEMY_API_KEY automatically enables premium RPCs for:

  • 15 Major Chains: Base, Polygon, Arbitrum, Optimism, BSC, Avalanche, Worldchain, Berachain, Blast, Linea, Scroll, Mantle, Ink, MonadTestnet
  • Enhanced Performance: Lower latency, better uptime
  • Automatic Fallback: Public RPCs for other chains

🔒 Security

  • Private keys remain on your device
  • No sensitive data transmitted to external servers
  • Secure transaction signing locally

MEV Protection

  • Ethereum transactions are protected from MEV attacks, sandwich attacks, and front-running
  • Private mempool routing ensures your trades aren't visible to MEV bots
  • Fair pricing without manipulation from malicious actors
  • Automatic protection - no additional configuration required

🔧 MCP Client Setup

Kiro IDE

Step 1: Install the MCP

bash
npm install -g defi-trading-mcp

Add to ~/.kiro/settings/mcp.json:

json
{
  "mcpServers": {
    "defi-trading": {
      "command": "npx",
      "args": ["defi-trading-mcp@latest"],
      "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"
      }
    }
  }
}

Claude Code

Add the MCP to Claude Code using the command line:

Step 1: Install the MCP

bash
npm install -g defi-trading-mcp

Step 2: Add to Claude Code - Replace the placeholders with your environment variables

For macOS/Linux/WSL:

bash
claude mcp add defi-trading \
  -e USER_PRIVATE_KEY=your_private_key_here \
  -e USER_ADDRESS=0xYourWalletAddress \
  -e COINGECKO_API_KEY=CG-your_coingecko_api_key \
  -e ALCHEMY_API_KEY=your_alchemy_api_key \
  -- npx defi-trading-mcp@latest

For Windows (native, not WSL):

bash
claude mcp add defi-trading \
  -e USER_PRIVATE_KEY=your_private_key_here \
  -e USER_ADDRESS=0xYourWalletAddress \
  -e COINGECKO_API_KEY=CG-your_coingecko_api_key \
  -e ALCHEMY_API_KEY=your_alchemy_api_key \
  -- cmd /c npx defi-trading-mcp@latest

Windows Note: The cmd /c wrapper is required on native Windows to prevent "Connection closed" errors when using npx.

Step 3: Verify the MCP is added

bash
claude mcp list

Step 4: Update wallet details (if needed) If you need to update your private key or wallet address after initial setup:

bash
# Remove existing configuration
claude mcp remove defi-trading

# Add back with updated wallet details
claude mcp add defi-trading \
  -e USER_PRIVATE_KEY=your_new_private_key \
  -e USER_ADDRESS=0xYourNewWalletAddress \
  -e COINGECKO_API_KEY=CG-your_coingecko_api_key \
  -e ALCHEMY_API_KEY=your_alchemy_api_key \
  -- npx defi-trading-mcp@latest

Step 5: Start using the trading agent Open Claude Code and start trading. Example Prompt:

"Check my portfolio across all chains and find trending memecoins on Base"

Claude Desktop

Step 1: Install the MCP

bash
npm install -g defi-trading-mcp

Open Claude Desktop. Click the top left menu with the three dashes. Click Developer. Then click Open App Config File. Your config file will open. Then add the following.

json
{
  "mcpServers": {
    "defi-trading": {
      "command": "npx",
      "args": ["defi-trading-mcp@latest"],
      "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"
      }
    }
  }
}

Cursor

Quick Setup (2 Steps)

Step 1: Install the package

bash
npm install -g defi-trading-mcp

Step 2: Add to Cursor (One-Click)

Click the button below to automatically configure the MCP in Cursor:

Add DeFi Trading MCP to Cursor

Important: The deeplink only configures Cursor - you must install the npm package first!

Manual Setup

Step 1: Install the MCP

bash
npm install -g defi-trading-mcp

Step 2: Add to Cursor Configuration

  1. Open Cursor
  2. Go to Settings → Extensions → MCP Servers
  3. Add a new server with the following configuration:
json
{
  "defi-trading": {
    "command": "npx",
    "args": ["defi-trading-mcp@latest"],
    "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"
    }
  }
}

Step 3: Configure Environment Variables

Replace the placeholder values with your actual credentials:

  • USER_PRIVATE_KEY: Your wallet's private key
  • USER_ADDRESS: Your wallet address
  • COINGECKO_API_KEY: Your CoinGecko API key (Get one here)
  • ALCHEMY_API_KEY: Your Alchemy API key (optional)

Step 4: Start Trading

Open Cursor and start using the DeFi Trading Agent:

"Get me a quote for 0.1 ETH to USDC on Base chain"

Other MCP Clients

For other MCP clients like Github Copilot(mcp.json), Gemini Cli (settings.json), find equivalent file and use the same pattern with environment variables:

json
{
  "mcpServers": {
    "defi-trading": {
      "command": "npx",
      "args": ["defi-trading-mcp@latest"],
      "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"
      }
    }
  }
}

🤖 Trading Agent Capabilities

Autonomous Portfolio Management

Intelligent Market Analysis

Advanced Trade Execution

Risk Management & Security

🛠️ Trading Agent Tools

Portfolio Management

  • get_portfolio_tokens - Multi-chain portfolio analysis with prices and metadata
  • get_portfolio_balances - Fast balance checking across all chains
  • get_portfolio_transactions - Complete transaction history analysis

Market Intelligence & Analysis

  • get_trending_pools - Identify hot trading opportunities with volume metrics
  • get_new_pools - Discover newly launched tokens and liquidity pools
  • get_pool_ohlcv - Technical analysis with OHLCV candlestick data
  • get_pool_trades - Analyze recent trading activity and whale movements
  • get_token_price - Real-time pricing with 24h change indicators
  • get_token_data - Deep token research with metadata and social links
  • get_token_info - Comprehensive token analysis including descriptions
  • search_pools - Find specific pools by token symbol or contract address

Smart Trading

  • get_swap_price - Get best prices across all DEXes
  • get_swap_quote - Get executable quotes with transaction data
  • execute_swap - Execute trades with optimal routing
  • get_supported_chains - List all 17+ supported blockchains

Gasless Trading

  • get_gasless_price - Get prices for gas-free trades
  • get_gasless_quote - Get gasless swap quotes
  • submit_gasless_swap - Execute trades without holding ETH
  • get_gasless_status - Monitor gasless transaction status

Utility Tools

  • convert_wei_to_formatted - Convert blockchain units to human-readable
  • convert_formatted_to_wei - Convert amounts to blockchain format

Plus 25+ additional tools for comprehensive DeFi trading and analysis.

🌐 Supported Networks

17+ Blockchain Networks:

  • Ethereum - The original DeFi ecosystem
  • Base - Coinbase's L2 with low fees
  • Polygon - Fast and cheap transactions
  • Arbitrum - Leading Ethereum L2
  • Optimism - Optimistic rollup scaling
  • BSC - Binance Smart Chain
  • Avalanche - Fast. Scalable. Customizable
  • Blast - Native yield for ETH and stablecoins
  • Linea - ConsenSys zkEVM
  • Scroll - zkRollup technology
  • Mantle - Modular blockchain network
  • Mode - DeFi-focused L2
  • Worldchain - World ID integration
  • Unichain - Uniswap's dedicated chain
  • Berachain - Proof-of-liquidity consensus
  • Ink - Kraken's L2 solution
  • MonadTestnet - Next-gen parallel EVM

Use get_supported_chains for the complete current list.

🔐 Security & Trust

Local Key Management

  • Private keys never leave your device
  • All transaction signing happens locally
  • No sensitive data transmitted to servers

💡 Agent Use Cases

DeFi Portfolio Manager

"Analyze my DeFi portfolio and suggest optimizations"
  • Tracks performance across all chains
  • Identifies underperforming assets
  • Suggests rebalancing strategies
  • Executes optimization trades

Technical Analysis Expert

"Analyze the OHLCV data for trending tokens and identify the best entry points"

Advanced Technical Analysis:

  • Pattern Recognition: Identifies bullish/bearish patterns in OHLCV data
  • Support/Resistance: Calculates key price levels using historical data
  • Volume Analysis: Analyzes trading volume for momentum confirmation
  • Entry Timing: Determines optimal entry points based on technical indicators
  • Risk Management: Sets stop-loss and take-profit levels automatically
  • Position Sizing: Calculates optimal allocation based on volatility and risk tolerance

Example Technical Analysis:

"$TOKEN shows strong bullish momentum:
📊 OHLCV Analysis: Higher lows pattern, volume increasing 300%
📈 Support Level: $0.00085 (tested 3x, held strong)
📉 Resistance: $0.0012 (previous high, light volume)
💡 Strategy: Enter at $0.00095, Stop at $0.00082, Target $0.0015
⚖️ Risk/Reward: 1:4 ratio, recommended 1.5% portfolio allocation"

Arbitrage Hunter

"Look for arbitrage opportunities between chains"
  • Compares prices across networks
  • Identifies profitable spreads
  • Calculates gas costs and slippage
  • Executes profitable arbitrage

Risk Monitor

"Alert me if any of my positions drop more than 10%"
  • Continuous portfolio monitoring
  • Real-time price alerts
  • Automatic stop-loss execution
  • Risk assessment reports

Advanced Market Analysis Agent

"Analyze newly launched memecoins on Base with high volume and determine entry strategy"

Comprehensive Analysis:

  • Trend Detection: Identifies trending pools with unusual volume spikes
  • Technical Analysis: Uses OHLCV data to analyze price patterns and momentum
  • Liquidity Assessment: Evaluates pool depth and trading sustainability
  • Risk Scoring: Calculates risk metrics based on volatility and liquidity
  • Entry Optimization: Determines optimal entry points using technical indicators
  • Position Sizing: Recommends allocation based on portfolio risk management

Example Analysis Flow:

  1. Discovery: "Find new tokens with >1000% volume increase in last 24h"
  2. Research: Pulls token metadata, social links, and trading history
  3. Technical Analysis: Analyzes OHLCV patterns for support/resistance levels
  4. Risk Assessment: Evaluates liquidity, holder distribution, and volatility
  5. Strategy: "Enter 2% of portfolio at $0.0001 with stop-loss at $0.00008"
  6. Execution: Places gasless swap with optimal slippage settings

🚀 Why Choose DeFi Trading Agent MCP?

For Traders

  • AI-Powered Analysis: Advanced market intelligence with OHLCV technical analysis
  • Memecoin Discovery: Automated scanning for newly launched high-potential tokens
  • Smart Entry Timing: AI determines optimal entry points using multiple indicators
  • Risk-Managed Trading: Automated position sizing and stop-loss calculations
  • Multi-chain Efficiency: Trade across 17+ networks seamlessly
  • Gas Optimization: Gasless trades save on transaction costs
  • Professional Grade: Built for high-volume trading

💬 Community & Support

Join Our Community

Need Help?

  • 💬 Quick questions: Join our Telegram group for real-time support
  • 🐛 Bug reports: Create an issue on GitHub
  • 💡 Feature requests: Share your ideas in GitHub Discussions
  • 📚 Documentation: Check our guides for CoinGecko API and Loading Crypto

Transform your AI into an autonomous crypto trading agent today.

インストール

TypingMind
前提条件:

Node.js 18+

{
  "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"
      }
    }
  }
}

利用可能なツール

  • get_swap_price

    Get indicative price for a token swap using Aggregator Protocol

  • get_swap_quote

    Get executable quote with transaction data for a token swap

  • execute_swap

    Execute a swap transaction (requires quote data)

  • get_supported_chains

    Get list of blockchain networks supported by Aggregator Protocol

  • get_liquidity_sources

    Get list of liquidity sources available on a specific chain

  • get_token_price

    Get token prices by contract addresses using CoinGecko API

  • get_coingecko_networks

    Get list of supported networks on CoinGecko/GeckoTerminal

  • get_supported_dexes

    Get list of supported DEXes on a specific network

  • get_trending_pools

    Get trending pools across all networks on GeckoTerminal

  • get_trending_pools_by_network

    Get trending pools on a specific network

  • get_multiple_pools_data

    Get data for multiple pools by their contract addresses

  • get_top_pools_by_dex

    Get top pools on a specific DEX

  • get_new_pools

    Get latest new pools across all networks

  • search_pools

    Search for pools by query (pool address, token address, or token symbol)

  • get_top_pools_by_token

    Get top pools for a specific token by contract address

  • get_token_data

    Get specific token data by contract address

  • get_multiple_tokens_data

    Get data for multiple tokens by their contract addresses

  • get_token_info

    Get detailed token information including socials, websites, and description

  • get_recently_updated_tokens

    Get recently updated tokens with their information

  • get_pool_ohlcv

    Get OHLCV (Open, High, Low, Close, Volume) data for a pool

  • get_pool_trades

    Get recent trades for a specific pool

  • get_gasless_price

    Get indicative price for a gasless token swap (no gas fees required)

  • get_gasless_quote

    Get executable quote for a gasless token swap with EIP-712 signature data

  • submit_gasless_swap

    Submit a gasless swap by signing approval and trade messages (no gas fees required)

  • get_gasless_status

    Get the status of a submitted gasless swap

  • get_gasless_chains

    Get list of blockchain networks that support gasless swaps

  • get_gasless_approval_tokens

    Get list of tokens that support gasless approvals (EIP-2612 permit)

  • get_portfolio_tokens

    Get tokens with balances, prices, and metadata for wallet addresses (uses USER_ADDRESS from env if addresses not provided)

  • get_portfolio_balances

    Get token balances for wallet addresses (faster, no prices/metadata, uses USER_ADDRESS from env if addresses not provided)

  • get_portfolio_transactions

    Get transaction history for a wallet address (BETA: 1 address, ETH/BASE only, uses USER_ADDRESS from env if addresses not provided)

  • convert_wei_to_formatted

    Convert wei amounts to human-readable format using ethers.js

  • convert_formatted_to_wei

    Convert formatted amounts to wei using ethers.js

DeFi Trading AgentのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度DeFi Trading Agentに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

DeFi Trading Agentをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. DeFi Trading AgentのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "defi-trading-agent": {
      "command": "npx",
      "args": [
        "-y",
        "defi-trading-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてDeFi Trading AgentのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. DeFi Trading AgentのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
DeFi Trading Agentを使ってこのタスクを手伝ってもらえますか?
DeFi Trading Agent
はい、読みました。
DeFi Trading Agentで調べた結果をお伝えします。

よくある質問

DeFi Trading Agent MCPサーバーは何に使いますか?

DeFi Trading Agentは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでDeFi Trading Agent MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでDeFi Trading Agentを利用できます。

TypingMindでDeFi Trading Agent MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。DeFi Trading Agentを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

DeFi Trading Agent MCPをTypingMindに接続するにはどうすればよいですか?

DeFi Trading AgentはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでDeFi Trading Agent MCPのどのようなツールを利用できますか?

DeFi Trading Agentは32個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

DeFi Trading Agent MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。DeFi Trading Agentで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇