Skip to main content
Glama
@hashpower/mcp

@hashpower/mcp

Official

@hashpower/mcp

Knowledge base and simulator for agents building Hashpower trading bots. Not a trading API. This server never holds keys, never broadcasts transactions, and is never in the production trade path.

The permissionless API is the contracts on Base plus the public subgraphs. This MCP server teaches an agent those rules, lets it scan the same live market a human reads on the trading UI, and lets it simulate - then the agent writes its own bot against @hashpower/*-abi. Execution never goes through this server.

Instruction manual (setup, guardrails, tools, units, how to execute locally): docs/agent-manual.md. Hosted for agents at dev.hashpower.io/build/mcp.md (testnet) and hashpower.io/build/mcp.md (mainnet; site build rewrites client key and URLs).

Connect

Hosted testnet - Cursor key dev-hashpower (reserves hashpower for production):

{
  "mcpServers": {
    "dev-hashpower": {
      "url": "https://mcp.dev.hashpower.io/mcp"
    }
  }
}

Hosted mainnet (when LMN is live):

{
  "mcpServers": {
    "hashpower": {
      "url": "https://mcp.hashpower.io/mcp"
    }
  }
}

Same image, HASHPOWER_ENV flipped by the deploy workflow. initialize.serverInfo.name is dev-hashpower on testnet and hashpower on mainnet.

Local stdio (agent brings its own RPC):

{
  "mcpServers": {
    "dev-hashpower": {
      "command": "npx",
      "args": ["-y", "@hashpower/mcp"],
      "env": {
        "HASHPOWER_ENV": "testnet"
      }
    }
  }
}

Until the first npm publish, npx -y github:Lumerin-protocol/hashpower-mcp#dev works the same way.

Optional env:

Variable

Default (testnet)

Meaning

HASHPOWER_ENV

testnet

testnet (Base Sepolia) or mainnet

HASHPOWER_RPC_URL

https://sepolia.base.org

Ethereum JSON-RPC

HASHPOWER_DOCS_URL

https://dev.hashpower.io

Semantics source (/semantics/*)

HASHPOWER_TRANSPORT

stdio

stdio or http

PORT

8080

HTTP bind port

Prerequisite for any real trade: the bot wallet holds Base ETH (gas) and USDC (collateral). Deposit to CollateralVault first.

Related MCP server: QuantRisk

Tools

See the instruction manual for the full catalog, units, and operating loop. Short list:

Knowledge: get_deployments, get_market_rules, get_margin_model, get_units_and_scaling

Read: get_market_snapshot, get_hashprice, get_orderbook, get_trades, get_funding, get_expirations, get_market_stats, get_oracle_history, get_positions, get_margin_status

Simulate: simulate_order, check_can_place_order

Scaffold (prototype only): build_deposit_tx, build_order_tx - unsigned calldata. Production bots encode via the npm packages.

Local dev

pnpm install
pnpm check
pnpm test
pnpm build
pnpm start
HASHPOWER_TRANSPORT=http pnpm start:http

Hosted HTTP is stateless: no MCP session, no ALB stickiness. Any Fargate task can serve any request.

What this is not

  • Not a wallet manager

  • Not a hosted order router

  • Not an API-key product

  • Not in the runtime path of a production bot

Available Tools

12 tools
build_deposit_txScaffold deposit calldataA

PROTOTYPE ONLY. Returns unsigned approve+deposit calldata. Simulate, then sign locally. Not for production bots.

Inputs: amount (required).

build_order_txScaffold createOrder calldataA

PROTOTYPE ONLY. Returns unsigned createOrder calldata. Run simulate_order and check_can_place_order first. Production bots encode via the npm ABI packages.

Inputs: price (required), venue (required), quantity (required), timeInForce, +1 more.

check_can_place_orderCheck canPlaceOrderB

PortfolioMarginEngine.canPlaceOrder(wallet, additionalIM) — the pre-trade gate. additionalIM is integer token units (USDC 6 decimals).

Inputs: wallet (required), additionalIm (required).

get_deploymentsGet deploymentsA

Return contract addresses, subgraph URLs, chain ID, and published @hashpower/*-abi package versions for the configured environment (testnet or mainnet).

Inputs: no named parameters.

get_hashpriceGet hashpriceA

Read the on-chain hashprice oracle via AggregatorV3 latestRoundData().

Inputs: pair.

get_margin_modelGet margin modelB

Portfolio margin / IM / MM / liquidation rules for perps and futures.

Inputs: no named parameters.

get_margin_statusGet margin statusB

Vault balance, portfolio IM/MM, and isHealthy for a wallet (eth_call).

Inputs: wallet (required).

get_market_rulesGet market rulesA

Agent-facing market semantics from hashpower.io /semantics (same source as GitBook). Omit slug to list the catalog; pass a slug such as futures-margin or perps-trading to fetch the markdown.

Inputs: slug.

get_orderbookGet order bookA

On-chain CLOB prices. For futures, expirationAt (unix seconds) is required. Perps is a single perpetual book.

Inputs: venue (required), maxLevels, expirationAt.

get_positionsGet positions and open ordersC

Open positions and resting orders for a wallet from the public subgraphs. Wallet is a parameter — this server has no session.

Inputs: wallet (required), venue.

get_units_and_scalingGet units and scalingC

Oracle decimals, futures contract unit/ticks, and perps QUANTITY_DECIMALS / order scaling.

Inputs: no named parameters.

simulate_orderSimulate orderA

On-chain simulateOrder view: would this price/qty fill, at what average? Positive qty = buy, negative = sell. Does not place an order.

Inputs: price (required), venue (required), quantity (required), expirationAt.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct resource or action: market rules, margin model, units/scaling, and deployments are clearly separated, while check_can_place_order, simulate_order, and build_order_tx form a clear pre-trade pipeline. There is no meaningful overlap that would cause an agent to select the wrong tool.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern: read-only operations use get_, and simulation/build operations use descriptive verbs. The naming style is uniform and predictable across the entire toolset.

    Tool Count5/5

    12 tools is a well-scoped count for a trading-domain MCP server. Each tool covers a distinct aspect—market data, account state, margin checks, simulation, and transaction building—without redundancy or bloat.

    Completeness4/5

    The toolset covers the core domain well: market semantics, live data, positions, margin status, order pre-flight checks, and unsigned transaction building. Obvious lifecycle operations like cancel or withdraw are not exposed, but the explicit prototype-only and external-encoding caveats make this a minor gap rather than a severe one.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to trade crypto with paper money, access market data, view leaderboards, and manage trading bots via an MCP-compatible interface.
      16
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Enables agents to generate alpha signals, retrieve market snapshots, compute portfolio risk, validate and submit paper orders, and trigger a kill switch, all under deterministic pre-trade risk controls and audit logging.
      5
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides a safe paper-trading twin of the Binance Agent OS MCP API so agents can be rehearsed, scored, gated for go-live, and shadow-compared against live calls without using real funds.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to paper-trade on Polymarket against live order books with realistic fees and fill mechanics, including market search, portfolio tracking, and strategy backtesting.
      33
      157 PyPI
      509
      MIT