Skip to main content
Glama
README.md
# 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

```bash
npm install -g nerve-mcp
```

Or run directly with npx:

```bash
npx nerve-mcp
```

## Configuration

Set your NERVE API key as an environment variable:

```bash
export NERVE_API_KEY=nrv_sk_your_key_here
```

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

```bash
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):

```json
{
  "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:

```json
{
  "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

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

Test locally with the MCP inspector:

```bash
npx @modelcontextprotocol/inspector node dist/index.js
```

## License

MIT

---

Built by [LXGIC Studios](https://github.com/LXGIC-Studios)

[GitHub](https://github.com/LXGIC-Studios) · [Twitter](https://x.com/lxgicstudios)

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

TDQS

A3.5/5.0

Scored across 10 tools

Disambiguation4/5

Most tools target a clearly distinct resource+action (place_order vs close_position vs get_positions vs get_account). There is mild overlap between get_markets, get_market_detail, and get_orderbook since the detail tool already includes an orderbook summary and 24h stats, but descriptions give enough cues to separate list/detail/book use cases.

Naming Consistency5/5

Every tool follows the same snake_case verb_noun convention (place_order, get_positions, get_market_detail, close_position, get_ai_score). get_ai_score/get_ai_profile are a consistent sub-family and remain clearly readable.

Tool Count5/5

Ten tools is a well-scoped surface for a trading client: ordering, positions, market data, account, and AI signals. Each tool covers a distinct capability without filler.

Completeness3/5

Core read paths and order entry/exit are covered, but place_order supports limit orders with no cancel_order or list_open_orders tool, and there is no order/trade history or leverage/margin adjustment. Agents can trade but cannot manage resting orders, which is a notable lifecycle gap.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues