Starkscan ExplorerStarkscanDocs
QuickstartBuildAgentsReference
Open explorer
Documentation homeQuickstartAuthenticationBase URLs and chainsConceptsGet your first API keyMonitor 10 WalletsPagination and cursorsRead a transactionYour first error
BuildLaunch MatrixPackage TrustAPIAdvanced UtilitiesAgent HTTP quickstartMigration skillsRate limitsRoute CertificationRoute examplesSelf-serve account routesSDKTypeScript SDK

Live reference

Interactive API referenceReference hub
AgentsAgent CLIBuild an agentConnect your agentMCP QuickstartMCP tools reference
Reference Hub
Docs/Agents/MCP Quickstart

MCP Quickstart

Connect Starkscan to Codex, Claude Code, and similar MCP clients without losing the app and API context.

API referenceReferenceQuickstartCLI

In this guide

Use this surface forCurrent labelsTry in app firstCurrent external setupEnvironmentCodex setup
Loading documentation content…
PreviousConnect your agentAdd the hosted Starkscan MCP server to Claude, Cursor, Claude Desktop, Cline, VS Code, or Codex.NextMCP tools referenceThe full Starkscan MCP tool catalog — one bootstrap tool plus 17 read-only route tools, with inputs and the REST route each maps to.

On this page

Use this surface forCurrent labelsTry in app firstCurrent external setupEnvironmentCodex setupCommon agent mistakesClaude Code setupHosted MCP transportSmoke-test the remote MCP pathWhen not to start with MCP
Starkscan ExplorerStarkscanDocumentation

One product surface across the explorer, HTTP API, CLI, SDK, and MCP transport. The docs should guide you into the right path instead of behaving like a separate app.

Open explorerAPI referenceBack to top

MCP quickstart

Use this guide when a tool-calling client needs Starkscan over MCP. Do not start here if a normal service can call HTTP directly or if a human operator is better served by the CLI.

Hosted MCP HTTP is currently beta; the @starkscan/mcp launcher package is alpha. Check the Launch matrix before treating a launcher or hosted transport path as production-ready. For npm package provenance, Socket links, and exact-version pinning rules, use Package trust.

Use this surface for

  • Codex, Claude Code, and other tool-calling clients
  • workflows where an agent needs Starkscan tools instead of raw REST requests
  • reusing the same Starkscan API key surface while keeping rollout access bounded

Current labels

SurfacePublic labelWhat works today
REST core APIcertifiedDirect /v1/{chain}/* REST calls for the certified route set, including timestamp-to-block plus exact token balance for accounting. Use this when a normal service can call HTTP.
TypeScript SDKalphaTyped application code over the same REST contract.
Agent CLIalphaShell workflows and local exports with the same STARKSCAN_* environment variables.
Hosted MCPbeta hosted / alpha launcher/api/mcp is the hosted HTTP beta; @starkscan/mcp@alpha launches the client bridge.

Try in app first

Before you connect an agent, look at the same explorer surfaces on the current host:

  • Dashboard
  • Transactions
  • Contracts
  • Watchlist

That keeps the agent workflow grounded in the same product behavior that Starkscan users actually see.

Current external setup

Today the cleanest setup is:

  1. export the same STARKSCAN_* variables used by REST and CLI
  2. let the AI client launch npx -y @starkscan/mcp@alpha
  3. install the CLI from the Agent CLI guide only when you want lower-level shell commands

Use STARKSCAN_* for new beta clients. Legacy internal env names are accepted only as hidden compatibility aliases during the cutover. tools/list should expose 18 tools total: bootstrap guidance plus 17 route tools.

Environment

export STARKSCAN_BASE_URL="https://<your-starkscan-host>/api"
export STARKSCAN_API_KEY="<set in your local shell or agent secret store>"
export STARKSCAN_CHAIN="SN_MAIN"

Print client config locally before wiring an agent. The output contains ${STARKSCAN_API_KEY} placeholders, not secret values:

npx -y @starkscan/mcp@alpha print-config --transport remote

Codex setup

codex mcp add starkscan \
  --env STARKSCAN_BASE_URL=$STARKSCAN_BASE_URL \
  --env STARKSCAN_API_KEY=$STARKSCAN_API_KEY \
  --env STARKSCAN_CHAIN=$STARKSCAN_CHAIN \
  -- npx -y @starkscan/mcp@alpha

Useful starter tools for Starkscan agent workflows:

  • status
  • block_detail
  • block_transactions
  • token_total_supply
  • token_balance_of
  • token_transfers

Common agent mistakes

  • search is identifier-first, not ticker or symbol search, and some responses normalize into canonical padded felt forms.
  • contract_entrypoints is broader than contract_read; for read, prefer selectors with stateMutability=view and pass required calldata.
  • address_token_holdings is the wallet-screening surface. Treat it as complete only when exact=true, truncated=false, and completeness.reasonCode="complete".
  • On very active wallets, separate latest calls to holdings and token_balance_of can drift numerically if the chain moved between requests. Missing a core-token row on a completed holdings response is the stronger bug signal.

Claude Code setup

claude mcp add --scope project --transport stdio \
  --env STARKSCAN_BASE_URL=$STARKSCAN_BASE_URL \
  --env 'STARKSCAN_API_KEY=${STARKSCAN_API_KEY}' \
  --env STARKSCAN_CHAIN=$STARKSCAN_CHAIN \
  starkscan -- npx -y @starkscan/mcp@alpha

Check that Claude Code sees it:

claude mcp list

Hosted MCP transport

Starkscan also exposes a native HTTP MCP endpoint at:

  • {baseUrl}/mcp (for hosted external clients, this resolves to /api/mcp)

This is documented here instead of the REST reference because it is a JSON-RPC transport, not the normal explorer HTTP surface.

Current behavior:

  • POST {baseUrl}/mcp accepts one JSON-RPC message per request
  • inline JSON responses return as application/json
  • notifications and JSON-RPC responses return 202 Accepted
  • GET {baseUrl}/mcp returns 405 Method Not Allowed

Smoke-test the remote MCP path

STARKSCAN_BASE_URL="https://<your-starkscan-host>/api" \
STARKSCAN_API_KEY="$STARKSCAN_API_KEY" \
./rust-exp/scripts/release-mcp-remote-smoke.sh

This exercises a real JSON-RPC session over stdio:

  • initialize
  • notifications/initialized
  • tools/list
  • tools/call for the bootstrap guidance tool
  • tools/call for status
  • tools/call for block_detail

When not to start with MCP

  • Use the REST API for direct service integrations.
  • Use the SDK for typed application code.
  • Use the CLI when you need explicit commands and local exports.
  • Stay in the explorer app when the job is visual investigation rather than tool-calling.