Skip to content

About

Give Claude real-time access to the Stacks blockchain — balances, transactions, smart contracts, and blocks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stacks MCP Server

Give Claude real-time access to the Stacks blockchain — balances, transactions, smart contracts, and blocks.

MCP Stacks License


What is this?

This is a Model Context Protocol (MCP) server that connects Claude to the Stacks blockchain in real time.

Once installed, you can ask Claude things like:

  • "What is the STX balance of this wallet?"
  • "Show me the last 10 transactions for this address"
  • "What functions does this smart contract have?"
  • "Get details of this transaction"
  • "What is the latest Stacks block?"

Claude will query the Stacks blockchain and return live data — no copy-pasting, no manual API calls.


Tools Available

Tool Description
get_stx_balance Get the STX balance of any Stacks wallet address
get_transactions Get recent transactions for a wallet (up to 20)
get_transaction Get full details of a specific transaction by TX ID
get_contract_info Get all functions of a deployed Stacks smart contract
get_clarity_source Fetch the actual Clarity source code of a smart contract
get_block_info Get information about the latest Stacks block

Installation

Prerequisites

  • Node.js v18 or higher
  • Claude Desktop app

Step 1 — Clone the repo

git clone https://github.com/rogersterkaa/stacks-mcp-server.git
cd stacks-mcp-server
npm install

Step 2 — Add to Claude Desktop config

Open your Claude Desktop config file:

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Mac:

~/Library/Application Support/Claude/claude_desktop_config.json

Add this to the mcpServers section:

{
  "mcpServers": {
    "stacks-mcp-server": {
      "command": "node",
      "args": ["/full/path/to/stacks-mcp-server/index.js"]
    }
  }
}

Step 3 — Restart Claude Desktop

Close and reopen Claude Desktop. You'll see the MCP tools available in your conversation.


Usage Examples

Check a wallet balance:

"Using stacks-mcp-server, get the STX balance for SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR"

Get recent transactions:

"Using stacks-mcp-server, get the last 10 transactions for SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR"

Inspect a smart contract:

"Using stacks-mcp-server, get contract info for ST3GTDAAVRPKHCC45FFW0540MPTDHGWWRMB5DS4Q0 stacksbit-gateway"

Get transaction details:

"Using stacks-mcp-server, get transaction 0x5e..."


Network Support

Switch between Testnet and Mainnet using an environment variable — no code changes needed.

Testnet (default):

node index.js

Mainnet:

STACKS_NETWORK=mainnet node index.js

Or add it to your Claude Desktop config:

{
  "mcpServers": {
    "stacks-mcp-server": {
      "command": "node",
      "args": ["/full/path/to/stacks-mcp-server/index.js"],
      "env": {
        "STACKS_NETWORK": "mainnet"
      }
    }
  }
}

What's Included

  • ✅ Address validation — catches invalid Stacks addresses before hitting the API
  • ✅ Transaction ID validation — validates TX ID format before querying
  • ✅ Clarity source code fetching — read actual smart contract code from the chain
  • ✅ Network switching — toggle testnet/mainnet via environment variable

Security

This server makes read-only calls to the public Hiro API. It does not require any private keys or write access. No sensitive data is stored or transmitted beyond what the Hiro API returns publicly.

Always apply least privilege — only grant this server access to what it needs.

Built By

Rogers Terkaa — Founder of StacksBit, building trust infrastructure for African commerce on Stacks (Bitcoin L2).

Hire Me

Need a custom MCP server for your blockchain or Web3 project?

I build MCP servers that connect Claude and other AI systems to:

  • Blockchain networks (Stacks, EVM, Bitcoin)
  • Payment APIs (Paystack, Flutterwave)
  • Custom Web3 infrastructure

📧 rogersterkaa@gmail.com 🐙 github.com/rogersterkaa 🔗 stacksbit-app.vercel.app



License

MIT — free to use, modify, and distribute.

About

Give Claude real-time access to the Stacks blockchain — balances, transactions, smart contracts, and blocks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages