Back to Browse

Lighter Agent MCP Server

Developer ToolsUse Caution4.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Read Lighter perpetual markets and place guarded orders, including the H100 compute-price market.

About

Read Lighter perpetual markets and place guarded orders, including the H100 compute-price market.

Security Report

4.2
Use Caution4.2High Risk

This MCP server for the Lighter perpetuals exchange has solid security fundamentals with proper authentication, input validation, and a well-designed notional cap system to limit order sizes. The codebase demonstrates good credential handling practices and appropriate permission scoping for its purpose. Minor code quality observations around error handling and logging do not materially impact security. Supply chain analysis found 3 known vulnerabilities in dependencies (2 critical, 1 high severity). Package verification found 1 issue (1 critical, 0 high severity).

5 files analyzed · 8 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

Unverified package source

We couldn't verify that the installable package matches the reviewed source code. Proceed with caution.

What You'll Need

Set these up before or after installing:

Deployment to read: mainnet, testnet, or robinhood. Defaults to mainnet.Optional

Environment variable: LIGHTER_NETWORK

Sub-account the agent trades from. Read-only tools work without it.Optional

Environment variable: LIGHTER_ACCOUNT_INDEX

API key slot bound to the sub-account, 0 to 254.Optional

Environment variable: LIGHTER_API_KEY_INDEX

API key private key. Full write authority over the account it is bound to, so use a dedicated sub-account.Required

Environment variable: LIGHTER_API_KEY_PRIVATE_KEY

Per-order notional ceiling in USD. Required before any order can be signed.Optional

Environment variable: LIGHTER_MAX_NOTIONAL_USD

Layer-2 chain id bound into every signature. Mainnet uses 304 and testnet 300, so this is only needed on a deployment that publishes none.Optional

Environment variable: LIGHTER_CHAIN_ID

Read-only token for account observation without a signing key.Required

Environment variable: LIGHTER_READ_ONLY_TOKEN

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-winter0x-lighter-mcp": {
      "env": {
        "LIGHTER_NETWORK": "your-lighter-network-here",
        "LIGHTER_CHAIN_ID": "your-lighter-chain-id-here",
        "LIGHTER_ACCOUNT_INDEX": "your-lighter-account-index-here",
        "LIGHTER_API_KEY_INDEX": "your-lighter-api-key-index-here",
        "LIGHTER_READ_ONLY_TOKEN": "your-lighter-read-only-token-here",
        "LIGHTER_MAX_NOTIONAL_USD": "your-lighter-max-notional-usd-here",
        "LIGHTER_API_KEY_PRIVATE_KEY": "your-lighter-api-key-private-key-here"
      },
      "args": [
        "-y",
        "lighter-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

lighter-agent

A TypeScript client and an MCP server for Lighter, the zero-knowledge perpetuals exchange, written for agents that read markets and place bounded orders.

Built by Prism. Not affiliated with, endorsed by, or operated by Lighter or elliottech.

Install

npm install lighter-agent-sdk

The MCP server runs straight from npm:

npx -y lighter-mcp

Node 20 or newer. Reading markets needs no credentials.

Hedge an H100 bill

Lighter lists market 182, H100, a perpetual on the rental cost of an NVIDIA H100. A GPU renter who is short that market gains when compute gets more expensive, which offsets the larger bill.

import { LighterRestClient, h100Snapshot, hedgeH100 } from 'lighter-agent-sdk';

const rest = new LighterRestClient({ network: 'mainnet' });

const h100 = await h100Snapshot(rest);
console.log(h100.markPrice, 'per GPU hour, funding paid by', h100.funding.paidBy);

const plan = await hedgeH100(rest, {
  gpuHours: 500,
  side: 'short',
  maxNotionalUsd: 2_000,
});

console.log(plan.hedgedGpuHours, 'hours covered, worst case', plan.worstCaseNotionalUsd, 'USD');

hedgeH100 sizes the position from GPU hours and prices it against the live book. Anything above maxNotionalUsd is refused, and dryRun defaults to true, so a mistyped call returns a plan and not a position.

Run it: node examples/hedge-h100.mjs 500.

Use it from an MCP client

{
  "mcpServers": {
    "lighter": {
      "command": "npx",
      "args": ["-y", "lighter-mcp"],
      "env": {
        "LIGHTER_NETWORK": "mainnet"
      }
    }
  }
}

That configuration is read-only. To let the agent trade, add LIGHTER_ACCOUNT_INDEX, LIGHTER_API_KEY_INDEX, LIGHTER_API_KEY_PRIVATE_KEY, and LIGHTER_MAX_NOTIONAL_USD. The last one is a per-order ceiling with no default, so orders stay refused until you choose a number.

Nine tools:

ToolWhat it does
lighter_marketsList or search every market Lighter publishes details for
lighter_marketMark, index, funding, and top of book for one market
lighter_h100Compute price, funding, and depth for market 182
lighter_fundingFunding rates, with the period stated on every number
lighter_accountCollateral, positions, and resting orders
lighter_place_orderOne limit or market order under a required notional cap
lighter_cancelCancel one resting order
lighter_cancel_allCancel every resting order on the sub-account
lighter_hedge_h100Size an H100 hedge. Dry run unless execute is true

There is no transfer tool and no change-pubkey tool. Neither the SDK nor the server exposes a path to move balance off the account.

Why this exists

Lighter has no official TypeScript SDK and no registered MCP server, so an agent that wants to trade there starts by reimplementing Schnorr signatures over ECgFp5 and the transaction encoding behind them. It also lists an H100 perpetual, which makes the price of GPU time a tradable instrument rather than a quote in a rental agreement. Prism rents H100s, so hedging that price was the first thing we wanted an agent to do without a human in the loop.

Limitations

  • The H100 book is thin. Measured on 2026-08-26, it traded about $7,100 over 24 hours, held open interest near $10,000, and showed 4.00 of size at the top of book on each side, with a minimum order of 2.00. Treat it as an early instrument and size to the book.
  • A Lighter API key is full write authority over the account it is bound to, with no spend cap of its own. Run the agent on a dedicated sub-account funded with only what it may lose.
  • Lighter's WebSocket stream is blocked from some hosts, Render among them. REST polling is a first-class path in the SDK for that reason.
  • The Standard rate tier allows 60 requests per minute. The MCP server caches the market list for 30 seconds so repeat lookups do not spend that budget.

Packages

PackageDescription
lighter-agent-sdkREST and WebSocket client, units, signer, H100 hedge
lighter-mcpMCP stdio server, nine tools

Development

npm install
npm run build
npm test
node scripts/live-check.mjs   # read-only, hits mainnet

Tests run against fixtures and never open a socket. The live check is the only script that talks to the exchange.

License

Apache-2.0. See LICENSE and NOTICE. The signer is the official WebAssembly build from elliottech/lighter-go, vendored unmodified with its provenance recorded in vendor/wasm/PROVENANCE.md.

Reviews

No reviews yet

Be the first to review this server!