Skip to main content
Glama

strike-mcp

Trade Strike Finance perps by talking to your AI.

MCP server Node.js 20+ License: MIT Strike Hackathon

Tools · Safety model · Setup · Configuration

strike-mcp is a Model Context Protocol server that gives Claude (and any MCP-capable agent: Claude Code, Codex, Cursor…) live access to Strike Finance: markets, funding, order books, your positions and their liquidation risk, and, when you opt in, order placement behind a preview-and-confirm guardrail.

Ask things like:

  • "How are my Strike positions doing?"

  • "Which markets have the most extreme funding right now?"

  • "How much slippage would a $5k ADA market buy take?"

  • "Long 500 ADA at 0.21 with a stop at 0.19 and take-profit at 0.25."

Why

Strike already ships skills that help coding assistants write Strike integrations. strike-mcp is the runtime piece: it lets an agent use Strike directly. Every Strike user gets an analyst and a careful trading assistant without writing code, and every agent framework that speaks MCP becomes a new entry point to Strike's order book.

Three design choices make it more than an API wrapper:

  1. Answers, not payloads. Tools return what a trader asks about: spread in bps, USD depth within 0.5/1/2% of mid, book imbalance, funding as APR with who pays whom, distance to liquidation with an ok/watch/danger flag, what each position pays or earns in funding per day, estimated market-order fills.

  2. Read-only by default, no keys required. Point it at any Cardano/Ethereum/Solana wallet address and it reads that account's positions and history from Strike's public endpoints. Trading tools don't even exist unless you enable them.

  3. Guardrails an agent can't skip. Orders are two-step. strike_preview_order validates and prices the order and returns a single-use, short-lived preview_id; strike_place_order accepts only that id, so what the user confirmed is exactly what is sent. See Safety model.

Related MCP server: hyperliquid-mcp

Tools

Market data (public, no keys)

Tool

What it answers

strike_list_markets

All markets ranked by volume, 24h move, open interest or funding. Filter by category (Crypto, TradFi…).

strike_market_snapshot

One-call brief: price, range, volume, OI, funding (hourly/8h/APR, who pays), mark-vs-index premium, spread and depth.

strike_get_orderbook

Top levels plus spread, USD depth bands and imbalance.

strike_estimate_market_impact

Simulates a market order by size or USD against the live book: average fill, worst price, slippage in bps.

strike_get_candles

OHLCV with change, range, volatility and volume stats.

strike_get_recent_trades

Recent prints with taker buy/sell flow and the largest trade.

strike_get_funding

Funding for one or all markets, ranked by absolute APR (carry and crowding scan).

strike_get_sentiment

Strike's own Fear & Greed index and its components.

Account (your API wallet, or any public wallet address)

Tool

What it answers

strike_get_account

Balances, available margin, uPnL, margin ratio, withdrawable, per-market leverage.

strike_get_positions

Positions with mark, notional, PnL % of margin, distance to liquidation, risk flag, funding paid/earned per day, plus portfolio totals.

strike_get_open_orders

Open and untriggered orders, including brackets and trailing stops.

strike_get_history

Orders, fills, funding payments, closed positions or transactions, with date filters and paging.

strike_get_portfolio

Realized PnL, volume, fees, fee tier, staked-STRIKE fee discount, account-value curve.

Trading (only with STRIKE_ENABLE_TRADING=true)

Tool

What it does

strike_preview_order

Validates and prices any order type (limit, market, stop, stop-limit, take-profit, trailing stop), optionally with take-profit/stop-loss brackets. Sends nothing.

strike_preview_close_position

Reduce-only market close of all or part of a position, with fill estimate.

strike_place_order

Sends a previewed order by preview_id.

strike_cancel_order / strike_cancel_all_orders

Cancel one, or all (requires confirm: true).

strike_set_leverage

Leverage for new positions in a market.

Prompts: strike_daily_brief (what's moving, funding extremes, sentiment, your positions) and strike_risk_check (stress-test positions against an adverse move).

Safety model

strike_preview_order runs these checks before a preview_id exists:

  • Exchange rules from /v2/exchangeInfo: tick size, step size, min/max quantity, min notional, market status.

  • Market fills walked against the live book. Refused if visible liquidity can't cover the size or slippage exceeds max_slippage_pct (default 1%).

  • Margin: estimated initial margin at the market's leverage vs. available balance.

  • Notional cap: no single order above STRIKE_MAX_ORDER_NOTIONAL_USD (default $1,000). Reduce-only closes are exempt.

  • Direction sanity: brackets must sit on the right side of entry; reduce-only orders must actually reduce; crossing limits and stops that would trigger immediately are flagged.

  • Position effect: shows the position before and after.

Then strike_place_order:

  • accepts only a preview_id (not order parameters), so the agent cannot alter a confirmed order;

  • the id is single-use and expires (default 120 s);

  • market orders are refused if the mark moved more than 1% since the preview.

On top of that, Strike API wallets cannot withdraw funds: the worst case is bounded to trading.

Setup

Requires Node.js 20+.

git clone https://github.com/francbonet/strike-mcp.git && cd strike-mcp
npm install && npm run build

Choose a mode

Every variable is optional. Set only what the mode you want needs:

Mode

Variables

What you get

Market data

none

Market data tools only.

Read-only account

STRIKE_WALLET_ADDRESS

Plus positions, orders, history and portfolio of that wallet, from Strike's public endpoints. No keys.

API wallet, read-only

STRIKE_API_PUBLIC_KEY + STRIKE_API_PRIVATE_KEY

Your own account through signed requests. Still no trading tools.

Trading

API wallet + STRIKE_ENABLE_TRADING=true

Adds the trading tools. Set STRIKE_MAX_ORDER_NOTIONAL_USD to lower the $1,000 per-order cap.

The two keys go together: set both or neither. To create an API wallet:

node dist/index.js keygen   # prints a new Ed25519 key pair

Register the public key at https://app.strikefinance.org/api-keys. Try trading on STRIKE_NETWORK=testnet first.

Passing the variables

The server reads its configuration from its own process environment and does not load .env by itself. Either:

  • put the variables in your client's config, as in the examples below (env block or -e flags), or

  • keep them in a .env file (cp .env.example .env) and have Node load it with --env-file (Node 20.6+). Your keys then stay in that file instead of the client's config:

    claude mcp add strike -- node --env-file=/absolute/path/to/strike-mcp/.env /absolute/path/to/strike-mcp/dist/index.js

    In JSON configs that is "args": ["--env-file=/absolute/path/to/strike-mcp/.env", "/absolute/path/to/strike-mcp/dist/index.js"] with no env block. Use absolute paths: clients don't launch the server from the project folder.

Then register it in your client: Claude Desktop · Claude Code · Codex · Cursor · VS Code · Gemini CLI · Other clients

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit config):

{
  "mcpServers": {
    "strike": {
      "command": "node",
      "args": ["/absolute/path/to/strike-mcp/dist/index.js"],
      "env": {
        "STRIKE_WALLET_ADDRESS": "addr1..."
      }
    }
  }
}

That's read-only with no keys. For trading, replace the env block with:

"env": {
  "STRIKE_API_PUBLIC_KEY": "…64 hex…",
  "STRIKE_API_PRIVATE_KEY": "…64 hex…",
  "STRIKE_ENABLE_TRADING": "true",
  "STRIKE_MAX_ORDER_NOTIONAL_USD": "250"
}

Claude Code

Read-only:

claude mcp add strike -e STRIKE_WALLET_ADDRESS=addr1... -- node /absolute/path/to/strike-mcp/dist/index.js

Trading:

claude mcp add strike -e STRIKE_API_PUBLIC_KEY=... -e STRIKE_API_PRIVATE_KEY=... -e STRIKE_ENABLE_TRADING=true -e STRIKE_MAX_ORDER_NOTIONAL_USD=250 -- node /absolute/path/to/strike-mcp/dist/index.js

By default claude mcp add registers the server only for the directory you run it in (-s local). Add -s user to make it available in all your projects, or -s project to share it through a .mcp.json in the repo (don't commit API keys there). Check it with claude mcp get strike; the tools appear in new sessions. To change the variables, claude mcp remove strike -s <scope> and add it again.

Codex

codex mcp add strike --env STRIKE_WALLET_ADDRESS=addr1... -- node /absolute/path/to/strike-mcp/dist/index.js

Or add it to ~/.codex/config.toml (shared by the Codex CLI, IDE extension and app):

[mcp_servers.strike]
command = "node"
args = ["/absolute/path/to/strike-mcp/dist/index.js"]

[mcp_servers.strike.env]
STRIKE_WALLET_ADDRESS = "addr1..."

To keep the API wallet keys out of the file, export them in your shell and forward them with env_vars = ["STRIKE_API_PUBLIC_KEY", "STRIKE_API_PRIVATE_KEY"] under [mcp_servers.strike].

Cursor

Add the same mcpServers block as for Claude Desktop to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).

VS Code (GitHub Copilot)

Add to .vscode/mcp.json. VS Code uses servers instead of mcpServers and needs "type": "stdio":

{
  "servers": {
    "strike": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/strike-mcp/dist/index.js"],
      "env": {
        "STRIKE_WALLET_ADDRESS": "addr1..."
      }
    }
  }
}

Gemini CLI

gemini mcp add -s user -e STRIKE_WALLET_ADDRESS=addr1... strike node /absolute/path/to/strike-mcp/dist/index.js

Other clients

strike-mcp is a stdio server: the client launches it as a subprocess and talks over stdin/stdout, so there is no port or URL. Any MCP client that can run a local server works with command node, argument /absolute/path/to/strike-mcp/dist/index.js, and the environment variables below.

Clients run the built dist/index.js from that path: after pulling changes, run npm run build and restart the client; if you move the folder, update the path.

Configuration

Variable

Default

Purpose

STRIKE_NETWORK

mainnet

testnet uses api-v2-testnet.strikefinance.org.

STRIKE_WALLET_ADDRESS

–

Default account for read-only lookups.

STRIKE_BLOCKCHAIN

auto

cardano, ethereum or solana, to skip chain detection.

STRIKE_API_PUBLIC_KEY / STRIKE_API_PRIVATE_KEY

–

API wallet (Ed25519, raw hex).

STRIKE_ENABLE_TRADING

false

Registers the trading tools. Requires an API wallet.

STRIKE_MAX_ORDER_NOTIONAL_USD

1000

Per-order notional cap.

STRIKE_PREVIEW_TTL_SECONDS

120

Preview lifetime.

STRIKE_API_URL / STRIKE_MARKET_URL

derived

Override base URLs.

How it works

src/
  auth.ts       Ed25519 request signing: METHOD:PATH?QUERY:TS:NONCE:SHA256(body)
  client.ts     REST client; signs the exact bytes it sends; typed API errors
  analytics.ts  Pure decimal math: book summary, fill simulation, funding, liquidation risk, order filters
  guard.ts      Single-use, expiring preview store
  tools/        market.ts, account.ts, trading.ts (MCP tool definitions)
  server.ts     MCP server, instructions and prompts

All money math uses decimal.js; prices and sizes stay strings end to end, matching the API.

Funding: Strike settles every hour and the rate served by the API is the hourly rate (the 8-hour rate ÷ 8), so APR = rate × 24 × 365.

Tests

npm test

22 tests: signature format and verification, analytics math, the preview store, and end-to-end MCP sessions (in-memory transport) against a mock Strike API that verifies every Ed25519 signature the server sends. They cover read-only mode, keyless wallet lookups, the full preview → place flow, notional caps, bracket validation, stale-price refusal and preview reuse.

The public market endpoints were also checked against mainnet. That surfaced one difference from the published spec: /price/v2/premiumIndex returns fundingRate, not lastFundingRate. The server reads both.

License

MIT

Available Tools

13 tools
strike_estimate_market_impactEstimate market impactA
Read-only

Simulates a market order against the live book without placing anything: average fill price, worst price, slippage vs mid in bps, and whether visible liquidity covers it. Give size or notional_usd.

Inputs: side (required), symbol (required), size, notional_usd.

strike_get_accountAccount & balancesA
Read-only

Balances and margin for an account: wallet balance, available balance, unrealized PnL, margin used, maintenance margin, margin ratio, withdrawable amount, and per-market leverage settings. Defaults to your own account; any public account can be looked up by wallet address.

Inputs: account_id, sub_account_id, wallet_address.

strike_get_candlesCandlesA
Read-only

OHLCV candles for a market plus summary stats (change, range, close-to-close volatility, volume). Use for trend questions like 'how has ADA moved this week'.

Inputs: symbol (required), limit, interval, price_type, +1 more.

strike_get_fundingFunding ratesA
Read-only

Current funding for one market or all, with hourly/8h/APR rates and who pays. Without a symbol, markets are ranked by absolute APR to surface carry opportunities and crowded trades.

Inputs: limit, symbol.

strike_get_historyAccount historyA
Read-only

Account history: orders, fills (trades), funding payments, closed positions, or transactions (deposits, withdrawals, transfers). Newest first. Use cursor (an id from the last row) to page back.

Inputs: kind (required), limit, since, until, +5 more.

strike_get_open_ordersOpen ordersA
Read-only

Open and untriggered orders (limits, stops, take-profits, trailing stops) for an account.

Inputs: symbol, account_id, sub_account_id, wallet_address.

strike_get_orderbookOrder bookB
Read-only

Order book for a market: top price levels per side plus a summary (best bid/ask, spread in bps, USD depth within 0.5/1/2% of mid, and bid/ask imbalance).

Inputs: symbol (required), levels.

strike_get_portfolioPortfolio performanceB
Read-only

Long-run performance: realized PnL, all-time volume and fees, deposits/withdrawals, current fee tier, staking fee discount (from staked STRIKE), 30-day volume, and a recent account-value curve.

Inputs: account_id, history_points, sub_account_id, wallet_address.

strike_get_positionsPositions with riskA
Read-only

Open positions enriched with live mark price, notional, PnL as % of margin, distance to liquidation, a risk flag (ok / watch / danger), and what each position pays or earns in funding per day. Use this for 'how are my positions', 'am I close to liquidation', 'what is funding costing me'.

Inputs: symbol, watch_pct, account_id, danger_pct, +2 more.

strike_get_recent_tradesRecent tradesB
Read-only

Most recent public trades in a market with a taker-flow summary (buy vs sell volume, largest trade).

Inputs: symbol (required), limit, include_trades.

strike_get_sentimentMarket sentimentA
Read-only

Strike's Fear & Greed index (0 extreme fear to 100 extreme greed) computed from the exchange's own 24h tape, with momentum/breadth/volatility components. Display-only, not a risk input.

Inputs: no named parameters.

strike_list_marketsList Strike marketsA
Read-only

Lists every Strike perpetual market with price, 24h change, volume, open interest and funding (as APR). Use it to discover symbols or rank markets (top movers, most traded, highest funding).

Inputs: limit, sort_by, category, include_inactive.

strike_market_snapshotMarket snapshotA
Read-only

One-call brief for a single market: price, 24h range and change, volume, open interest, funding (hourly, 8h, APR and who pays), mark vs index premium, spread and order-book depth/imbalance.

Inputs: symbol (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools target distinct resources or actions, but strike_market_snapshot is a 'one-call brief' that substantially overlaps with strike_get_funding, strike_get_orderbook, and price data in strike_list_markets, creating some ambiguity about when to use the aggregate versus the specific tools. Descriptions help disambiguate, so selection is mostly reliable.

    Naming Consistency4/5

    All tools use a consistent strike_ prefix and snake_case verb_noun pattern (strike_get_orderbook, strike_list_markets, strike_get_candles). Minor deviation: strike_market_snapshot is noun-first rather than verb-first, but overall the pattern is very predictable.

    Tool Count5/5

    13 tools is well within the ideal 3-15 range and each tool covers a distinct market or account data concern. The count is well-scoped for a market-data/account analytics server.

    Completeness3/5

    The read-only analytics surface (markets, orderbook, candles, trades, funding, sentiment, account, positions, orders, history, portfolio) is thorough. However, there are no mutating operations—no place order, cancel order, or transfer—which is a notable gap for a perpetuals trading server and leaves agents at a dead end if trading is intended.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to trade leveraged perpetual futures on Solana's Jupiter Perpetuals while providing tools for market data and technical analysis. It supports portfolio management, fee estimation, and automated position execution for SOL, ETH, and BTC using USDC collateral.
      13
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to securely trade on Hyperliquid perpetual exchange, including order placement, position management, market data retrieval, and vault operations via natural language.
      23 PyPI
      24
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.
      5
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to query liquidation radar for seven tokens, inspect recorded BTC/ETH order book depth with wall history and aggressor flow, and request Li.Fi cross-chain swap routes that agents sign themselves.
      MIT