Starknet MCP server

Integrates with Starknet's JSON-RPC API to enable querying blockchain state, retrieving transaction data, and executing contract calls for blockchain analytics and smart contract interactions.
Back to servers
Provider
Milan Cermak
Release date
Jan 22, 2025
Language
TypeScript
Stats
9 stars

This MCP server for Starknet allows access to Starknet blockchain data directly from Claude. It implements various read methods from the Starknet JSON-RPC API, enabling you to query blockchain state, transactions, blocks, and other on-chain information through the Model Context Protocol.

Installation

To get started with the Starknet MCP server:

  1. Install Bun on your system
  2. Clone the GitHub repository
  3. Install dependencies:
    bun install
    
  4. Update Claude's MCP configuration following the MCP quickstart guide for your operating system
  5. Add the Starknet server to your Claude configuration file (claude_desktop_config.json):
    {
      "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

Once properly configured, Claude will be able to access Starknet blockchain data through the MCP server. You can interact with the Starknet blockchain by asking Claude questions about:

  • Block information
  • Transaction details
  • Chain state
  • Contract data
  • Events
  • Network status

Example Queries

Simply ask Claude questions like:

  • "What is the latest block hash and number on Starknet?"
  • "Show me the details of this Starknet transaction: [hash]"
  • "What's the current chain ID of Starknet?"

When Claude needs to access blockchain data, it will request your permission to use the appropriate MCP method. The request will display:

  • The method being called
  • Input parameters
  • Output data

Available Methods

The server supports the following read methods:

  • 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

Limitations

  • Write methods (sending transactions) are not currently supported
  • starknet_estimateFee and starknet_estimateMessageFee methods are not yet implemented
  • Claude may sometimes encounter issues with input parameter formatting, as it prefers sending strings rather than properly formatted objects

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later