Skip to main content
Glama
Gnome101

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: robinhood-chain-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
marketYesMarket id, pool address, or Morpho market id

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is handled. The description adds useful context that the tool reads three distinct pieces of data (market, pool, and stored Morpho totals) from a specific chain, which is not visible in the annotations alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences deliver all essential information: the first states the operation and resources, the second specifies the accepted input forms. There is no filler or redundancy, and the content is front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter, read-only tool with strong annotations, the description is reasonably complete. It tells the agent what data will be accessed and what the parameter can be, though it does not mention the output structure, which is a minor gap given the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes the single 'market' parameter as 'Market id, pool address, or Morpho market id', with 100% schema description coverage. The description repeats this without adding further meaning, so it earns the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the imperative verb 'Read' and names specific resources: a Sandcastle market, its Uniswap V3 pool, and stored Morpho totals from Robinhood Chain. It clearly differentiates from sibling tools like list_markets by focusing on a single market and by listing multiple identifier forms it accepts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is used when you need state for a single market, but it does not explicitly contrast it with list_markets or get_positions, nor does it explain when to avoid this tool in favor of a sibling. The context is present but not directly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
ownerYesEOA owner address

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are rich: readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds context that it queries both a subgraph and on-chain data, implying a two-step process and potential for network latency, but does not add details like rate limits or failure modes. It also clarifies the scope of data fetched, which is beyond annotations. Since annotations cover safety, this is solid.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, information-dense sentence that front-loads the core purpose and lists all the data returned. No redundant words, and it efficiently communicates what the tool does in one breath.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (two data sources, multiple metrics), the description covers the purpose and data retrieved. It does not explain the return structure, but no output schema exists, so some reliance on the description is warranted. However, for a read-only tool with annotations, this is adequate; missing details like whether it returns zero positions or handles invalid addresses are minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single parameter owner has a description and pattern in the schema. The description adds that 'owner' is an EOA address, which is already in the schema pattern but adds semantic clarity. No further parameter elaboration needed since there is only one param and it is well-specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states what the tool does: it discovers an owner's positions through the Sandcastle subgraph and reads multiple on-chain metrics. This is specific and distinguishes it from siblings like list_markets and get_market, which are about markets, not positions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying the owner input, but does not explicitly state when to use this tool versus alternatives. It does not mention when not to use it or name alternatives. However, given the specificity, an agent can infer it is for owner-specific position retrieval, but no exclusions or alternative conditions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_marketsList Sandcastle marketsA
Read-onlyIdempotent

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered. The description adds that the markets are 'curated' and 'leveraged-liquidity', giving a bit of context on composition, but no mention of response format or pagination. With high annotation coverage, the bar is lower, and the description adds modest value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with the core action 'List markets', and includes the key differentiator 'deployment addresses'. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read-only list tool with annotations covering safety, the description is complete. It tells the agent what it returns (markets and addresses). The only minor gap is not mentioning the response format (e.g., array), but that's often implicit for list tools and no output schema is provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, schema coverage is trivially 100%. The description doesn't need to explain parameters; the baseline for 0 params is 4, and the description appropriately focuses on what the tool returns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists curated markets and their deployment addresses, with a specific verb 'List' and resource 'markets'. It distinguishes itself from sibling tools like get_market (which likely retrieves a single market) and get_positions (which deals with positions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this is the entry point for discovering available markets, but doesn't explicitly state when to use it over others. Since it has no parameters and siblings are named, an agent can infer it's for overview. A brief 'use this to get all markets' would bump to 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
leverageYes
debtAssetYes
spotPriceYesQuote units per base token at entry
depositUsdYes
lowerPriceYes
upperPriceYes
terminalPricesYes
liquidationPriceNo

TDQS

B3.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

It adds meaningful behavioral detail beyond annotations by explaining the quote/base debt treatment. The readOnly and idempotent annotations are consistent and the description clarifies a non-obvious simulation assumption.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise, front-loaded sentences. No redundancy with the title/schema, and the key behavioral distinction about quote vs base debt is included economically.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description lacks essential context for correct use: no output shape, no guidance on how terminalPrices are interpreted, no constraints/edge cases. Given there is no output schema, this leaves significant ambiguity despite the clear core purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is very low (~14%), and the description only clarifies the debt-asset behavior. It does not add meaning for depositUsd, leverage, lowerPrice, upperPrice, terminalPrices, or liquidationPrice beyond their parameter names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Project') and a specific resource (equity/ROE for a concentrated-liquidity position), which clearly conveys the tool's function. It does not distinguish from siblings, but no siblings are listed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context is implied: use this when you need to model a leveraged LP position across terminal prices. However, there is no explicit when-to-use/when-not-to-use guidance or mention of alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv0.1.0
    • First observedget_market
    • First observedget_positions
    • First observedlist_markets
    • First observedsimulate_payoff

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.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    A read-only MCP server exposing Polymarket's public prediction-market data. Search markets, read live odds and order books, pull historical probability time-series, and inspect public wallet positions.
    14
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables agents to query live Robinhood Chain data including tokens, wallets, Chainlink feeds, heat scores, and tracking error on tokenized equities, all read-only without API keys.
    4
    4 npm
    MIT
  • A
    license
    A
    quality
    C
    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
    30 npm
    4
    -
  • A
    license
    C
    quality
    B
    maintenance
    Provides read-only access and unsigned transaction building for the Robinhood Chain Arbitrum Orbit L2, including NFT, ERC-20, stock tokens, oracles, and EIP-3009 tooling.
    100
    16 npm
    MIT