stray-mcp 0.1.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,33 @@
1
- # stray-mcp
2
-
3
- The [Stray API](https://stray.fi/docs) as read-only MCP tools for Claude, Cursor or any MCP client: Hyperliquid
4
- order-book depth, funding, open interest, trade flow, whale positioning, liquidation levels and The Draw, with the
5
- same markets on Binance, Bybit and OKX beside it. Runs over stdio on Node 18 or later.
6
-
7
- Ask in plain words: "Is BTC's book thinner than usual for this hour?", "Where are the big liquidation levels on
8
- ETH?", "Compare HYPE depth on Hyperliquid with Binance, Bybit and OKX."
1
+ <p align="center">
2
+ <a href="https://stray.fi/docs/ai"><img src="https://raw.githubusercontent.com/meex-works/stray-cookbook/master/.github/assets/banner.png" alt="stray-mcp: Hyperliquid's market record, as read-only tools for AI agents" width="100%"></a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/stray-mcp"><img src="https://img.shields.io/npm/v/stray-mcp?color=b8781f&labelColor=1b1712&label=npm" alt="npm version"></a>
7
+ <a href="#tools"><img src="https://img.shields.io/badge/MCP-23_read--only_tools-b8781f?labelColor=1b1712" alt="23 read-only MCP tools"></a>
8
+ <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/stray-mcp?color=b8781f&labelColor=1b1712" alt="Node version"></a>
9
+ <a href="https://github.com/meex-works/stray-cookbook/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-b8781f?labelColor=1b1712" alt="MIT license"></a>
10
+ <a href="https://stray.fi/docs/ai"><img src="https://img.shields.io/badge/guide-stray.fi%2Fdocs%2Fai-b8781f?labelColor=1b1712" alt="Guide"></a>
11
+ <a href="https://x.com/stray_fi"><img src="https://img.shields.io/badge/@stray__fi-1b1712?logo=x&logoColor=white" alt="@stray_fi on X"></a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://stray.fi/docs/ai"><b>Guide</b></a> ·
16
+ <a href="https://stray.fi/docs"><b>API reference</b></a> ·
17
+ <a href="https://stray.fi/console"><b>Get a key</b></a> ·
18
+ <a href="https://github.com/meex-works/stray-cookbook"><b>Cookbook</b></a> ·
19
+ <a href="https://x.com/stray_fi"><b>@stray_fi</b></a>
20
+ </p>
21
+
22
+ Stray records Hyperliquid's perp markets every minute: order-book depth, funding, open interest, trade flow, the
23
+ largest accounts' positions, liquidation levels and the Draw, with the same markets on Binance, Bybit and OKX beside
24
+ them. **stray-mcp** gives that record to Claude, Cursor or any MCP client as 23 read-only tools. Ask in plain words;
25
+ every answer comes back with its time, its source and what it was compared with.
26
+
27
+ <p align="center">
28
+ <img src="https://raw.githubusercontent.com/meex-works/stray-cookbook/master/.github/assets/demo-btc.png" alt="Claude Code asked 'Is BTC's book thinner than usual for this hour?'; it read Stray's live book and 14-day hour profile and answered: about 4% deeper than its same-hour norm, with a chart of median depth by UTC hour" width="100%">
29
+ <br><sub>A live run in Claude Code, 26 November 2026, 08:24 UTC. The 56-second walkthrough is on <a href="https://stray.fi/docs/ai">stray.fi/docs/ai</a>.</sub>
30
+ </p>
9
31
 
10
32
  ## Setup
11
33
 
@@ -33,24 +55,87 @@ claude mcp add stray -e STRAY_API_KEY=stray_... -- npx -y stray-mcp
33
55
  }
34
56
  ```
35
57
 
36
- Each tool call is one API call. `STRAY_BASE_URL` overrides `https://stray.fi/v1`.
58
+ Node 20 or later. The server runs over stdio and talks only to `https://stray.fi/v1` (`STRAY_BASE_URL` overrides it).
59
+
60
+ ## Ask it
61
+
62
+ | Ask | The agent reaches for |
63
+ |---|---|
64
+ | "How crowded is the exit on HYPE if I'm holding $250k?" | `stray_book_check` |
65
+ | "Is BTC's book thinner than usual for this hour?" | `stray_book_check`, then `stray_profile` |
66
+ | "Is BTC's move this week unusual?" | `stray_unusual` |
67
+ | "What's stretched right now?" | `stray_brief`, then `stray_draw` with a coin |
68
+ | "Are positions being opened or closed into this move?" | `stray_oi_change` |
69
+ | "Is the funding gap between Hyperliquid and Binance real?" | `stray_funding_venues` |
70
+ | "What did BTC's book do between 13:00 and 15:00 UTC on 25 November?" | `stray_history`, `stray_flow`, `stray_liquidity` with `end` |
71
+ | "Where are ETH's big liquidation levels?" | `stray_liqmap` |
72
+
73
+ ## What comes back
74
+
75
+ Every result starts with `as_of` and `source`, then the comparison it was made against. Here is `stray_book_check`
76
+ for BTC with a $5M size, from a live run (trimmed):
77
+
78
+ ```json
79
+ {
80
+ "as_of": "2026-11-27T05:08:26.094Z",
81
+ "source": "Hyperliquid live book; Stray's record",
82
+ "coin": "BTC",
83
+ "mid": 61647.5,
84
+ "book": {
85
+ "usd_within": {
86
+ "0.5%": { "bids": 61928367, "asks": 64358816 },
87
+ "1%": { "bids": 112535012, "asks": 116464746 }
88
+ }
89
+ },
90
+ "usual_hour": { "hour_utc": 5, "median_usd_within_1pct": 218230588, "period_days": 14,
91
+ "vs_norm": 1.049 },
92
+ "size": {
93
+ "usd": 5000000,
94
+ "sell": { "against": "bids", "covered_within": "0.5%", "share_of_band": 0.0807 },
95
+ "buy": { "against": "asks", "covered_within": "0.5%", "share_of_band": 0.0777 },
96
+ "caveat": "Resting orders at the book's as_of; they can be pulled or added to. Not a fill price."
97
+ },
98
+ "positions_per_book_dollar": { "value": 9.2, "percentile": 8, "period_days": 7 },
99
+ "liquidations_within_5pct": {
100
+ "below_0_2pct_usd": 0,
101
+ "above_0_2pct_usd": 400612,
102
+ "sample": "the top 1,500 Hyperliquid accounts by account value; not every position"
103
+ },
104
+ "api_calls": 4
105
+ }
106
+ ```
107
+
108
+ Read: the book is 1.05× its usual depth for 05:00 UTC; $5M is 8% of the bids within 0.5%; positions per dollar of
109
+ book sit at the 8th percentile of the week; $400k of short liquidations sit within 2% above.
37
110
 
38
111
  ## Tools
39
112
 
113
+ **Composed: the comparison already made**
114
+
115
+ | Tool | Returns | API calls |
116
+ |---|---|---|
117
+ | `stray_book_check` | The live book against the usual depth for this UTC hour; with `usd`, the tightest band of resting orders that covers that size on each side; positions per dollar of book and its 7-day percentile; liquidation levels within 5% of the mark | 4 (2 for a HIP-3 market) |
118
+ | `stray_unusual` | Where the latest move sits among every past window of the same length, for up to three lengths (default 1, 7 and 30 days); implied against realized volatility for BTC and ETH | 1 per window, +1 for BTC/ETH |
119
+ | `stray_brief` | The whole market's Draw and its 24-hour change, all core markets ranked, and the components of the most tense | 1 + `top` (default 2) |
120
+ | `stray_oi_change` | Mark price and open interest (in coins, so price moves don't count as new positions) over 1 hour, 4 hours, 24 hours and 7 days | 1 |
121
+ | `stray_funding_venues` | Funding on Hyperliquid, Binance, Bybit and OKX on one hourly scale, each venue's gap to Hyperliquid and how many hours it has held its sign | 1 |
122
+
123
+ **One read each**
124
+
40
125
  | Tool | Returns |
41
126
  |---|---|
42
127
  | `stray_draw` | The Draw, 0 (calm) to 100 (stressed): the whole market with each core market, or one market with its seven components and inputs |
43
128
  | `stray_depth` | USD within ±0.5%, ±1% and ±2% of mid on the live book (core or HIP-3 markets) |
44
- | `stray_profile` | The typical day: median depth, spread and volume for each UTC hour |
129
+ | `stray_profile` | The typical day: median depth, spread and volume for each UTC hour, plus the thinnest and deepest hours |
45
130
  | `stray_crowding` | Open interest per dollar of book within ±1%, with the latest percentile |
46
131
  | `stray_venues` | Hyperliquid, Binance, Bybit and OKX side by side, and Hyperliquid's share of depth |
47
- | `stray_funding` | Funding on Hyperliquid, Binance or Bybit, ranked against all history |
48
- | `stray_conditional` | Today's funding decile and the moves that followed past days in it |
132
+ | `stray_funding` | Funding on Hyperliquid, Binance or Bybit, ranked against all history, with who pays and the cost per $10,000 a day |
133
+ | `stray_conditional` | Today's funding decile and the spread of moves that followed past days in it, beside all days |
49
134
  | `stray_ranges` | Percentiles of past moves over 1 to 90 days, and where the latest sits |
50
- | `stray_flow` | Volume by aggressor side, largest trade, liquidations by side |
135
+ | `stray_flow` | Hyperliquid volume by aggressor side and the largest trade; Binance and Bybit liquidations by side; window totals |
51
136
  | `stray_positioning` | Binance open interest, long/short accounts, top traders, taker volume |
52
- | `stray_whales` | Totals of the top 1,500 Hyperliquid accounts' positions, and HLP |
53
- | `stray_liqmap` | Where those positions get liquidated, by distance from the mark |
137
+ | `stray_whales` | Totals of the top 1,500 Hyperliquid accounts' positions and HLP, with the long share's change over 1 h, 24 h and 7 d |
138
+ | `stray_liqmap` | Where those positions get liquidated, by distance from the mark, with the price at each band edge |
54
139
  | `stray_implied` | Deribit implied volatility beside realized (BTC, ETH) |
55
140
  | `stray_basis` | HYPE perp against spot, in basis points |
56
141
  | `stray_correlation` | Correlation of daily returns between the core markets |
@@ -58,19 +143,44 @@ Each tool call is one API call. `STRAY_BASE_URL` overrides `https://stray.fi/v1`
58
143
  | `stray_history` | Stray's minute record: mark, oracle, funding, open interest, depth bands |
59
144
  | `stray_markets` | The markets covered, and when recording began |
60
145
 
61
- Time series come back as named rows, newest last, at most 200 (fewer where rows are wide). Ask for a larger `step`
62
- to cover a longer span. The live stream (`/v1/stream`, Pro) isn't a tool: it's an open connection, not a question.
146
+ Series tools take `end` (ISO 8601 UTC) to read a past window, and `step` where rows can be thinned. Rows come back
147
+ named, newest last, at most 200.
63
148
 
64
- Stray describes the past and the present. Nothing it returns is a forecast or financial advice.
149
+ ## Prompts
65
150
 
66
- ## From source
151
+ Clients that show MCP prompts list six ready questions. Each names the tools to use and asks for the time and the
152
+ comparison behind every number.
67
153
 
68
- The server lives in the [Stray cookbook](https://github.com/meex-works/stray-cookbook/tree/master/mcp), beside
69
- quickstarts, worked examples and an OpenAPI spec.
154
+ | Prompt | Asks |
155
+ |---|---|
156
+ | `exit` | How crowded is the exit on a market (optionally for a size)? |
157
+ | `unusual` | Is the recent move unusual? |
158
+ | `pressure` | Which measured conditions are at unusual levels right now? |
159
+ | `thin` | Is the book thin for this hour, and when is it usually thinnest? |
160
+ | `venues` | How does Hyperliquid compare with Binance, Bybit and OKX right now? |
161
+ | `replay` | What did the book do between two times? |
162
+
163
+ ## Good to know
164
+
165
+ - **Read-only.** The tools read the record and the live book. They can't place orders, sign anything or move funds.
166
+ - **A record, not a forecast.** Stray describes what markets have done. If an agent turns that into a price call,
167
+ that part is the agent's.
168
+ - **The meter.** Most tool calls are one API call; the composed tools make up to four and report `api_calls`.
169
+ Repeat reads of slow-moving data within 60 seconds are served from memory and cost nothing. Builder allows 60 calls
170
+ a minute and 100,000 a month.
171
+ - **Units.** Times are UTC. Fractions are decimals (`-0.1379` is −13.79%). USD is US dollars. Funding is per hour on
172
+ Hyperliquid and per 8 hours on Binance, Bybit and OKX; `stray_funding_venues` puts them on one scale.
173
+ - **Totals only.** Positions of the largest accounts are summed per market. No wallet appears anywhere.
174
+
175
+ ## Development
70
176
 
71
177
  ```sh
72
178
  git clone https://github.com/meex-works/stray-cookbook && cd stray-cookbook/mcp && npm install
73
- STRAY_API_KEY=stray_... npm test # starts the server, lists the tools, calls each once (about 18 calls)
179
+ npm test # offline: a local fake API, no key, no quota
180
+ STRAY_API_KEY=stray_... npm run test:live # starts the server, calls every tool once (about 30 calls)
74
181
  ```
75
182
 
183
+ The server is one file, [`index.js`](https://github.com/meex-works/stray-cookbook/blob/master/mcp/index.js). The live
184
+ stream (`/v1/stream`, Pro) isn't a tool: it's an open connection, not a question.
185
+
76
186
  MIT © 2026 SHYGUY LLC