Liquidity Docs

AI Trading — Claude Code & MCP

Trade with AI agents via Claude Code, MCP tools, and pre-built trading skills

Liquidity.io provides native integration with Claude Code and any MCP-compatible AI client for agentic trading. No custom framework required — use Anthropic's standard tooling.

Quick Start

1. Install Claude Code

npm install -g @anthropic-ai/claude-code

2. Configure MCP Connection

Create .mcp.json in your project:

{
  "mcpServers": {
    "liquidity": {
      "command": "npx",
      "args": ["@liquidityio/mcp"],
      "env": {
        "LIQUIDITY_API_KEY": "your-api-key",
        "LIQUIDITY_API_SECRET": "your-api-secret",
        "LIQUIDITY_API_URL": "https://api.liquidity.io/v1"
      }
    }
  }
}

3. Trade with Natural Language

> What's the current price of AAPL?
[Calling get_quote: symbol=AAPL]
AAPL is trading at $185.42 (bid: $185.40, ask: $185.44)

> Buy 100 shares at market
[Calling place_order: symbol=AAPL, side=buy, type=market, quantity=100]
Order filled: 100 AAPL @ $185.43 avg

> Show my portfolio
[Calling get_portfolio]
AAPL: 100 shares @ $185.43 ($18,543.00)
Cash: $81,457.00

MCP Tools

The @liquidityio/mcp server exposes 8 tools:

ToolDescription
get_quoteReal-time bid/ask/last for any symbol
get_orderbookFull depth-of-book (L2 data)
place_orderSubmit market, limit, stop orders
cancel_orderCancel open orders
get_portfolioAccount balances and positions
get_open_ordersList all open orders
get_tradesTrade history with P&L
get_marketsAvailable instruments and trading pairs

Trading Skills

Pre-built slash commands for Claude Code:

SkillCommandDescription
Market Analysis/analyze AAPLTechnical + fundamental analysis
Portfolio Rebalance/rebalanceSuggest and execute rebalancing
Risk Assessment/riskPortfolio risk metrics (VaR, Sharpe, etc.)
Order Preview/preview buy 100 AAPLSimulate order before execution
Trade History/historyP&L report with breakdown

Install Skills

# Symlink into Claude Code
ln -s skills/discover-liquidity \
      ~/.claude/skills/discover-liquidity

Risk Controls

All AI trading is subject to server-side risk limits:

ControlDefaultConfigurable
Max order size (USD)$100,000Yes
Max daily loss (USD)$10,000Yes
Max position size (USD)$500,000Yes
Require confirmationYes (orders > $10K)Yes
WithdrawalsBlockedN/A
Account modificationsBlockedN/A

Kill Switch

Revoke the API key to immediately:

  1. Cancel all open orders
  2. Block new order submission
  3. Preserve existing positions

Compatible AI Clients

Any MCP-compatible client works with the Liquidity.io MCP server:

ClientStatusNotes
Claude CodeFull supportNative MCP integration
Claude DesktopFull supportVia MCP server config
CursorFull supportMCP server in settings
WindsurfFull supportMCP server in settings
Custom MCP clientFull supportAny client implementing MCP spec

Institutional Patterns

Supervised Trading

{
  "riskLimits": {
    "maxOrderSizeUSD": 1000000,
    "requireConfirmation": true,
    "confirmationThresholdUSD": 50000,
    "allowedSymbols": ["BTC-USD", "ETH-USD", "AAPL", "TSLA"],
    "allowedOrderTypes": ["limit", "market"]
  }
}

Audit Trail

Every MCP tool call is logged with:

  • Timestamp, tool name, parameters
  • User identity (API key)
  • Order ID (if applicable)
  • Confirmation status (approved/rejected)

Multi-Agent Coordination

Run multiple Claude Code instances with different strategies:

# Terminal 1: Market maker
claude "Run a market making strategy on BTC-USD with 10bp spread"

# Terminal 2: Risk monitor
claude "Monitor my portfolio and alert if daily loss exceeds $5000"

# Terminal 3: Rebalancer
claude "Rebalance to 60/40 BTC/ETH every hour"

Each instance uses the same MCP server but with independent API keys and risk limits.

On this page