Mezcal ExplorerMezcalDocs
QuickstartBuildAgentsReference
Open explorer
Documentation homeQuickstartConceptsMonitor 10 Wallets
BuildAPIAdvanced UtilitiesProtocol RoutesAPI Surface PolicySDKTypeScript SDK

Live reference

Interactive API referenceReference hub
AgentsAgent CLIMCP Quickstart
Reference Catalogs
Docs/Quickstart

Quickstart

Get connected to Mezcal quickly with a public host, a bounded API key, and no repo setup.

API referenceTypeScript SDKCLIAgents

In this guide

Use this guide forStart in the app firstWhat you need1. Export the environment2. Make the first successful request3. Validate the first high-value reads
Loading documentation content…
PreviousDocumentation homeMezcal explorer API, live product, and docs for Quickstart, Build, Agents, and the live API reference.NextConceptsTerms you will see across Mezcal docs—URLs, auth, pagination, and API tiers.

On this page

Use this guide forStart in the app firstWhat you need1. Export the environment2. Make the first successful request3. Validate the first high-value reads4. Run the 10-wallet monitoring starter5. Install the release clientsCLISDK6. Choose the next surface deliberatelyStay on REST when you want zero-install integrationMove to the SDK when you are writing app codeMove to the CLI when you need shell workflows or exportsMove to MCP when an agent needs tool-calling access7. Keep going with the right docsWhen to stay in the explorer instead
Mezcal ExplorerMezcalDocumentation

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

Quickstart

Use this guide when you need the shortest safe path from “I have a host and a key” to “I made a successful Mezcal request.”

Use this guide for

  • external API onboarding
  • first-request verification
  • choosing the right Mezcal surface before deeper integration work
  • proving the current deployment is reachable before you touch SDK, CLI, or MCP

Start in the app first

Open the live product on the same host before you wire clients:

  • Dashboard
  • Transactions
  • Contracts
  • Watchlist

Use the app first when you want to confirm the deployment is healthy and see the same explorer surface that the API, SDK, CLI, and MCP all sit on top of.

What you need

  • MEZCAL_BASE_URL
  • MEZCAL_API_KEY
  • optionally MEZCAL_CHAIN if you are not using the default SN_MAIN

If you are using the hosted external surface, MEZCAL_BASE_URL should already include /api.

New to the vocabulary? See Concepts.

1. Export the environment

export MEZCAL_BASE_URL="https://<your-mezcal-host>/api"
export MEZCAL_API_KEY="mzk_test_your_key_here"
export MEZCAL_CHAIN="SN_MAIN"

All public docs below assume you call the normal /v1/* routes relative to that base.

2. Make the first successful request

curl \
  -H "X-Mezcal-Api-Key: $MEZCAL_API_KEY" \
  "$MEZCAL_BASE_URL/v1/$MEZCAL_CHAIN/status"

If that returns chain status, your Mezcal access is wired correctly.

3. Validate the first high-value reads

These are the fastest replacement checks when you are moving from direct RPC reads into Mezcal:

curl \
  -H "X-Mezcal-Api-Key: $MEZCAL_API_KEY" \
  "$MEZCAL_BASE_URL/v1/$MEZCAL_CHAIN/token/<token>/total-supply?block_tag=latest"

curl \
  -H "X-Mezcal-Api-Key: $MEZCAL_API_KEY" \
  "$MEZCAL_BASE_URL/v1/$MEZCAL_CHAIN/token/<token>/balance-of/<owner>?block_tag=latest"

Use balance-of only when you already know the exact token contract you want to check. If the workflow is wallet screening or "skip wallets that already hold USDC," use:

curl \
  -H "X-Mezcal-Api-Key: $MEZCAL_API_KEY" \
  "$MEZCAL_BASE_URL/v1/$MEZCAL_CHAIN/address/<owner>/token-holdings"

That avoids two common mistakes:

  • assuming one symbol such as USDC maps to only one Starknet contract
  • looping exact-token balance-of across large wallet sets when token-holdings is the better current Mezcal path

These same workflows also exist in the CLI, the TypeScript SDK, and MCP.

If you use token-holdings to decide whether to skip or include a wallet, check the holdings completeness flags first. Treat the result as complete only when exact=true and truncated=false.

4. Run the 10-wallet monitoring starter

If your workflow looks like Carlos’s wallet monitoring setup, do not hand-assemble it from scattered snippets. Use the dedicated Monitor 10 wallets guide instead.

That starter gives you one canonical workflow across:

  • REST for zero-install monitoring and raw wire inspection
  • the TypeScript SDK for app code
  • the CLI for shell-based polling and local exports

5. Install the release clients

CLI

export MEZCAL_INSTALLER_REF="<release-tag-or-commit-sha>"
curl -fsSL "https://raw.githubusercontent.com/starknet-innovation/mezcal/${MEZCAL_INSTALLER_REF}/rust-exp/scripts/install-mezcal.sh" | bash
mezcal status

If you need a pinned CLI release:

curl -fsSL "https://raw.githubusercontent.com/starknet-innovation/mezcal/${MEZCAL_INSTALLER_REF}/rust-exp/scripts/install-mezcal.sh" | bash -s -- --version <tag>

Manual tarball install remains available as a fallback after downloading the matching archive from the GitHub release page:

tar -xzf mezcal-<platform>.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 755 mezcal "$HOME/.local/bin/mezcal"

SDK

npm install @mezcal/sdk@alpha
# or
pnpm add @mezcal/sdk@alpha
bun add @mezcal/sdk@alpha

6. Choose the next surface deliberately

Stay on REST when you want zero-install integration

Keep going with the REST API when you need exact HTTP behavior, auth headers, retries, and request/response debugging.

Move to the SDK when you are writing app code

Use the TypeScript SDK when you want typed responses and route construction handled for you.

Move to the CLI when you need shell workflows or exports

Use the Agent CLI when you want repeatable terminal commands, local-first transfer exports, or a shell-friendly operator surface.

Move to MCP when an agent needs tool-calling access

Use MCP quickstart when the consumer is Codex, Claude Code, Cursor, VS Code, or another MCP client.

7. Keep going with the right docs

  • Continue with the REST API when you need exact HTTP behavior.
  • Continue with the SDK when you are writing app code.
  • Continue with the CLI when you want shell workflows or local exports.
  • Continue with MCP when an agent needs tool calls instead of direct HTTP.

When to stay in the explorer instead

Stay in the browser first when the job is visual verification:

  • use Transactions to inspect activity and detail pages
  • use Contracts to inspect deployment metadata and holdings
  • use Watchlist to revisit saved high-signal entities
  • use Dashboard when you need quick chain-health context