MCP Server

MCP server for Pear Protocol: markets, positions, orders, portfolio, and gated trade execution.

Local serverstdio

What is the MCP MCP server?

Most developer tooling work still happens through a UI a human drives. MCP MCP server moves it into the conversation instead. MCP server for Pear Protocol: markets, positions, orders, portfolio, and gated trade execution.

The short version

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.

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.

The tools it exposes

The server publishes 14 tools. What each one is for:

  • get_health — API health and uptime
  • list_markets — browse pair markets with filters and pagination
  • get_active_markets — top gainers, losers, and highlighted pairs
  • get_pair_ratio — current ratio, 24h change, and funding for a specific pair
  • get_account_summary — your account header
  • get_open_positions — your open positions with PnL
  • get_open_orders — your open limit, TP, and SL orders
  • get_twap_orders — your active TWAP orders
  • get_trade_history — your closed trades with realized PnL
  • get_portfolio — bucketed PnL across 1d, 1w, 1m, 1y, and all-time
  • get_agent_wallet — the agent wallet Pear uses to sign your trades
  • create_agent_wallet — create the agent wallet

What it needs from you

Configuration is passed through the environment: PEAR_API_KEY, PEAR_ADDRESS, PEAR_REFRESH_TOKEN, PEAR_API_BASE_URL, PEAR_CLIENT_ID. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

The server ships on npm as @marvelcodes/mcp-pear, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MCP's toolset — get_health, list_markets, get_active_markets and 11 more — is a fair guide to whether it matches your workflow. It is maintained by MarvelNwachukwu; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
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
get_open_ordersyour open limit, TP, and SL orders
get_twap_ordersyour active TWAP orders
get_trade_historyyour closed trades with realized PnL
get_portfoliobucketed PnL across 1d, 1w, 1m, 1y, and all-time
get_agent_walletthe agent wallet Pear uses to sign your trades
create_agent_walletcreate the agent wallet
set_risk_parametersset or update TP and SL
PEAR_API_KEYfor auth tools

How to install the MCP MCP server

{
  "mcpServers": {
    "pear": {
      "command": "npx",
      "args": ["-y", "@marvelcodes/mcp-pear@latest"],
      "env": {
        "PEAR_API_KEY": "your-pear-api-key-here",
        "PEAR_ADDRESS": "0xYourWalletAddress"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
PEAR_API_KEYCredential the server authenticates with.Yes
PEAR_ADDRESSConfiguration value read at startup.Optional
PEAR_REFRESH_TOKENCredential the server authenticates with.Yes
PEAR_API_BASE_URLEndpoint or connection string the server talks to.Yes
PEAR_CLIENT_IDConfiguration value read at startup.Optional

Example prompts to try

  • Use MCP to get health.
  • Use MCP to list markets.
  • Use MCP to get active markets.

Frequently asked questions

It connects MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (get_health, list_markets, get_active_markets, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP directly.