PP

perpbrain/perpbrain-sdk

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

0 stars 0 forks 品質 76 トレンド 14MIT

PERPBRAIN TypeScript SDK, MCP handler, examples, and receipt verifier for Hyperliquid. Read-only and simulation-only.

概要

TypeScript SDK, MCP handler, examples, and receipt verifier for PERPBRAIN: read-only Hyperliquid data, a book simulator, and owner limits for AI agents. Simulation receipts are verified and reproducible: anyone can re-derive a receipt from its inputs and get the same hashes. This repository has no mainnet order path, no exchange keys, and no publish workflow. Simulation output is labelled SIMULATED. It is not advice. The PERPBRAIN hosted service and engine are not in this repository. This repository is the public client surface. Node 22 or later. No API key is needed for anything in this repository. @perpbrain/sdk is 0.1.0-rc1 and marked private, so it is not on npm yet. npm run build writes ESM and CommonJS builds to sdk/dist. Each example runs offline on the files in fixtures/. Check a receipt. VERIFIED means every hash re-derived from the inputs matches. A tampered fixture prints MISMATCH and names the field.

README

以下は原文 README の抜粋です。原文を見る。

PERPBRAIN SDK

TypeScript SDK, MCP handler, examples, and receipt verifier for PERPBRAIN: read-only Hyperliquid data, a book simulator, and owner limits for AI agents. Simulation receipts are verified and reproducible: anyone can re-derive a receipt from its inputs and get the same hashes.

This repository has no mainnet order path, no exchange keys, and no publish workflow. Simulation output is labelled SIMULATED. It is not advice.

The PERPBRAIN hosted service and engine are not in this repository. This repository is the public client surface.

What is here

Path Role
sdk/ @perpbrain/sdk: public info-endpoint reads, the book simulator, owner limits (conservative, standard, pro), the kill-switch latch, execution-cost breakdown, receipt verifier, and the SVG results card.
ts/mcp-server/ MCP JSON-RPC handler and stdio MCP server (perpbrain-mcp) for the read and simulation tools. It does not accept an order tool.
server.json MCP Registry metadata for io.github.PERPBRAIN/perpbrain-sdk (npm, stdio, no secrets). Optional logo path: docs/assets.md.
glama.json Glama listing maintainer file (claim ownership of the Glama listing).
Dockerfile Slim Node image for Glama and other hosts; stdio entrypoint, non-root user.
examples/ Runnable TypeScript examples on recorded public data.
verify/web/ Browser receipt checker (WebCrypto SHA-256), the same check as the PERPBRAIN verify page.
fixtures/ Recorded public info responses and good and tampered receipt fixtures. No keys, no accounts.

Requirements

Node 22+ is required (check with node -v). On Node 20 or older the examples and tests stop with node: bad option: --experimental-strip-types; upgrade Node to fix it. On Node 22 a harmless ExperimentalWarning: Type Stripping line is printed. No API key or other secret is needed for anything in this repository.

Install the MCP server

From a fresh clone:

git clone https://github.com/PERPBRAIN/perpbrain-sdk.git
cd perpbrain-sdk/ts/mcp-server && npm ci
cd ../..
node bin/perpbrain-mcp.mjs

To smoke-test it, pipe an initialize request followed by tools/list into the launcher; it should list the 12 tools below.

The launcher starts the stdio MCP server. Live reads use the public Hyperliquid /info endpoint (mainnet by default). Optional: set PERPBRAIN_HL_NETWORK=testnet for testnet.

Equivalent from the repository root after npm ci in ts/mcp-server/:

node bin/perpbrain-sdk.mjs mcp

To work on the TypeScript SDK itself (not required for MCP-only use):

(cd sdk && npm ci && npm run build)
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "perpbrain": { "command": "node", "args": ["/absolute/path/to/perpbrain-sdk/bin/perpbrain-mcp.mjs"], "env": { "PERPBRAIN_HL_NETWORK": "mainnet" } } } }