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-code2. 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.00MCP Tools
The @liquidityio/mcp server exposes 8 tools:
| Tool | Description |
|---|---|
get_quote | Real-time bid/ask/last for any symbol |
get_orderbook | Full depth-of-book (L2 data) |
place_order | Submit market, limit, stop orders |
cancel_order | Cancel open orders |
get_portfolio | Account balances and positions |
get_open_orders | List all open orders |
get_trades | Trade history with P&L |
get_markets | Available instruments and trading pairs |
Trading Skills
Pre-built slash commands for Claude Code:
| Skill | Command | Description |
|---|---|---|
| Market Analysis | /analyze AAPL | Technical + fundamental analysis |
| Portfolio Rebalance | /rebalance | Suggest and execute rebalancing |
| Risk Assessment | /risk | Portfolio risk metrics (VaR, Sharpe, etc.) |
| Order Preview | /preview buy 100 AAPL | Simulate order before execution |
| Trade History | /history | P&L report with breakdown |
Install Skills
# Symlink into Claude Code
ln -s skills/discover-liquidity \
~/.claude/skills/discover-liquidityRisk Controls
All AI trading is subject to server-side risk limits:
| Control | Default | Configurable |
|---|---|---|
| Max order size (USD) | $100,000 | Yes |
| Max daily loss (USD) | $10,000 | Yes |
| Max position size (USD) | $500,000 | Yes |
| Require confirmation | Yes (orders > $10K) | Yes |
| Withdrawals | Blocked | N/A |
| Account modifications | Blocked | N/A |
Kill Switch
Revoke the API key to immediately:
- Cancel all open orders
- Block new order submission
- Preserve existing positions
Compatible AI Clients
Any MCP-compatible client works with the Liquidity.io MCP server:
| Client | Status | Notes |
|---|---|---|
| Claude Code | Full support | Native MCP integration |
| Claude Desktop | Full support | Via MCP server config |
| Cursor | Full support | MCP server in settings |
| Windsurf | Full support | MCP server in settings |
| Custom MCP client | Full support | Any 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.