MCP Quickstart
Connect Starkscan to Codex, Claude Code, and similar MCP clients without losing the app and API context.
Connect Starkscan to Codex, Claude Code, and similar MCP clients without losing the app and API context.
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.
MCP is currently a beta surface. Check the Launch matrix before treating a launcher or hosted transport path as production-ready.
Before you connect an agent, look at the same explorer surfaces on the current host:
That keeps the agent workflow grounded in the same product behavior that Starkscan users actually see.
Today the cleanest setup is:
MEZCAL_* variables used by REST and CLInpx -y @mezcal/cli@alpha mcp serve --transport remoteThe public product name is Starkscan, but the current CLI command, package names, and MEZCAL_* environment variables remain compatibility names. Do not invent STARKSCAN_* CLI variables unless this page documents them.
export MEZCAL_BASE_URL="https://<your-mezcal-host>/api"
export MEZCAL_API_KEY="mzk_live_your_key_here"
export MEZCAL_CHAIN="SN_MAIN"
codex mcp add mezcal \
--env MEZCAL_BASE_URL=$MEZCAL_BASE_URL \
--env MEZCAL_API_KEY=$MEZCAL_API_KEY \
--env MEZCAL_CHAIN=$MEZCAL_CHAIN \
-- npx -y @mezcal/cli@alpha mcp serve --transport remote
Useful starter tools for Starkscan agent workflows:
statusblock_detailblock_transactionstoken_total_supplytoken_balance_oftoken_transferssearch 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".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 mcp add --scope project --transport stdio \
--env MEZCAL_BASE_URL=$MEZCAL_BASE_URL \
--env 'MEZCAL_API_KEY=${MEZCAL_API_KEY}' \
--env MEZCAL_CHAIN=$MEZCAL_CHAIN \
mezcal -- npx -y @mezcal/cli@alpha mcp serve --transport remote
Check that Claude Code sees it:
claude mcp list
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 requestapplication/json202 AcceptedGET {baseUrl}/mcp returns 405 Method Not AllowedMEZCAL_BASE_URL="https://<your-mezcal-host>/api" \
MEZCAL_API_KEY="$MEZCAL_API_KEY" \
./rust-exp/scripts/release-mcp-remote-smoke.sh
This exercises a real JSON-RPC session over stdio:
initializenotifications/initializedtools/listtools/call for __mezcal_init__tools/call for statustools/call for block_detail