MCP HubMCP Hub
milancermak

starknet-mcp

by: milancermak

Model context protocol server for Starknet RPC

9created 21/01/2025
Visit
Starknet
RPC

📌Overview

Purpose: The Starknet MCP framework enables seamless access to various Starknet RPC methods through the Model Context Protocol (MCP), empowering applications to interact effectively with the Starknet blockchain.

Overview: Starknet MCP serves as an intermediary that facilitates communication with multiple Starknet RPC methods, allowing users to retrieve essential blockchain data. With read functionalities currently supported, developers can integrate these capabilities into their applications to interact with the Starknet network effortlessly.

Key Features:

  • Wide Range of RPC Methods: Provides access to numerous Starknet RPC methods, including fetching block information, transaction status, and event data, enabling comprehensive blockchain interactions.

  • Custom Configuration: Users can tailor the MCP server settings to their specific environments, which simplifies integration with existing tools like Claude Desktop and enhances usability.

  • Interactive Permissions Model: Incorporates a permissions request system that ensures users are informed about the methods being used, maintaining transparency during data access operations.


starknet-mcp

MCP (Model Context Protocol) server for Starknet. It exposes the following Starknet RPC methods through MCP:

starknet_getBlockWithTxHashes
starknet_getBlockWithTxs
starknet_getBlockWithReceipts
starknet_getStateUpdate
starknet_getStorageAt
starknet_getTransactionStatus
starknet_getTransactionByHash
starknet_getTransactionByBlockIdAndIndex
starknet_getTransactionReceipt
starknet_getClass
starknet_getClassHashAt
starknet_getClassAt
starknet_getBlockTransactionCount
starknet_call
starknet_getEvents
starknet_getNonce
starknet_blockNumber
starknet_blockHashAndNumber
starknet_chainId
starknet_syncing
starknet_specVersion

Note: Write methods are not yet supported.

Installation

  1. Install Bun from bun.sh.

  2. Clone this repository.

  3. Install dependencies with:

    bun install
    
  4. Update Claude's MCP config according to your OS. An example claude_desktop_config.json entry:

    {
      "mcpServers": {
        "starknet": {
          "command": "bun",
          "args": ["/PATH/TO/THIS/REPO/starknet-mcp/index.ts"],
          "env": {
            "STARKNET_RPC_URL": "https://starknet-mainnet.public.blastapi.io/rpc/v0_7"
          }
        }
      }
    }
    

Usage

After configuring Claude Desktop correctly, it will have access to all supported Starknet methods. You can ask questions about the chain state, for example: "What is the latest block hash and number on Starknet?".

When Claude needs to use an MCP method to answer, it will ask for your permission, showing the method, input, and output inline in the chat.

Quirks

  • The methods starknet_estimateFee and starknet_estimateMessageFee are not yet supported.
  • Claude does not fully adhere to the tool input schema; it prefers sending strings. Some input validation is handled in the server code. If you encounter errors, please open an issue.