# β
Stacks MCP Server - Setup Complete
## π What We Accomplished
Your Stacks MCP Server is now **fully documented and production-ready** with automated setup capabilities!
## π¦ What Was Created
### 1. Automated Setup Script (`setup-mcp.sh`)
- β
Interactive and CLI modes
- β
Configures Claude Desktop, Cursor, and VS Code
- β
Reads from `.env` file
- β
Generates proper MCP configuration JSON
- β
Installs to correct application directories
- β
Provides restart instructions
### 2. Package.json Scripts
```json
{
"setup": "./setup-mcp.sh", // Interactive mode
"setup:claude": "./setup-mcp.sh --claude", // Claude Desktop
"setup:cursor": "./setup-mcp.sh --cursor", // Cursor editor
"setup:code": "./setup-mcp.sh --code" // VS Code
}
```
### 3. Enhanced README.md
- β
Professional documentation following VeChain pattern
- β
Quick Start guide with automated setup instructions
- β
Comprehensive usage examples for all protocols
- β
Manual configuration instructions as fallback
- β
Environment variable reference table
- β
Troubleshooting section
- β
Protocol integration status
### 4. BitFlow Temporary Disable
- β
Commented out in `src/index.ts` (lines 21, 71, 136)
- β
Can be re-enabled after obtaining API keys
- β
Clear instructions in README for re-enabling
## π How to Use
### Quick Setup (Recommended)
```bash
# 1. Build the server (if not already built)
pnpm build
# 2. Run automated setup
pnpm setup # Interactive mode - choose your app
pnpm setup:claude # Configure Claude Desktop only
pnpm setup:cursor # Configure Cursor only
pnpm setup:code # Configure VS Code only
# 3. Restart your AI application
# 4. Start chatting!
```
### Example Commands to Try
**Token Operations:**
```
"Check my STX balance"
"Transfer 100 STX to ST1PQHQKV0..."
"What's my ALEX token balance?"
```
**DeFi Operations:**
```
"Swap 100 STX for ALEX on ALEX DEX"
"Open a vault on Arkadiko with 1000 STX"
"Stack 500 STX for 6 cycles"
"Check Velar pool statistics"
```
**Network Info:**
```
"Show me the latest Stacks block"
"What's the current mempool fee?"
"Get transaction details for 0x..."
```
## π What's Integrated
### β
Production Ready (15 Categories)
1. **Contracts** - Smart contract operations
2. **Transactions** - STX transfers and queries
3. **PoX** - Stacking operations
4. **Search** - Account lookups
5. **Tokens** - FT operations
6. **NFT** - SIP-009 operations
7. **Blocks** - Network information
8. **Mempool** - Fee estimation
9. **StackPool** - Pool delegations
10. **Events** - Transaction events
11. **ALEX** - DEX and AMM (34 tools)
12. **Arkadiko** - Vaults and USDA (28 tools)
13. **Charisma** - Composable vaults (14 tools)
14. **Velar** - Multi-chain DEX (18 tools)
15. **Granite** - BTC lending (21 tools)
### βΈοΈ Temporarily Disabled
- **BitFlow** - Requires API keys from BitFlow team
- Can be re-enabled in `src/index.ts` after obtaining keys
## π§ Manual Configuration (If Needed)
If you prefer to configure manually or the automated script doesn't work:
### Claude Desktop
Location: `~/Library/Application Support/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"stacks-mcp": {
"command": "node",
"args": ["/absolute/path/to/stacks-mcp-server/dist/index.js"],
"env": {
"WALLET_PRIVATE_KEY": "0x...",
"STACKS_NETWORK": "testnet",
"HIRO_API_KEY": "optional"
}
}
}
}
```
### Cursor
Location: `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project)
Same JSON format as Claude Desktop.
### VS Code
Location: `~/Library/Application Support/Code/User/mcp.json` (global) or `.vscode/mcp.json` (project)
Same JSON format as Claude Desktop.
## π― Server Status
### Build Status
```bash
$ pnpm build
β
TypeScript compilation successful
β
All plugins compiled
β
dist/index.js ready
```
### Runtime Status
```bash
$ node dist/index.js
π Initializing Stacks MCP Server...
π‘ Network: testnet
πΌ Wallet: ST1FH1BD92NXDTTC68J1EZ34SXY3RF51Z0K3NY40M
β¨ Stacks MCP Server running on stdio
π― Ready to receive requests from Claude Desktop
π Available tool categories: 15
```
## π Documentation Files
- `README.md` - Main documentation (updated)
- `setup-mcp.sh` - Automated setup script (new)
- `.env.example` - Environment template
- `/docs/` - Protocol-specific documentation
- `SETUP_COMPLETE.md` - This file
## π Security Notes
- β
`.env` file is in `.gitignore`
- β
Never commit wallet credentials
- β
Use testnet for development
- β
All commits GPG-signed (per CLAUDE.md)
- β
Setup script uses proper file permissions
## π Troubleshooting
### Setup Script Issues
**"Permission denied"**
```bash
chmod +x setup-mcp.sh
```
**".env file not found"**
```bash
cp .env.example .env
# Edit .env with your configuration
```
**"Built server not found"**
```bash
pnpm build
```
### MCP Connection Issues
**Tools not showing up:**
1. Restart your AI application completely
2. Check configuration file location matches your OS
3. Verify absolute path to `dist/index.js` is correct
4. Check server logs for errors
**"Invalid wallet credentials":**
1. Verify `WALLET_PRIVATE_KEY` or `WALLET_MNEMONIC` in `.env`
2. Ensure key is properly formatted (64 hex chars for private key)
3. Check that key matches selected network
## π Next Steps
1. **Test the server:**
```bash
pnpm setup
# Choose your AI application
# Restart the application
# Try: "Check my STX balance"
```
2. **Explore protocols:**
- Try swapping on ALEX
- Open a vault on Arkadiko
- Stack some STX
- Check out Velar pools
3. **When ready for BitFlow:**
- Contact BitFlow team for API keys
- Update `.env` with real keys
- Uncomment BitFlow in `src/index.ts`
- Rebuild with `pnpm build`
## π Achievement Unlocked
You now have a **production-ready MCP server** for the entire Stacks Bitcoin DeFi ecosystem with:
- β
Professional documentation
- β
Automated setup
- β
15 protocol integrations
- β
100+ professional tools
- β
Natural language interface to Bitcoin DeFi
**Built for the Stacks Vibe Coding Hackathon π**
---
*Last updated: October 2024*
*Version: 1.0.0*