Enables stacking STX tokens to earn Bitcoin rewards through the Proof-of-Transfer (PoX) mechanism, including checking stacking status, APY information, and delegating to stacking pools.
Stacks MCP Server
A Model Context Protocol (MCP) server that enables Claude Desktop to interact with the Stacks blockchain. Manage your wallet, trade tokens, stack STX, and track your portfolio—all through natural conversation.
Note: This is an MVP (Minimum Viable Product) release. Some features use mock data and are being actively developed. See Limitations for details.
Features
Wallet Management
Create new wallets with secure encryption (AES-256-GCM)
Import existing wallets from mnemonic or private key
View balances for STX and tokens
Encrypted keystore with password protection
Market Data & Trading
Get real-time token prices
View trending tokens and liquidity pools
Get DEX swap quotes (Alex, Velar, Bitflow)
Execute token swaps with slippage protection
Add/remove liquidity from pools
Stacking (PoX)
Check current cycle and stacking info
View your stacking status and rewards
Stack STX to earn Bitcoin rewards
Delegate to stacking pools
Portfolio Management
Comprehensive portfolio summary
Transaction history
Portfolio value tracking over time
P&L calculations
Installation
Prerequisites
Node.js 18 or higher
Claude Desktop app (Download)
Quick Start
Option 1: Install from npm (when published)
Option 2: Build from source (recommended for now)
Clone the repository:
Install dependencies:
Build the project:
Note the absolute path to your
dist/index.jsfile - you'll need this for configuration.On macOS/Linux: Run
pwdin the project directory, then append/dist/index.jsOn Windows: Run
cdin the project directory, then append\dist\index.js
Configuration
1. Configure Claude Desktop
Add the MCP server to your Claude Desktop configuration file.
Configuration file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Create the file if it doesn't exist, or edit it to add the stacks MCP server.
If installed via npm:
If built from source:
macOS/Linux:
Windows:
Important: Replace /absolute/path/to/stacksagent-mcp with the actual path where you cloned the repository.
Example paths:
macOS:
/Users/yourname/Projects/stacksagent-mcp/dist/index.jsLinux:
/home/yourname/projects/stacksagent-mcp/dist/index.jsWindows:
C:\\Users\\YourName\\Projects\\stacksagent-mcp\\dist\\index.js
2. Restart Claude Desktop
After editing the configuration file:
Completely quit Claude Desktop (not just close the window)
Restart Claude Desktop
The MCP server should now be available
You can verify it's working by asking Claude: "What Stacks blockchain tools do you have available?"
3. Server Configuration (Optional)
The server creates a config file at ~/.stacks-mcp/config.json on first run. You can customize:
Usage
First Time Setup
After installing and configuring the MCP server:
Restart Claude Desktop completely (quit and reopen)
Start a new conversation with Claude
Verify the tools are available by asking:
What Stacks blockchain tools do you have access to?Create or import a wallet to start using the features
Security First
⚠️ Important: Your wallet and private keys are stored locally on your machine in encrypted format at ~/.stacks-mcp/wallet.enc.
Before creating a wallet:
Choose a strong password (store it in a password manager)
You'll receive a 24-word mnemonic phrase - write it down and store it securely offline
Never share your mnemonic or private key with anyone
The wallet auto-locks after 15 minutes of inactivity
Example Conversations
Create a New Wallet
Check Balance
Get a Swap Quote
Execute a Swap
Check Stacking Info
View Portfolio
Available Tools
Wallet Tools
wallet_create- Create a new walletwallet_import- Import wallet from mnemonic/private keywallet_unlock- Unlock wallet with passwordwallet_lock- Lock walletwallet_get_address- Get current wallet addresswallet_get_balance- Get STX and token balanceswallet_status- Check if wallet exists and is unlocked
Market & DEX Tools
market_get_price- Get token price in USDmarket_get_tokens- List trending/new tokensmarket_get_pools- Get liquidity pools with APYdex_quote- Get swap quotedex_swap- Execute token swapdex_add_liquidity- Add liquidity to pooldex_remove_liquidity- Remove liquidity from pool
Stacking Tools
stacking_get_info- Get current PoX cycle infostacking_get_status- Check stacking statusstacking_stack- Stack STX for rewardsstacking_delegate- Delegate to stacking pool
Portfolio Tools
portfolio_summary- Get portfolio summaryportfolio_transactions- View transaction historyportfolio_history- Get portfolio value over time
Security
Key Storage
Private keys are encrypted using scrypt + AES-256-GCM
Keys never leave your local machine
Encrypted keystore stored at
~/.stacks-mcp/wallet.enc
Transaction Safety
All write operations require wallet to be unlocked
Configurable transaction limits
Slippage protection on swaps
Post-conditions ensure transaction safety
Best Practices
Use a strong password for your wallet
Backup your mnemonic phrase securely
Never share your mnemonic or private key
Lock your wallet when not in use
Review transaction details before confirming
Development
Project Structure
Build
Development Mode
Testing
Limitations (MVP)
This is an MVP release. Some features are not yet fully implemented:
DEX Integration: Currently uses mock quotes. Full Alex/Velar/Bitflow integration coming soon.
Stacking: Core stacking contract calls need implementation.
Price Data: Limited to major tokens.
Multi-wallet: Only supports single wallet currently.
Hardware Wallets: Not yet supported.
Roadmap
Phase 2
Full DEX API integration (Alex, Velar, Bitflow)
Complete stacking contract implementation
Multi-wallet support
Enhanced portfolio tracking
LP position management
Phase 3
Lending/borrowing (Zest, Granite)
sBTC operations
Hardware wallet support
Automated strategies
Price alerts
Troubleshooting
Claude Desktop doesn't see the tools
Check that
claude_desktop_config.jsonis valid JSONRestart Claude Desktop completely
Check logs:
~/Library/Logs/Claude/mcp*.log(macOS)
"Wallet is locked" error
You need to unlock your wallet first:
Transaction fails
Check your STX balance is sufficient
Verify slippage tolerance isn't too low
Ensure the token pair has liquidity
Try again after a few minutes
Price data unavailable
Some tokens may not have price data available yet. Major tokens (STX, WELSH, USDA, sBTC) are supported.
Publishing to npm (For Maintainers)
If you want to publish this package to npm:
Update
package.jsonwith your details:Set
authorfieldUpdate
repositoryfieldEnsure version is correct
Create an npm account at npmjs.com
Login to npm:
Publish the package:
Users can then install via:
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests (when test infrastructure is ready)
Submit a pull request
Please ensure your code:
Follows the existing code style
Includes appropriate error handling
Doesn't expose private keys or sensitive data
Works on macOS, Windows, and Linux
License
MIT License - see LICENSE file for details
Disclaimer
This software is provided "as is" without warranty. Use at your own risk. Always verify transactions before confirming. Never share your private keys or mnemonic phrase.
Support
GitHub Issues: Report bugs and feature requests on the GitHub repository
Stacks Documentation: https://docs.stacks.co
MCP Protocol: https://modelcontextprotocol.io
Stacks Discord: https://discord.gg/stacks
Acknowledgments
Built with:
Model Context Protocol by Anthropic
Stacks.js by Hiro Systems
Made with ❤️ for the Stacks community