starknet-mcp

August 11, 2026 · View on GitHub

A Model Context Protocol (MCP) server that lets an AI agent (Claude, or any MCP client) read Starknet directly: token balances, transactions, blocks, storage, and arbitrary read-only contract calls.

It turns natural-language questions like "what tokens does 0x… hold?" or "is transaction 0x… accepted?" into live Starknet JSON-RPC calls and hands the structured results back to the model.

Read-only by design. No private keys, no signing, nothing that can move funds.

Tools

ToolWhat it does
get_balancesNon-zero balances of well-known tokens (ETH, STRK, USDC, USDT, DAI, WBTC, …) for an address
get_token_balanceBalance of a specific ERC-20 token for an address
list_known_tokensThe built-in token registry (symbol → address)
call_contractRead-only call to any contract: contract_address, entrypoint, optional calldata[]
get_transactionTransaction details by hash
get_transaction_statusFinality + execution status by hash
get_blockA block with its transaction hashes (latest, pending, a number, or a hash)
get_storage_atRaw storage slot value
get_nonceNonce of an account / address
get_contract_class_hashClass hash deployed at an address
get_chain_infoNetwork, RPC URL, chain id, and latest block number

Install & build

git clone https://github.com/Giri-Aayush/starknet-mcp.git
cd starknet-mcp
npm install
npm run build

Configure your MCP client (Claude Desktop)

Add this to claude_desktop_config.json (Settings → Developer → Edit Config), using the full path to the built file:

{
  "mcpServers": {
    "starknet": {
      "command": "node",
      "args": ["/full/path/to/starknet-mcp/dist/index.js"],
      "env": {
        "STARKNET_NETWORK": "mainnet"
      }
    }
  }
}

Restart the client and enable the starknet server. Then try:

  • "Using starknet, what tokens does 0x04d8… hold?"
  • "Call name on 0x… and tell me what it returns."
  • "What's the finality status of transaction 0x…?"
  • "Get the latest Starknet block and how many transactions it has."

Network configuration

Env varDefaultNotes
STARKNET_NETWORKmainnetmainnet or sepolia
STARKNET_RPC_URLpublic BlastAPI RPC (v0.7)Point at your own RPC (Alchemy, Infura, a self-hosted Juno/Pathfinder node, …)

The built-in token registry is for mainnet. The generic tools (call_contract, get_block, get_transaction, get_storage_at, …) work on whichever network you configure.

How it works

Each MCP tool maps to a Starknet JSON-RPC method via starknet.js. Results are returned as JSON so the model can reason over them.

MCP client (Claude)  ──stdio──►  starknet-mcp  ──JSON-RPC──►  Starknet node

Development

npm run build   # tsc → dist/
npm start       # run the server on stdio
src/
├── index.ts              # MCP server: tool definitions + dispatch
├── tools/
│   ├── balanceChecker.ts # get_balances / get_token_balance
│   └── rpc.ts            # call_contract, transactions, blocks, storage, nonce, chain info
└── utils/
    ├── providers.ts      # network / RPC configuration
    ├── contracts.ts      # low-level read helpers (callContract, ERC-20 reads)
    ├── tokens.ts         # known token registry
    └── formatting.ts     # felt/uint256/decimal helpers

License

MIT

Contributing

Issues and pull requests welcome — extend the tool set, add networks, or improve the reads.