npm package: @nocktopus/mcp-server
Description: MCP server for Nocktopus DeFi platform on Nockchain — 33 tools for AI agent trading, lending, vaults, insurance, oracles, bridging, governance, and portfolio management
Author: Nocktopus
Latest version: 1.0.1

# @nocktopus/mcp-server

MCP server for the [Nocktopus](https://nocktopus.com) AI-Agent DeFi platform on Nockchain. Exposes 33 tools covering DEX trading, lending, yield vaults, insurance, oracles, cross-chain bridging, governance, and portfolio management.

## Installation

```bash
npm install -g @nocktopus/mcp-server
```

Or run directly:

```bash
npx @nocktopus/mcp-server
```

## Configuration

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "nocktopus": {
      "command": "npx",
      "args": ["@nocktopus/mcp-server"],
      "env": {
        "NOCKTOPUS_GRPC": "localhost:6555"
      }
    }
  }
}
```

### Claude Code

Add to `.claude/settings.json`:

```json
{
  "mcpServers": {
    "nocktopus": {
      "command": "npx",
      "args": ["@nocktopus/mcp-server"],
      "env": {
        "NOCKTOPUS_GRPC": "localhost:6555"
      }
    }
  }
}
```

## Prerequisites

Nocktopus gRPC server must be running:

```bash
cargo run --bin nocktopus
# or with nockchain node:
NOCKTOPUS_NODE_ENDPOINT=http://127.0.0.1:50555 cargo run --bin nocktopus
```

Dashboard and discovery endpoints at `http://localhost:8080`.

## Tools (33)

### NockNet — Agent Identity (4 tools)
| Tool | Description |
|------|-------------|
| `nocknet_register_agent` | Register a new AI agent with stake deposit |
| `nocknet_get_agent` | Get agent info by ID |
| `nocknet_get_reputation` | Get agent reputation and action history |
| `nocknet_list_agents` | List registered agents by tier |

### Nocktane — DEX (5 tools)
| Tool | Description |
|------|-------------|
| `nocktane_swap` | Execute a token swap with slippage protection |
| `nocktane_get_quote` | Get swap price quote without executing |
| `nocktane_create_pool` | Create a new AMM liquidity pool |
| `nocktane_get_pool` | Get pool reserves, fees, and volume |
| `nocktane_list_pools` | List all liquidity pools |

### NockLend — Lending (5 tools)
| Tool | Description |
|------|-------------|
| `nocklend_supply` | Supply assets to earn interest |
| `nocklend_borrow` | Borrow against collateral |
| `nocklend_get_market` | Get market rates and utilization |
| `nocklend_get_health` | Get borrow position health factor |
| `nocklend_list_markets` | List all lending markets |

### FortNocks — Yield Vaults (3 tools)
| Tool | Description |
|------|-------------|
| `fortnocks_deposit` | Deposit into auto-compounding vault |
| `fortnocks_get_vault` | Get vault info and share price |
| `fortnocks_list_vaults` | List all yield vaults |

### NockShield — Insurance (2 tools)
| Tool | Description |
|------|-------------|
| `nockshield_buy_coverage` | Purchase insurance coverage |
| `nockshield_pool_status` | Get insurance pool status |

### NockOracle — Price Feeds (3 tools)
| Tool | Description |
|------|-------------|
| `nockoracle_get_price` | Get stake-weighted median price |
| `nockoracle_submit_price` | Submit price observation |
| `nockoracle_list_pairs` | List supported trading pairs |

### NockBridge — Cross-Chain (2 tools)
| Tool | Description |
|------|-------------|
| `nockbridge_deposit` | Bridge NOCK to another chain |
| `nockbridge_status` | Get bridge transfer status |

### NockRouter — Strategy (2 tools)
| Tool | Description |
|------|-------------|
| `nockrouter_execute` | Execute multi-step DeFi strategy |
| `nockrouter_estimate` | Estimate strategy returns |

### Nocktagon — Governance (4 tools)
| Tool | Description |
|------|-------------|
| `nocktagon_create_proposal` | Create governance proposal |
| `nocktagon_vote` | Vote on proposal (stake-weighted) |
| `nocktagon_get_proposal` | Get proposal details |
| `nocktagon_list_proposals` | List proposals by status |

### Portfolio (2 tools)
| Tool | Description |
|------|-------------|
| `portfolio_get` | Cross-service portfolio view |
| `portfolio_history` | Transaction history across services |

### Platform (1 tool)
| Tool | Description |
|------|-------------|
| `nocktopus_stats` | Aggregate platform statistics |

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `NOCKTOPUS_GRPC` | `localhost:6555` | Nocktopus gRPC server endpoint |

## Architecture

```
AI Agent ──► MCP Server ──► gRPC ──► Nocktopus ──► Nockchain
              (stdio)       :6555      :8080
```

The MCP server translates MCP tool calls into gRPC requests to the Nocktopus API server. All 10 gRPC services are wrapped as typed MCP tools with Zod schema validation.

## License

MIT