Give Claude real-time access to the Stacks blockchain — balances, transactions, smart contracts, and blocks.
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.
| 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 |
- Node.js v18 or higher
- Claude Desktop app
git clone https://github.com/rogersterkaa/stacks-mcp-server.git
cd stacks-mcp-server
npm installOpen 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"]
}
}
}Close and reopen Claude Desktop. You'll see the MCP tools available in your conversation.
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..."
Switch between Testnet and Mainnet using an environment variable — no code changes needed.
Testnet (default):
node index.jsMainnet:
STACKS_NETWORK=mainnet node index.jsOr 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"
}
}
}
}- ✅ 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
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.
Rogers Terkaa — Founder of StacksBit, building trust infrastructure for African commerce on Stacks (Bitcoin L2).
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
- GitHub: @rogersterkaa
- X: @TerkaaTarkighir
- Project: StacksBit
MIT — free to use, modify, and distribute.