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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stacks MCP Serverswap 100 STX for ALEX tokens on the Alex DEX"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Stacks Agent
AI Skill for building Stacks blockchain applications - Bitcoin's most powerful smart contract layer
An intelligent AI assistant that provides development guidance for Clarity smart contracts, DeFi integration, and blockchain development on Stacks. Works with Claude Code, Cursor, Windsurf, Antigravity, GitHub Copilot, Kiro, and Codex.
✨ Features
Highlights:
🎯 40 Production Code Examples - Real code from live dApps (sbtc-market, stacksagent, STX City)
🕸️ 100 Knowledge Relationships - Connected concepts across domains
🚫 Zero Deprecated Code - All modern @stacks/connect v7+ API patterns
🔒 Security-First Examples - Post-conditions, error handling, real vulnerabilities
557+ Knowledge Base Entries Across 15 Domains:
Core Language & Tools (175 entries)
🔷 61 Clarity Functions - Complete language reference with examples
⚛️ 75 Stacks.js Utilities - Wallet, transactions, CV constructors, API integration
📋 14 Contract Templates - SIP-010, SIP-009, DAO, Vault, Marketplace, Stacking
🚀 25 Deployment Steps - Testnet, mainnet, and devnet workflows
Domain-Specific Integrations (247 entries)
🌐 21 BNS Operations - Name registration, resolution (Clarity + JS + API)
💰 25 Stacking Guides - PoX stacking and pool delegation (Clarity + JS + API)
🔄 87 DeFi Protocols - Alex, Velar, Bitflow, USDCx bridging, multi-DEX routing (Clarity + JS + API)
🎨 30 NFT Operations - SIP-009, minting, marketplace patterns (Clarity + JS + API)
💎 40 Token Operations - SIP-010 fungible tokens, DeFi integrations (Clarity + JS + API)
🔐 14 Authentication - Wallet auth, JWT, sessions, token-gating (No Gaia - deprecated) (Clarity + JS + API)
📊 30 Oracle Integration - Pyth Network price feeds, VAA handling, Hermes API (Clarity + JS + API)
Advanced & Specialized (135 entries)
🛡️ 15 Security Patterns - Common vulnerabilities and secure implementations
🎯 40 Advanced Patterns - Pagination, SWR, presales, lotteries, vesting, CSV export
🔗 30 Chainhooks - Event indexing, webhooks, predicates, ordinals tracking
🤖 50 Trading Bots - Automated trading, wallet SDKs, Privy, bonding curves
🎯 Use Cases
Generate Clarity smart contracts from natural language
Audit contracts for security vulnerabilities
Integrate with DeFi protocols (swaps, liquidity, lending)
Bridge USDC from Ethereum to Stacks (USDCx)
Swap USDCx across multiple DEXs (Bitflow, Alex, Velar)
Integrate Pyth Network oracle for price feeds
Deploy to testnet/mainnet
Build dApps with Stacks.js
Implement stacking and BNS features
📦 Installation
Using CLI (Recommended)
Manual Installation
Copy the appropriate folders to your project:
AI Assistant | Folders to Copy |
Claude Code |
|
Cursor |
|
Windsurf |
|
Antigravity |
|
GitHub Copilot |
|
Kiro |
|
Codex |
|
🚀 Usage
Claude Code
The skill activates automatically when you request Stacks development work, tag or mention the stacksagent
Cursor / Windsurf / Antigravity
Use the slash command:
GitHub Copilot
Reference in chat:
💡 Example Prompts
Basic Queries:
Production Code Examples (New in v2.0):
USDCx Bridging & Multi-DEX (New in v1.6.0):
With Relationships:
🔍 Knowledge Base Search
The skill includes a powerful BM25-based search engine:
Available domains:
clarity- Syntax and functionstemplates- Contract templatessecurity- Security patternsdefi- DeFi protocols (swaps, liquidity, stacking, oracles)nfts- NFT operations (minting, marketplace, royalties)tokens- Token operations (SIP-010, vesting, allowances)auth- Authentication (wallet connect, JWT, sessions)stacksjs- JavaScript snippetsbns- BNS operationsstacking- Stacking guidesdeployment- Deployment stepsauto- Auto-detect (default)
🎯 Production Code Examples (New in v2.0)
Search 40 complete, production-tested code examples extracted from live dApps:
Example Types
quickstart - Single-feature examples (8 examples)
integration - Multi-step workflows (12 examples)
debugging - Troubleshooting failed transactions (3 examples)
best-practice - Recommended patterns (3 examples)
security - Security-focused implementations (2 examples)
Example Coverage
DeFi (10 examples):
Swap with slippage protection (sbtc-market-frontend)
Add/remove liquidity (prediction markets)
Pyth oracle integration with VAA
Delegate stacking to PoX pools
Bonding curve buys (STX City)
Multi-hop swap routing
Debug failed swaps
Secure token approvals
NFT (10 examples):
Mint/transfer with SIP-009 compliance
Marketplace listing and buying (Gamma patterns)
NFT royalties (EIP-2981-like)
Batch minting for airdrops
Dynamic metadata updates
Collection launch workflows
Debug transfer failures
Secure marketplace with escrow
Tokens (8 examples):
Deploy SIP-010 tokens
Secure transfers with post-conditions
Token allowances (DEX integration)
Vesting schedules with cliff periods
Token burns (deflationary mechanics)
Multi-token atomic swaps
Debug transfer failures
Security (7 examples):
Reentrancy prevention
Integer overflow protection
Access control (RBAC)
Input validation
Rate limiting for DoS
Secure randomness
Privilege escalation prevention
Auth (5 examples):
Wallet connect flow (sbtc-market)
JWT authentication via signatures (stacksagent)
Protected routes with persistence (STX City)
NFT token gating
Session management with cleanup
Example Output Format
Each example includes:
✅ Complete working code from production dApps
✅ Test inputs/outputs with valid JSON
✅ Common pitfalls from real bugs
✅ Live example URLs to actual code
✅ Modern API patterns (@stacks/connect v7+)
✅ Security best practices (post-conditions, deny mode)
🕸️ Knowledge Graph Relationships (New in v2.0)
100 relationships connect concepts across domains:
Relationship Types
requires - Critical dependency (e.g., "swap requires ft-transfer")
uses - Functional dependency (e.g., "DEX uses post-conditions")
implements - Standard compliance (e.g., "token implements SIP-010")
javascript-for - Language bridge (e.g., "SDK implements Clarity function")
prevents - Security defense (e.g., "access control prevents unauthorized access")
similar-to - Alternative approach
conflicts - Incompatibility
complements - Enhanced together
Example Output
📚 Knowledge Base Contents
Clarity Language (61 entries)
Types, functions, control flow, arithmetic, comparisons, maps, tokens, STX operations
Contract Templates (14 entries)
Tokens: SIP-010 basic, mintable, burnable, capped
NFTs: SIP-009 basic, mintable, royalties
DeFi: Vault basic/timelocked, liquidity pool
DAO: Basic DAO, treasury management
Other: Marketplace, stacking pool
Security Patterns (15 entries)
Critical: Access control, unchecked transfers
High: Reentrancy, arithmetic safety
Medium: Input validation, front-running
Low: Code style, gas optimization
DeFi Protocols (87 entries)
Alex, Velar, Bitflow, Zest, StackingDAO, Boost, Faktory integration patterns
USDCx Bridging & Multi-DEX (New in v1.6.0)
Bridge Operations:
Deposit USDC from Ethereum → mint USDCx on Stacks
Burn USDCx on Stacks → withdraw USDC on Ethereum
Address encoding (Stacks ↔ Ethereum)
Bridge timing: ~15 min deposit, ~60 min withdrawal
Multi-DEX Swap Routing:
Bitflow:
swap-helper-a/b/cfor 2/3/4-hop swapsAlex:
swap-helper,swap-helper-awith factorsVelar:
path-applywith tuple-based routingStableswap: stSTX↔STX, USDH↔USDCx
Quote APIs:
Bitflow SDK:
getQuoteForRoute()Alex SDK:
getAmountTo()with Currency enumsFallback rates and price caching
Contract Addresses:
Contract | Address |
USDCx |
|
Bitflow Router |
|
Alex AMM |
|
Velar |
|
Stacks.js (30 entries)
Wallet connection, transactions, Clarity values, API calls, post-conditions
BNS (10 entries)
Name resolution, registration, transfer, updates
Stacking (15 entries)
Direct stacking, delegation, pools, rewards
Deployment (25 entries)
Testnet, mainnet, devnet workflows with Clarinet
🛡️ Security Best Practices
All generated contracts include:
✅ Access control (
tx-sendervalidation)✅ Error handling (
try!,unwrap!)✅ Input validation (
asserts!)✅ Named error constants
✅ Kebab-case naming
✅ Network compatibility checks
🌐 Networks
Mainnet: Production (SP... addresses)
Testnet: Testing (ST... addresses, free STX)
Devnet: Local development (Clarinet)
🔧 Prerequisites
Python 3.x (for search functionality)
Node.js 18+ (for CLI installation)
📖 Documentation
🔗 DeFi Resources
🤝 Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add knowledge entries to appropriate CSV files
Test the search functionality
Submit a pull request
📄 License
MIT License - see LICENSE file for details
🙏 Acknowledgments
Built for the Stacks community with:
Stacks.js by Hiro Systems
📞 Support
GitHub Issues: Report bugs or request features
Stacks Discord: Join the community
Twitter: @kai_builder
🎯 Roadmap
Completed (v1.6.0) ✅
USDCx bridging from Ethereum (62 new entries)
Multi-DEX swap routing (Bitflow, Alex, Velar)
AMM quote API patterns (SDK integration)
557+ total knowledge base entries
Completed (v2.0) ✅
Multi-platform AI skill support (7 platforms)
495+ knowledge base entries
BM25 search engine with regex boosting
CLI installer
40 production code examples from live dApps
100 knowledge graph relationships
Modern API patterns (@stacks/connect v7+)
Deprecated code removal (Gaia, openContractCall, showConnect)
In Progress (v2.1)
Web-based search interface
Interactive example playground
Community example contributions
Future (v3.0+)
VSCode extension
Real-time contract analysis
Semantic search with embeddings
Multi-language support (Chinese, Spanish)
Made with ❤️ for the Stacks community
Build Bitcoin-secured dApps with AI assistance