AI交易API服务

为AI助手提供NERVE DEX的交易API服务,包括市场浏览、订单交易、持仓监控及AI交易评分等功能。

  • by LXGIC-Studios
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 LXGIC-Studios/nerve-mcp

使用说明

nerve-mcp

MCP server for NERVE — the AI-powered perpetual DEX. Trade any market with AI conviction scoring, directly from Claude, GPT, Cursor, or any MCP-compatible agent.

What it does

Exposes NERVE's trading API as MCP tools so AI assistants can:

  • Browse markets and orderbooks
  • Place trades (market and limit orders) with leverage
  • Monitor positions and account balance
  • Get AI conviction scores before trading
  • Pull OHLCV candle data for analysis
  • View your AI behavioral trading profile

Install

npm install -g nerve-mcp

Or run directly with npx:

npx nerve-mcp

Configuration

Set your NERVE API key as an environment variable:

export NERVE_API_KEY=nrv_sk_your_key_here

Optional: override the API URL (defaults to https://nerve-opal.vercel.app):

export NERVE_API_URL=https://your-nerve-instance.com

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "nerve": {
      "command": "npx",
      "args": ["-y", "nerve-mcp"],
      "env": {
        "NERVE_API_KEY": "nrv_sk_your_key_here"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "nerve": {
      "command": "npx",
      "args": ["-y", "nerve-mcp"],
      "env": {
        "NERVE_API_KEY": "nrv_sk_your_key_here"
      }
    }
  }
}

Available Tools

Tool Description
get_markets List all trading pairs with prices, 24h change, volume
get_market_detail Detailed info for one market (funding rate, OI, stats)
get_orderbook Order book with bids, asks, and spread
place_order Place a market or limit order with leverage
get_positions View all open positions with PnL
close_position Close a position by symbol
get_account Account equity, margin, and unrealized PnL
get_ai_score AI conviction score for a potential trade (0-100)
get_ai_profile Your AI behavioral trading profile and insights
get_candles OHLCV candlestick data for technical analysis

Examples

Once configured, you can ask your AI assistant things like:

  • "What markets are available on NERVE?"
  • "Show me the BTC-PERP orderbook"
  • "What's the AI conviction score for longing ETH at 5x leverage?"
  • "Place a market buy for 0.1 BTC-PERP at 10x leverage"
  • "What are my open positions?"
  • "Show me my trading profile"

Development

git clone https://github.com/LXGIC-Studios/nerve-mcp.git
cd nerve-mcp
npm install
npm run build

Test locally with the MCP inspector:

npx @modelcontextprotocol/inspector node dist/index.js

License

MIT


Built by LXGIC Studios

GitHub · Twitter

Want more free tools like this? We have 100+ on our GitHub: github.com/lxgicstudios