
Hyperliquid Agent Gateway
io.github.alekskramPublished by GitHub account alekskramv0.1.3Updated Oct 24, 2026
Read-only MCP gateway to Hyperliquid: liquidation distance, funding carry, HyperEVM flows. No keys.
Overview
Read-only MCP gateway for Hyperliquid market, funding, account-risk and HyperEVM on-chain data, with no keys or signing.
- What you can do
- Exposes twelve read-only tools over Hyperliquid's public endpoints: perp and spot market overviews, quotes, order books, candles, trades, funding history and a funding-carry screener. Account tools cover liquidation risk, trader activity and wallet balances, plus HyperEVM ERC-20 token transfers. Everything is cached and rate-limited, and errors are returned as structured error dictionaries rather than tracebacks.
- When to use it
- Useful when an assistant needs to read Hyperliquid perp or spot markets, screen funding carry, inspect an address's positions and liquidation distance, or trace HyperEVM token flows. It is meant for analysis and monitoring only, since it cannot place, sign or modify anything.
- Requirements
- A local Python runtime; the package is installed and run with uvx (or from a checkout with uv). It talks to api.hyperliquid.xyz and rpc.hyperliquid.xyz over the network. No API keys, accounts or environment variables are declared. Desktop only; an optional local HTTP mode listens on port 8903.
Installation
In SourceWeft
- Open Hyperliquid Agent Gateway in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
hyperliquid-agent-gateway
[CI] [PyPI] [PyPI downloads] [MCP Catalog] [License: MIT] [Python 3.11+]
Hyperliquid puts about 233 perps, 326 spot pairs and a whole EVM chain in front of you, all readable through public endpoints. This MCP server does the reading for your agent: market and funding data, per-account risk, trader activity, HyperEVM (chain 999) token transfers. No keys, no signing, no writes; everything goes through api.hyperliquid.xyz/info and rpc.hyperliquid.xyz/evm, cached and rate-limited so an enthusiastic agent cannot hammer the upstream.
Use cases
The liquidation tool is the one people come for. Feed it any address and you get the margin summary, per-position leverage, and the distance to liquidation; when the venue publishes liquidationPx you get the real number, flagged as such, and when it doesn't you get an estimate that says it is one. We tested it on a $209M-notional 25x short book the day it was 17.6% from the cliff.
Funding: funding_carry_screener ranks all 233 perps from a single call and then fetches 168h of history only for the top few, because the API's weight budget (1200/min) punishes naivety. You see whether a rate is a spike or a regime.
HyperEVM transfers tie on-chain flow back to the perp markets; quote returns a book-derived mid that never leaves [bid, ask]; trader_activity dissects any address into fills, fees, win-rate, funding drag and open positions.
Full walkthroughs: examples/use-cases.md.
Quickstart
Claude Code:
stdio (default, for local agents):
or from a checkout:
Claude Desktop / Cursor config:
Hosted form, streamable HTTP on port 8903:
Codex (~/.codex/config.toml)
ZCode: register the server (copy-paste)
Tools
All 12 tools are read-only (annotated readOnlyHint: true, destructiveHint: false, openWorldHint: true).
Why a gateway and not the raw API?
api.hyperliquid.xyz/info is open and one POST away. The traps start after that:
Rate limits
Two independent, locally enforced budgets protect the upstream:
/info - 1200 weight per rolling 60s (Hyperliquid's documented
weight pricing), tracked per request type:
When the next request would exceed the budget the client waits once (<=5s) for the window to roll, then raises a clear error naming the limit - it never sleep-blocks forever.
HyperEVM RPC - 100 requests per rolling 60s (flat 1 per request),
enforced separately from /info. Over-budget calls raise immediately
(rpc-limit) - tools surface an honest error dict, and
wallet_balance stops its ERC-20 scan at the cap.
TTL caches also dedupe repeated calls per data type: allMids 15s, recentTrades 15s, l2Book 5s, metaAndAssetCtxs 60s, spotMeta 3600s, spotMetaAndAssetCtxs 60s, candleSnapshot 300s, fundingHistory 300s, per-address account types 60s.
Data notes
- Every numeric from the API is a STRING upstream; the gateway parses
them with a never-raising helper -
nullalways means "not available", never zero. - Every upstream failure returns an error dict
{"error": ..., "source": ..., "reason": ...}, never a traceback; partial data degrades field-by-field withwarnings[]. liquidation_risknever invents a liquidation price: when the venue publishes none,liq_pxstaysnulland the distance is an explicitly flagged estimate (formula in the tool's note). Mark px is likewise never invented: live positions carry nomarkPx, so it is resolved frommetaAndAssetCtxs(fallbackallMids) and the row'smark_px_sourcesays which; no source ->null.funding_drag/funding_net: the venue'suserFundingreturns only NON-ZERO funding events, so a livenull/empty for a fresh or quiet address is expected behaviour, not a bug.- ERC-20 amounts use a static decimals map for canonical HyperEVM
tokens (6 for USDC/USDT-style, 18 for PURR/HYPE); unknown tokens
assume 18 and every row says
decimals_source: "assumed_18"- do not trust 6dp precision for unmapped tokens. - Cached responses carry
age_seconds/fetched_atfreshness fields.
Part of the suite
Four sibling read-only MCP gateways, one style: keyless, cached, honest degradation.
All four are on glama.ai and PyPI; any of them installs with uvx <name>.
License
MIT.
Source: README.md at commit 2e9ad8c
Tools
0Version history
2- v0.1.3LatestSep 23, 2026
- v0.1.2Sep 22, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts