Capstan MCP
OfficialSupports Lighter's Robinhood Chain deployment and Capstan's on-chain contracts on Robinhood Chain mainnet/testnet, including receipt anchoring and CPST lock/token deployments.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Capstan
Capstan is a non-custodial multi-venue perps API, TypeScript SDK and MCP server. It covers Hyperliquid (core and
HIP-3 markets), Lighter (mainnet and the Robinhood Chain deployment) and Aster, with Variational and Arcus as
read-only data feeds. Three small contracts run on Robinhood Chain (mainnet 4663, testnet 46630).
Capstan never holds user keys or funds, and no venue authorization asks for withdrawals. Orders are built server-side, checked and signed on the user's own device by the SDK, then relayed or sent directly to the venue. Every routed action gets a signed receipt, and hourly Merkle roots of the receipts are anchored on-chain. Collateral stays on each venue: there is no cross-venue margin.
Status: pre-release. No contract is deployed yet and the code has not had an external audit.
Layout
apps/
api/ REST + tRPC router, x402 middleware, eligibility edge (Hono)
ws/ WebSocket gateway (market, account and plan streams)
relay/ signed-payload verifier and venue submitter
mcp/ MCP server (Streamable HTTP)
workers/ BullMQ processors (ingest, funding, risk, reconcile, anchor)
facilitator/ self-hosted x402 facilitator
packages/
schema/ canonical types, zod validators, constants, database schema
core/ config, database and migrations, queues, cache, service signer, signed messages, logger
adapters/ hyperliquid, lighter, aster, variational (read-only), arcus (read-only)
signers/ hl, lighter-wasm, aster
sdk/ client-side key generation, payload checks, signing, plan executor
eligibility/ geo matrix and decision engine
receipts/ JCS canonicalisation, signing, Merkle trees, proofs
catalog/ canonical-asset map and equivalence records
x402/ client and server helpers (Permit2 + EIP-3009)
policy/ agent policy typed data, shared policy check, kill switch, revocation bundles
quote/ quote engine: best-venue routing, staleness and depeg guards, funding forecast
risk/ per-venue account snapshots, exposure, liquidation ladders under a fixed banner
spreads/ funding-rate spread scanner, planner and client-side executor
tiers/ plans and tiers: free, pay-as-you-go, pro credits, CPST lock tiers
telemetry/ traces, Prometheus metrics, log redaction, ops alerts
venue-client/ shared venue HTTP and WebSocket client, per-egress budget governor
contracts/ Foundry: CapstanReceiptAnchor, CPSTLock, CPST
web/ website and dashboard (Vite, its own install and tests: `cd web && bun run test`)
ops/ CI checks, deploy scripts, server scripts, dashboards, alerts, runbooksContracts (contracts/src)
Contract | What it does |
| Write-once hourly Merkle roots of receipts; only the immutable poster may post; proof verification helper |
| Locks CPST for API tiers; unlock always works after the chosen duration (0, 30 or 90 days) |
| Fixed-supply ERC-20 |
Non-upgradeable, no pause, no admin beyond what each contract states. Interfaces are in src/interfaces.
Vendored: forge-std v1.17.0.
Deployments
Generated from contracts/deployments/<chainId>.json by bun ops/ci/gen-deployments.ts; CI fails if it differs.
Chain | Contract | Address | Sourcify |
Robinhood Chain ( |
|
| |
Robinhood Chain ( |
|
| |
Robinhood Chain ( |
|
| |
Robinhood Chain testnet ( |
|
| |
Robinhood Chain testnet ( |
|
| |
Robinhood Chain testnet ( |
|
|
Services
Service | Entry | What it does |
API |
| REST + tRPC, quotes, order builds, x402, eligibility |
WS |
| Market, funding, account and plan streams |
Relay |
| Verifies signed envelopes, policy and eligibility re-check, venue submit |
MCP |
| MCP tools that mirror the REST API; no tool accepts a key |
Workers |
| Ingest, funding forecast, risk, receipts, anchoring, reconciliation |
Facilitator |
| x402 verify and settle |
Related MCP server: PredMCP
Requirements
Bun 1.4.4+
Foundry 1.8.4 (solc 0.8.28 is set in
contracts/foundry.toml)Docker (local Postgres 16 + TimescaleDB on port 55432, Redis 7 on port 56379; both ports configurable)
Commands
bun install
bunx tsc --noEmit # typecheck every workspace
docker compose up -d --wait # local Postgres + Redis (CAPSTAN_PG_PORT / CAPSTAN_REDIS_PORT move the ports)
bun run db:migrate # apply migrations (DATABASE_URL); `bun run db:migrate:down` reverts them
bun test # unit tests + CI invariant checks (database tests skip without DATABASE_URL / REDIS_URL)
bun run check # typecheck, tests, key identifiers, banned words, pins, deployments, vectors, public guard
cd contracts && forge build && forge testNew API routes, worker jobs and catalog sources are drop-in files, found by a glob scan at boot:
apps/api/src/routes/<area>.routes.ts (exports routes, each with its auth declared), apps/workers/src/jobs/<name>.job.ts
(exports job) and apps/workers/src/jobs/catalog-sources/<venue>.source.ts (exports source).
Configuration
All config comes from environment variables. .env.example lists every variable with a safe local default.
Variable | Default | Notes |
|
|
|
|
| Listen ports |
|
| Local compose database |
|
| Local compose Redis |
| empty (all) | Comma list; an unknown name stops the worker at boot |
|
|
|
|
| Broadcasting stays off until set |
|
| Public RPC |
Each service validates only its own variables at boot and names any missing one (never a value). Variables named
like a raw key are refused. Never commit .env files or keys; .gitignore refuses them.
API routes
All routes are under /v1 and are defined in apps/api/src/routes/<area>.routes.ts. The OpenAPI document is served at
/openapi.json.
Area | Routes |
Health and meta |
|
Markets |
|
Quotes |
|
Orders |
|
Positions and risk |
|
Receipts |
|
Onboarding |
|
Agents |
|
Spreads |
|
Account |
|
Eligibility |
|
Verify a receipt
GET /v1/receipts/:id/proof returns the hour's Merkle proof and root once that root is anchored (anchored says whether it is on chain yet). GET /v1/receipts/:id/verify
runs the full public check (signature, leaf and proof). The website has a verify page for it.
Deploy the contracts from a fresh clone
The deploy is owner-run and goes in one order: CPST (whole supply to the brand Safe), then CPSTLock, then CapstanReceiptAnchor. Every stage reads the chain first and skips what is already done, so a second run only prints skip lines. Nothing here asks for a key in plain text: the deployer is a Foundry keystore and Foundry asks for its password at a hidden prompt.
git clone <this repo> capstan && cd capstan
bun install
cd contracts && forge build && forge test && cd ..
# 1. local rehearsal on anvil (chain 31337, throwaway keystores under out/deploy-local/, nothing leaves the machine)
anvil --port 21445 --silent &
EXPECTED_CHAIN_ID=31337 bash ops/deploy/deploy-rhc.sh local
bash ops/deploy/post-deploy-check.sh local
# 2. fork dry run against Robinhood Chain mainnet state: measures the gas the deployer needs, sends nothing
(cd contracts && RHC_RPC_URL=https://rpc.mainnet.chain.robinhood.com forge test --match-path test/fork/DeployFork.t.sol -vv)
# 3. testnet 46630 (keystore account "capstan-deployer", a real Safe as BRAND_SAFE)
POSTER_ADDRESS=<anchor poster> BRAND_SAFE=<Safe address> bash ops/deploy/deploy-rhc.sh testnet
bash ops/deploy/post-deploy-check.sh testnet
# 4. mainnet 4663, only on the day of the go (the guard refuses any other date string)
CAPSTAN_MAINNET_GO=go-$(date -u +%Y-%m-%d) POSTER_ADDRESS=<anchor poster> BRAND_SAFE=<Safe address> \
bash ops/deploy/deploy-rhc.sh mainnet
bash ops/deploy/post-deploy-check.sh mainnetdeploy-rhc.sh writes contracts/deployments/<chainId>.json; commit it with the copies bun run gen:deployments
regenerates (CI fails when they differ). post-deploy-check.sh is read-only: code at every address, runtime code equal
to a fresh build, poster() and token() equal to the deployment file, the reviewed selector set, the chain id and the
Sourcify status. The BRAND_SAFE check requires Safe 1.4.1, threshold 2 or more, no modules and no guard.
When something breaks after a deploy, see ops/runbooks/ (incident and relay stop).
Checks
CI (.github/workflows/ci.yml) runs the typecheck, the pin check (exact dependencies, actions by sha, images by
digest), the migrations against Postgres + TimescaleDB, bun test, a coverage gate (70% of lines in packages/),
forge fmt --check, forge build --sizes, forge test (4,096 fuzz runs), a NatSpec check, slither, semgrep with a
local ruleset, gitleaks, and the web package (its own frozen install, build with the dist check, tests and copy
check). .github/workflows/invariants.yml runs the key-identifier rule
(ops/ci/check-key-identifiers.ts), the banned-word list (ops/ci/check-banned-words.ts), the deployment-file and
vector-file checks and the public guard. The fast checks also run in the pre-commit hook
(git config core.hooksPath .githooks).
Website
The web/ folder is the Capstan website and dashboard at https://get-capstan.com. It is a static Vite build with its own
install and tests, deployed on Vercel (web/vercel.json). See web/README.md for its layout.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-call tools for AI agents, paid in USDC on Base or Solana. Web search, page and PDF reading, crypto news, Hyperliquid perps, market pulse, Chainlink price history, token checks, SEC filings, weather and more. Free calls every day, and a failed call costs nothing. Works with Tollkit Wallet.
Warden MCP lets AI agents find tokens, quote swaps and trade onchain on Base, BNB Chain, Robinhood Chain, Arc and Solana, within limits you set. Market tools need no credential: list_chains, search_tokens, trending_tokens, price_history, quote_swap and swap_status. Search by name, ticker or contract address, read USD price candles, and price a swap before committing to it, including cross-chain swaps. Wallet tools act for the wallet whose owner connected the agent, by OAuth sign-in or a wk_ key. agent_permissions shows what the agent may do and its daily limits. prepare_swap builds a trade and hands the owner a review link to sign. With request_session the owner turns on hands-free trading in one tap, and execute_swap then trades within the limits they set. swap_status tracks gasless and cross-chain trades. get_wallet shows holdings on every chain. Gasless trading is available on Base, BNB Chain and Robinhood Chain. Built by Warden Protocol, the team behind Warden Token Terminal.
17 pay-per-call web, finance, legal and onchain tools for AI agents. USDC on Base via x402/MPP.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to trade leveraged perpetual futures on Solana's Jupiter Perpetuals while providing tools for market data and technical analysis. It supports portfolio management, fee estimation, and automated position execution for SOL, ETH, and BTC using USDC collateral.132MIT

PredMCPofficial
AlicenseNot gradedqualityDmaintenanceSafe, read-only market data for AI trading agents, offering 44 tools to query prediction markets, perpetuals, and cross-venue signals without the ability to execute trades.1MIT- AlicenseBqualityBmaintenanceExposes 17 read-only tools from six XRPL-Utilities services so AI agents can access XRPL wallet analysis, signal feeds, macro telemetry, permissioned asset stacks, RWA tracking, and ETF flow data.41176 npmMIT
- AlicenseAqualityBmaintenanceProvides AI agents read-only, keyless access to Hyperliquid market data, funding rates, account risk, and HyperEVM token transfers through MCP tools, with caching and rate limiting to protect upstream APIs.1239 PyPI1MIT