MCP server for Pear Protocol: markets, positions, orders, portfolio, and gated trade execution.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Pear.
get_healthAPI health and uptime
list_marketsbrowse pair markets with filters and pagination
get_active_marketstop gainers, losers, and highlighted pairs
get_pair_ratiocurrent ratio, 24h change, and funding for a specific pair
get_account_summaryyour account header
get_open_positionsyour open positions with PnL
The Pear Protocol MCP server for Hyperliquid pair trading β connect Claude, Cursor, or any AI agent to on-chain perps: browse pair markets, read positions and portfolio, and (opt-in) execute pair trades.
Model Context Protocol (MCP) server for Pear Protocol. Gives Claude, or any MCP-compatible agent, access to markets, pair ratios, positions, orders, trade history, portfolio, and (v0.2) full trade execution on Hyperliquid.
v0.2 adds trade execution. Ten write tools (open, close, and adjust positions; manage leverage and risk; cancel orders) are off by default behind
PEAR_TRADE_ENABLED=true. Pear signs server-side, so mcp-pear never holds private keys.
Pear is a Hyperliquid-backed perps platform for pair markets: long one basket against another. Every pair has a live ratio that moves as the legs diverge. More at pearprotocol.io.
Public (no auth):
get_health: API health and uptimelist_markets: browse pair markets with filters and paginationget_active_markets: top gainers, losers, and highlighted pairsget_pair_ratio: current ratio, 24h change, and funding for a specific pairAuthenticated read:
get_account_summary: your account headerget_open_positions: your open positions with PnLget_open_orders: your open limit, TP, and SL ordersget_twap_orders: your active TWAP ordersget_trade_history: your closed trades with realized PnLget_portfolio: bucketed PnL across 1d, 1w, 1m, 1y, and all-timeget_agent_wallet: the agent wallet Pear uses to sign your tradesAuthenticated write (v0.2, gated behind PEAR_TRADE_ENABLED=true):
create_agent_wallet: create the agent walletopen_position, close_position, close_all_positions: open and close pair positionsadjust_position, adjust_leverage: change size or leverage on a live positionset_risk_parameters: set or update TP and SLcancel_order, cancel_twap_order: cancel pending ordersFull parameter reference in Tool reference. See Trade execution (v0.2) for the gate and Hyperliquid funding rules.
Pin
@latest(or a specific version) in the npx spec. Plainnpx @marvelcodes/mcp-pearcan launch a stale cached version: npx prefers its local cache over the npm registry when the spec is unpinned, so after a new release lands you may still be running the old one.@latestre-resolves against the registry each launch; pin like@0.2.0instead if you want a frozen version. Stuck on an old version after upgrading? Clear the npx cache:rm -rf ~/.npm/_npx(macOS/Linux).
For the authenticated tools, mint a key:
The CLI opens a browser, asks you to sign once with your wallet, mints a Pear API key, and (optionally) writes PEAR_API_KEY and PEAR_ADDRESS to a .env. Copy those two values into your Claude Desktop config and restart Claude.
Already have a JWT from
app.pear.garden? Skipsetupand use JWT pass-through below.
Three auth modes. mcp-pear uses the first one whose env vars are set, decided on the first authenticated call.
For Telegram bots and other orchestrators that mint JWTs externally (Privy, EIP-712, or any Pear-supported flow). The JWT is opaque; mcp-pear never calls /auth/login.
| Env var | Required | Description |
|---|---|---|
PEAR_JWT | yes | Pre-minted access token. Used directly when set. PEAR_API_KEY and PEAR_ADDRESS act as fallback if the JWT expires and no PEAR_REFRESH_TOKEN is configured. |
PEAR_REFRESH_TOKEN | no | If set, mcp-pear refreshes the JWT itself when it expires mid-session (each refresh rotates the token). Without it, the orchestrator has to re-mint and respawn the subprocess. |
When PEAR_JWT expires and no refresh token is set, authenticated tools return:
JWT expired; the orchestrator must mint a new one and restart mcp-pear.
See examples/telegram-bot-usage.ts for the orchestrator pattern.
| Env var | Required | Description |
|---|---|---|
PEAR_API_KEY | for auth tools | Your Pear API key. |
PEAR_ADDRESS | for auth tools | Wallet address bound to the API key (0x...). |
mcp-pear mints the JWT itself by calling POST /auth/login. Both fields are required: the OpenAPI spec needs address in the request body.
The four public tools work without any auth env vars. Authenticated tools return a ConfigError naming the missing env var.
| Env var | Default | Description |
|---|---|---|
PEAR_API_BASE_URL | https://hl-v2.pearprotocol.io | Pear API host. |
PEAR_API_TIMEOUT_MS | 10000 | Per-request timeout. |
PEAR_CLIENT_ID | APITRADER | Client identifier sent to /auth/login. |
Add to claude_desktop_config.json:
Restart Claude Desktop and ask: "Use Pear to show me the top active markets right now."
Full example in examples/adk-ts-usage.ts.
adjust_leverageChange leverage (1-100x) on an existing Pear Protocol position. Higher leverage means greater liquidation risk for the same price move. WRITE: changes risk profile of a live position. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
positionId | string | yes | |
leverage | integer | yes |
adjust_positionReduce or increase an existing Pear Protocol position's size by 1-100 percent. executionType: MARKET (immediate) or LIMIT (provide limitRatio). WRITE: changes exposure on a real trade. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
positionId | string | yes | |
adjustmentType | string | yes | |
adjustmentSize | integer | yes | |
executionType | string | yes | |
limitRatio | number | ||
referralCode | string |
cancel_orderCancel a pending Pear Protocol limit, take-profit, or stop-loss order by orderId. Does not affect already-filled portions. For TWAP orders, use cancel_twap_order. WRITE: cancels a live order. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | string | yes |
cancel_twap_orderCancel a Pear Protocol TWAP (time-weighted average price) order and all of its remaining unfilled chunks. WRITE: cancels a live order. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | string | yes |
close_all_positionsClose every open Pear Protocol position with a single executionType (MARKET or TWAP). Returns a per-position result array with success/error. WRITE: executes real trades. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
executionType | string | yes | |
twapDuration | number | ||
twapIntervalSeconds | number | ||
randomizeExecution | boolean | ||
referralCode | string |
close_positionClose one open Pear Protocol position by positionId. executionType: MARKET (immediate) or TWAP (spread over time; requires twapDuration in seconds). WRITE: executes a real trade. Requires PEAR_TRADE_ENABLED=true.
| Parameter | Type | Required | Description |
|---|---|---|---|
positionId | string | yes | |
executionType | string | yes | |
twapDuration | number | ||
twapIntervalSeconds | number | ||
randomizeExecution | boolean | ||
referralCode | string |
create_agent_walletCreate a new Pear Protocol agent wallet for the authenticated user. The agent wallet is what Pear uses to sign Hyperliquid trades. After creation, the user MUST approve this wallet on Hyperliquid (the response message contains the approval instructions). WRITE: executes a state change. Requires PEAR_TRADE_ENABLED=true.
No parameters
get_account_summaryGet the authenticated user's Pear Protocol account summary: agent wallet address, total closed trades, pending trigger-order USD value, pending TWAP-chunk USD value, and last sync timestamp. Requires PEAR_API_KEY.
No parameters
get_active_marketsGet the most active Pear Protocol pair markets right now: current active pairs plus top gainers, top losers, highlighted pairs, and the user's watchlist. Use to see what's hot or as a starting point for narrowing into a specific pair.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-pear)<a href="https://allmcps.com/mcp/mcp-pear"><img src="https://allmcps.com/api/badge/mcp-pear?style=directory" alt="MCP Pear on AllMCPs" /></a>