npm package: @liqi-da/caas-mcp-server
Description: MCP server for the Liqi CaaS API — exposes all endpoints as AI-callable tools
Author: Liqi Digital Assets
Latest version: 0.1.0

# @liqi-da/caas-mcp-server

MCP (Model Context Protocol) server for the Liqi CaaS API. Allows AI assistants like Claude to interact with all CaaS API endpoints via natural language.

## Quick Start

### Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "caas-api": {
      "command": "npx",
      "args": ["@liqi-da/caas-mcp-server"],
      "env": {
        "CAAS_API_URL": "https://api-caas-it-sandbox.liqi.app.br",
        "CAAS_JWT_SUB": "your-api-key-id",
        "CAAS_JWT_PRIVATE_KEY": "your-private-key-without-begin-end-headers"
      }
    }
  }
}
```

### Claude Code

```bash
claude mcp add caas-api -- npx @liqi-da/caas-mcp-server
```

Set the environment variables in your shell before running Claude Code.

## Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `CAAS_API_URL` | API base URL (defaults to sandbox) | No |
| `CAAS_JWT_SUB` | API key ID from the Liqi portal | Yes |
| `CAAS_JWT_PRIVATE_KEY` | RSA private key (no BEGIN/END headers, no line breaks) | Yes |

## Available Tools

### Authentication
- `auth_signin` — Authenticate and get operational token (called automatically)

### Client (Account)
- `account_createProfile` — Create a new client profile
- `account_fetchProfile` — Get client details
- `account_fetchProfiles` — List all clients (paginated)
- `account_enableDisableProfile` — Toggle buy/sell permissions

### Wallet
- `wallet_fetchBalance` — Get client balances
- `wallet_fetchBalances` — List balances for multiple clients
- `wallet_fetchStatement` — Get transaction history
- `wallet_fetchStatementCategory` — List statement categories

### Markets
- `market_fetchExchanges` — List available exchanges/pools
- `market_fetchMarkets` — List trading pairs
- `market_fetchTicker` — Get ticker for specific pair
- `market_fetchTickers` — List all tickers
- `market_fetchHistoricalPrices` — Get historical prices

### Orders
- `orders_createOrder` — Create buy/sell order
- `orders_fetchOrder` — Get order details
- `orders_fetchOrders` — List orders

### Orders RFQ
- `orders_rfq_createQuote` — Create price-locked quote
- `orders_rfq_fetchQuote` — Get quote details
- `orders_rfq_createOrder` — Execute order at quoted price

### Transactions
- `transactions_createTransfer` — Transfer between profiles
- `transactions_fetchTransfer` — Get transfer details
- `transactions_fetchTransfers` — List transfers
- `transactions_createBalance` — Create balance transaction
- `transactions_fetchBalance` — Get balance transaction details
- `transactions_fetchBalances` — List balance transactions
- `transactions_createDeposit` — Create deposit request
- `transactions_fetchDeposit` — Get deposit status

### Analytics
- `analytics_poolsBalances` — Get pool balances

## Development

```bash
npm install
npm run build
npm start
```

## Publishing

Publishing is automated via GitHub Actions. To release a new version:

1. Update version in `package.json`
2. Create a GitHub release with the matching tag (e.g., `v0.1.0`)
3. The CI will build and publish to npm automatically

Requires `NPM_TOKEN` secret configured in the GitHub repo settings.