Skip to main content
Glama
Sandcastle MCP

Sandcastle MCP

by Gnome101

Sandcastle MCP

A read-only Model Context Protocol server for Sandcastle leveraged liquidity positions.

It gives MCP clients structured access to curated Sandcastle deployments, live Uniswap V3 and Morpho market state, owner position health, and concentrated-liquidity payoff simulation on Robinhood Chain.

Tools

Tool

What it returns

list_markets

Curated markets, tokens, pools, factories, oracles, LLTVs, and market IDs

get_market

Live pool price/liquidity and stored Morpho supply, borrow, and utilization

get_positions

Active Position Accounts for an owner, with NFT inventory, debt, equity, leverage, and oracle-based health

simulate_payoff

LP value, debt value, equity, PnL, and return on equity across terminal prices

The server also exposes sandcastle://deployments/robinhood as a static MCP resource.

Related MCP server: TRENCH MCP

Safety boundary

This server cannot sign or submit transactions. It contains no wallet, private-key, approval, swap, borrow, repay, rebalance, or liquidation methods. Its network activity is limited to JSON-RPC reads and a public GraphQL index.

The USD figures and payoff curves are estimates:

  • USDG is treated as $1.

  • Token USD prices use current configured pool spot prices.

  • Morpho totals are the values stored at the market's last update.

  • Payoff simulation excludes fees, interest, rewards, slippage, gas, and liquidation penalties.

Do not use the outputs as executable quotes or transaction parameters.

Requirements

  • Node.js 20 or newer

  • npm

Install and build

git clone https://github.com/Gnome101/sandcastle-mcp.git
cd sandcastle-mcp
npm install
npm run build

The default public RPC and public Sandcastle subgraph work without credentials. You can override either endpoint:

export ROBINHOOD_RPC_URL=https://your-robinhood-chain-rpc.example
export SANDCASTLE_SUBGRAPH_URL=https://your-subgraph.example/graphql

Connect from Codex

Add this to ~/.codex/config.toml, replacing the path with the absolute path to your clone:

[mcp_servers.sandcastle]
command = "node"
args = ["/absolute/path/to/sandcastle-mcp/dist/src/index.js"]

To pass a private RPC through the MCP process:

[mcp_servers.sandcastle]
command = "node"
args = ["/absolute/path/to/sandcastle-mcp/dist/src/index.js"]
env_vars = ["ROBINHOOD_RPC_URL"]

Restart Codex after changing the configuration.

Connect from Claude Desktop

Add the server under mcpServers in Claude Desktop's configuration:

{
  "mcpServers": {
    "sandcastle": {
      "command": "node",
      "args": ["/absolute/path/to/sandcastle-mcp/dist/src/index.js"]
    }
  }
}

Development

npm run typecheck
npm test
npm run smoke

npm test exercises the math and the actual MCP tool protocol through linked in-memory client/server transports. npm run smoke reads the primary WETH/USDG pool and Morpho market from Robinhood Chain.

To inspect the server interactively:

npx @modelcontextprotocol/inspector --web node dist/src/index.js

Current scope

The initial release covers the seven curated Uniswap V3 markets currently configured by Sandcastle on Robinhood Chain (chain ID 4663). Uniswap V4 and transaction execution are outside this release.

License

MIT

Available Tools

4 tools
get_marketGet live Sandcastle market stateA
Read-onlyIdempotent

Read a Sandcastle market, its Uniswap V3 pool, and stored Morpho totals from Robinhood Chain. Accepts a market id, pool address, or Morpho market id.

Inputs: market (required).

get_positionsGet Sandcastle positions for an ownerA
Read-onlyIdempotent

Discover an owner’s Position Accounts through the Sandcastle subgraph, then read active NFT, pool, Morpho debt, oracle collateral value, equity, leverage, and health from chain.

Inputs: owner (required).

list_marketsList Sandcastle marketsA
Read-onlyIdempotent

List the curated Sandcastle leveraged-liquidity markets and their deployment addresses.

Inputs: no named parameters.

simulate_payoffSimulate a leveraged LP payoff curveB
Read-onlyIdempotent

Project equity and return on equity for a concentrated-liquidity position across terminal prices. Quote debt stays fixed in USD; base debt changes with the base price.

Inputs: leverage (required), debtAsset (required), spotPrice (required), depositUsd (required), +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: listing markets, reading a specific market's details, discovering and reading positions, and simulating payoff scenarios. No overlaps in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (list_markets, get_market, get_positions, simulate_payoff) with clear, predictable verbs and nouns.

    Tool Count4/5

    With 4 tools, the server is well-scoped for its purpose of reading markets and positions and simulating outcomes. Slightly lean but each tool is substantial.

    Completeness4/5

    The tools cover the main read paths and a simulation, but lack actions like creating positions or managing them. Given the read-focused nature, this is a minor gap.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      A zero-config data server for read-only queries on Robinhood Chain (stock tokens, memecoins, launches, chain stats) and an opt-in trading server with spend caps and confirm gates for executing swaps and transfers.
      9
      66 npm
      8
      -
    • A
      license
      A
      quality
      B
      maintenance
      Provides read-only Robinhood Chain market intelligence so AI agents can inspect token liquidity, simulate and compare size-aware exit pressure against observed pool depth, and explain the resulting grades with evidence and limits.
      5
      12
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables read-only querying of orbital launch and space-sector data plus testnet event-market listings, order books, midpoint prices, and cancel-safety checks on Base Sepolia. It does not place, cancel, or claim orders, and it never resolves markets.
      12
      302 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Robinhood Chain trading agents to obtain quotes, policy-checked unsigned public-swap calldata, simulations, hook information, prices, and deployment discovery without holding keys or signing transactions.
      9
      MIT