Skip to main content
Glama
stocklayerdev

Stocklayer MCP

Official

Stocklayer MCP

Put the stock market in your app. Stocklayer is the trading API for tokenized stocks on Robinhood Chain, with market tools for AI agents.

The official MCP server gives Claude, Cursor, and other MCP clients the tools to find Stock Tokens, get quotes, and prepare policy-checked trades. Your agent gets an explainable verdict and unsigned transactions. Your wallet signs.

Documentation · OpenAPI · npm · Support

Connect @stocklayer/mcp when you want an AI agent to:

  • discover official Stock Token contracts and reference prices;

  • read Robinhood Chain wallet balances;

  • quote an exact budget or token quantity;

  • build and retrieve durable, policy-checked trade plans; or

  • simulate an ordered transaction sequence before a wallet signs.

Install

npm install -g @stocklayer/mcp

Or let your MCP client run the current package with npx:

{
  "mcpServers": {
    "stocklayer": {
      "command": "npx",
      "args": ["-y", "@stocklayer/mcp"],
      "env": {
        "STOCKLAYER_PROJECT_KEY": "stocklayer_test_..."
      }
    }
  }
}

No global installation is required when your client uses the npx configuration.

Related MCP server: r0x-os

Configuration

  • STOCKLAYER_PROJECT_KEY is required. Use a scoped stocklayer_test_ or stocklayer_live_ project key.

  • STOCKLAYER_BASE_URL is optional and defaults to https://stocklayer.dev/api/v0.

Start with a test key from the dashboard. Its calls use Stocklayer's deterministic sandbox, need no funded wallet or provider credential, and move no funds. Keep the project key in your MCP client's environment configuration.

The package runs locally over stdio and delegates every operation to @stocklayer/sdk. It targets API v0, uses the same project scopes and policies as HTTP, and never accepts signing material.

Try a sandbox trade

Ask your agent:

Use Stocklayer to prepare an exact-input trade of 500 USDG for NVDA with wallet 0x0000000000000000000000000000000000000001. Show the verdict, checks, and unsigned transactions.

The agent calls stocklayer_preflight_trade with:

{
  "wallet": "0x0000000000000000000000000000000000000001",
  "intent": {
    "type": "exact_input",
    "tokenIn": "USDG",
    "tokenOut": "NVDA",
    "amountIn": "500"
  }
}

allow returns a ready plan. warn returns review_required with transactions for human review. block returns no signable transactions. Inspect verdict and signing.unsignedTransactions in the result.

Tools

Tool

Operation

Required scope

stocklayer_get_asset

Resolve a Stock Token or supported system token

market:read

stocklayer_get_price

Read underlying and multiplier-adjusted reference prices

market:read

stocklayer_get_corporate_actions

Read and filter corporate actions

market:read

stocklayer_get_portfolio

Read wallet balances, optionally for up to 20 symbols

portfolio:read

stocklayer_create_quote

Find an exact-input or exact-output route quote

trade:plan

stocklayer_preflight_trade

Build, check, simulate, and persist a trade plan

trade:plan

stocklayer_get_trade_plan

Retrieve a plan in the current project environment

trade:plan

stocklayer_simulate_transactions

Simulate one to eight unsigned transactions

transaction:simulate

Successful quotes, new plans, and simulations use one checked-action unit. Reads and plan replays use no checked-action units; authenticated request limits still apply. The public launch is free.

For exact output, use intent.type: "exact_output" with amountOut. Slippage is a percentage from 0.01 to 5, in 0.01% increments. Preflight accepts an optional idempotencyKey of 16–128 URL-safe characters; reuse it only for the same intent. Simulation accepts gasLimit, gasPrice, maxFeePerGas, and maxPriorityFeePerGas as decimal or hexadecimal quantity strings, matching the HTTP API.

Migrating from RailX

Stocklayer starts a fresh package sequence at 0.1.0. Use stocklayer_* tools, STOCKLAYER_PROJECT_KEY, and a newly issued Stocklayer project key. RailX keys and saved railx_* tool calls do not migrate automatically. The HTTP route remains /api/v0.

Requirements

License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    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
    5 npm
    MIT
  • A
    license
    A
    quality
    F
    maintenance
    Enables AI agents to interact with Robinhood Chain via USDG payments, offering tools for balance, pricing, trading, and more.
    18
    58
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to read Robinhood Chain stock-token positions, quote swaps, and execute swaps through the Model Context Protocol, bridging on-chain assets that Robinhood's own off-chain MCP cannot reach.
    4
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to trade tokenized stocks (e.g., NVDA, TSLA) on Robinhood Chain via MCP, with non-custodial keys and spending caps.
    8 npm
    MIT