Lucyd MCP Server
Connect Claude, Cursor or any MCP-compatible AI agent to Lucyd. Browse markets, read the order book, trade, close positions and collect winnings by asking in plain language.
What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools. The Lucyd MCP server is a small program that runs on your computer. Your agent asks it for markets, prices or trades; the server calls the Lucyd API and order book, signs orders with your wallet key locally and returns the result.
Available tools
Market data
No wallet neededlist_marketsMarkets filtered by state and period
get_marketRules, strike, end date and outcome token ids of a market
get_order_bookBids, asks, best bid, best ask and mid of an outcome
list_tradesRecent trades by market or trader
get_positionsTokens held, average price, value and profit
get_trader_statsProfit, volume and win rate of a wallet
get_pnl_historyProfit over time
top_tradersLeaderboard
Trading
Signed with your wallet keyplace_orderLimit or market order, buy or sell Up or Down
close_positionSell everything you hold on a market right away
cancel_ordersCancel by id, all on a market, or all
get_open_ordersYour resting orders
Wallet
On-chain, needs a little Sepolia ETH for gasget_walletAddress, ETH and USDC balances, approvals
approve_tradingOne-time approvals for the Exchange contract
set_auto_redeemTurn automatic payout of winnings on or off
redeemCollect the payout of a resolved market
Quickstart
1. Install Node.js
You need Node.js 18 or newer. Your agent runs the server with npx -y @lucyd/mcp, which downloads the build for your system on first run and verifies its checksum. Nothing else to install.
2. Prepare a wallet
Use a separate wallet for your agent and copy its private key. Skip the key to use the server read-only.
3. Add to Claude Code
claude mcp add lucyd -e LUCYD_PRIVATE_KEY=0xYOUR_KEY -- npx -y @lucyd/mcp
Or add to Claude Desktop
Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\) and restart Claude:
{
"mcpServers": {
"lucyd": {
"command": "npx",
"args": ["-y", "@lucyd/mcp"],
"env": {
"LUCYD_PRIVATE_KEY": "0xYOUR_KEY"
}
}
}
}Or add to Cursor
Add the same block to ~/.cursor/mcp.json:
{
"mcpServers": {
"lucyd": {
"command": "npx",
"args": ["-y", "@lucyd/mcp"],
"env": {
"LUCYD_PRIVATE_KEY": "0xYOUR_KEY"
}
}
}
}npx, use "command": "cmd" with "args": ["/c", "npx", "-y", "@lucyd/mcp"]. Prefer not to use Node.js? Download the binary from Releases and use its path as the command.Before the first trade
The wallet needs USDC to buy and a little Sepolia ETH for the one-time approvals and for redemptions. Ask your agent to check your wallet and approve trading: it calls get_wallet and approve_trading. Trading itself costs no gas, the exchange settles fills on chain.
Example prompts
Once connected, your agent understands requests like:
"Show the open 1h markets and the order book of the current one"
"What is the probability that BTC goes Up in the current 15m market?"
"Buy 10 Up tokens in the current 15m market at 0.55 or better"
"Close my position in the 5m market"
"What are my positions and total profit this week?"
"Cancel all my orders"
"Turn on automatic payout of my winnings"
Settings
Set as environment variables in the server config, next to the key.
LUCYD_PRIVATE_KEYWallet key that signs orders and transactions. Without it the server is read-only
LUCYD_MAX_ORDER_USDLargest buy order in USDC
default: 100LUCYD_READ_ONLYSet to true to turn off every tool that trades or sends transactions
default: falseLUCYD_RPC_URLSepolia RPC node
default: https://ethereum-sepolia-rpc.publicnode.comLUCYD_API_URLMarkets API
default: https://api.testnet.lucyd.tradeLUCYD_CLOB_URLOrder book
default: https://clob.testnet.lucyd.tradeSafety
- The key never leaves your computer. Only signed orders and transactions are sent.
- The server tells your agent to ask you before trading, but the final call is the agent's. Keep LUCYD_MAX_ORDER_USD low.
- Want data only? Leave out the key or set LUCYD_READ_ONLY=true.
Source code
The server is open source under the MIT license: github.com/lucyd-trade/mcp-server. Read the code, build it yourself with cargo install --git https://github.com/lucyd-trade/mcp-server, or open an issue or pull request.