Dun Protocol MCP Server
OfficialProvides tools for interacting with Solana devnet wallet operations: checking SOL and wSOL balances, and preparing unsigned transactions to wrap SOL to wSOL or unwrap wSOL back to SOL. Transactions are returned base64-encoded for client-side signing and submission.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Dun Protocol MCP Server
A Model Context Protocol (MCP) server for Dun Protocol - enabling AI agents to interact with Solana wallet operations.
Note: Currently this MCP server supports Solana devnet. This MCP server only includes tools to generate transaction metadata - no user private keys are required. Raw transaction signing needs to be implemented on the client side (e.g., using wallet adapter).
š Features
Wallet Operations
Balance Checking: Real-time SOL and wSOL balance queries
SOL Wrapping: Convert native SOL to wrapped SOL (wSOL)
SOL Unwrapping: Convert wrapped SOL (wSOL) back to native SOL
Transaction Preparation: Server prepares unsigned transactions for client signing
Related MCP server: Solana MCP Server
š ļø Available Tools
Tool | Description | Returns |
| Check SOL and wSOL balance | Balance data (read-only) |
| Wrap SOL to wSOL | Base64 unsigned transaction |
| Unwrap wSOL to SOL | Base64 unsigned transaction |
š Quick Start
Prerequisites
Node.js 18+
pnpm (or npm/yarn)
Local Development
# Clone the repository
git clone <your-repo-url>
cd dun-protocol-mcp-server
# Install dependencies
pnpm install
# Run development server
pnpm devServer runs on http://localhost:3000
Test with MCP Inspector
The MCP Inspector is a tool to test your MCP server locally before deploying.
# Install and run MCP Inspector
npx @modelcontextprotocol/inspectorConfiguration:
When the inspector opens, configure the connection:
Transport:
SSE(Server-Sent Events)URL:
http://localhost:3000/api/mcp
Make sure your dev server is running:
pnpm devClick "Connect" in the inspector
Testing Tools:
Once connected, you can test all available tools:
// Example: Check wallet balance
{
"name": "check_wallet_balance",
"arguments": {
"walletAddress": "81NkAdgRGwJfnWaDBnqQQad3iZNtxy8NYgXgCbqHMkWG"
}
}
// Example: Wrap SOL
{
"name": "wrap_sol",
"arguments": {
"walletAddress": "81NkAdgRGwJfnWaDBnqQQad3iZNtxy8NYgXgCbqHMkWG",
"amount": 0.1
}
}
// Example: Unwrap SOL
{
"name": "unwrap_sol",
"arguments": {
"walletAddress": "81NkAdgRGwJfnWaDBnqQQad3iZNtxy8NYgXgCbqHMkWG",
"amount": 0.05
}
}Expected Responses:
Read operations: Return data directly (e.g., balance information)
Write operations: Return
{ requiresClientExecution: true, transaction: "base64..." }
š¦ Deploy to Vercel
Quick Deploy
Manual Deployment
See the complete Deployment Guide for detailed instructions.
Quick Steps:
Push to GitHub
git push origin mainDeploy on Vercel
Go to vercel.com
Import your GitHub repository
Click "Deploy"
Get Your URL
https://your-app.vercel.app/api/mcpConfigure AI Client (see below)
Environment Variables (Optional)
Variable | Description | Default |
| Solana RPC endpoint |
|
š§ Client Configuration
Claude Desktop
Open Claude Desktop configuration:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the MCP server:
{
"mcpServers": {
"dun-protocol": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-app.vercel.app/api/mcp"
]
}
}
}Restart Claude Desktop
Cursor
Open Cursor MCP configuration:
macOS/Linux:
~/.cursor/mcp.jsonWindows:
%USERPROFILE%\.cursor\mcp.json
Add the MCP server:
{
"mcpServers": {
"dun-protocol": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-app.vercel.app/api/mcp"
]
}
}
}Restart Cursor
Other MCP Clients
For other MCP-compatible clients, use the remote MCP connection:
npx mcp-remote https://your-app.vercel.app/api/mcpš” Usage Examples
Check Wallet Balance
User: "Check my SOL balance for wallet 81NkAdgRGwJfnWaDBnqQQad3iZNtxy8NYgXgCbqHMkWG"
AI: Uses check_wallet_balance tool
Response: "Your wallet has 2.5000 SOL (native) and 0.1000 wSOL (wrapped)"Wrap SOL
User: "Wrap 0.1 SOL"
AI: Uses wrap_sol tool
Response: "Transaction prepared. Please sign in your wallet."
(Returns base64-encoded transaction for client to sign)Unwrap SOL
User: "Unwrap 0.05 wSOL"
AI: Uses unwrap_sol tool
Response: "Transaction prepared to unwrap 0.05 wSOL. Please sign in your wallet."
(Returns base64-encoded transaction for client to sign)šļø Architecture
āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā
ā AI Agent ā āāāāāāāŗ ā MCP Server ā āāāāāāāŗ ā Solana ā
ā (Claude) ā ā (Stateless) ā ā Devnet ā
āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā
ā ā
ā ā
ā ā¼
ā Read: Return Data
ā Write: Build Transaction
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāā
Client Signs & SubmitsHow It Works
Read Operations (e.g., balance checks)
Server queries Solana RPC directly
Returns actual data to AI agent
No client action needed
Write Operations (e.g., wrap, unwrap)
Server builds unsigned transaction with proper instructions
Returns base64-encoded transaction
Returns
requiresClientExecution: truewith action metadataClient must sign and submit transaction to blockchain
Transaction Building
The server uses the wrap-unwrap.ts service to build transactions:
prepareWrapSolTransaction()- Builds wrap SOL ā wSOL transactionprepareUnwrapSolTransaction()- Builds unwrap wSOL ā SOL transaction
All functions return base64-encoded unsigned transactions ready for client signing.
š Security Model
No Private Keys: Server never has access to private keys
Client-Side Signing: All transactions signed by user's wallet
Read-Only RPC: Server only reads blockchain data
Stateless: No database, no sessions, no stored credentials
š Network Information
Network: Solana Devnet
RPC:
https://api.devnet.solana.com
š Documentation
Deployment Guide - Complete deployment instructions
Tool Reference - Complete API documentation
Implementation Status - What's implemented where
Quick Start - Development guide
Changelog - Version history
š ļø Development
Project Structure
dun-protocol-mcp-server/
āāā app/
ā āāā api/
ā āāā mcp/
ā āāā route.ts # Main MCP handler
ā āāā services/
ā āāā wrap-unwrap.ts # Transaction building service
āāā .kiro/
ā āāā docs/ # Documentation
ā āāā resources/
ā āāā new_code/ # Latest V3/V5 code examples
ā āāā mcp_code_2/ # Reference implementation
āāā package.json
āāā README.mdKey Services
app/api/mcp/services/wrap-unwrap.ts
This service handles all transaction building:
// Wrap/Unwrap Operations
prepareWrapSolTransaction() // Build wrap SOL ā wSOL transaction
prepareUnwrapSolTransaction() // Build unwrap wSOL ā SOL transactionFeatures:
Returns base64-encoded unsigned transactions
Handles token account creation if needed
Validates balances before unwrapping
Dependencies
{
"@solana/web3.js": "^1.95.8", // Solana RPC & transaction building
"@solana/spl-token": "^0.4.9", // SPL Token operations
"@vercel/mcp-adapter": "^0.11.1", // MCP protocol adapter
"next": "^16.1.1", // Next.js framework
"zod": "^3.25.71" // Schema validation
}Build Commands
# Development
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm startš¤ Contributing
Contributions are welcome! Please read the documentation in .kiro/docs/ before contributing.
š License
MIT
š Resources
Built by Qilinxlabs with ā¤ļø for privacy-preserving transactions on Solana
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Run all your Solana wallets from your AI: send, swap, split, consolidate and clean up.
Solana wallet & token checks for agents, pay per call in USDC via x402 (Solana or Base).
Non-custodial DeFi tools for AI agents on Solana: swaps, perps, lending, staking, equities.
Solana onchain intelligence for AI agents: wallet risk, due-diligence, perps funding, smart money.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with the Solana blockchain network, supporting documentation search, blockchain queries, wallet management, and cryptographic signing operations on Devnet and Testnet.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to read chain data, execute transactions, swap tokens, and manage wallets on Solana through 38 tools across 7 modules. Supports write operations with a private key and includes built-in prompts for common workflows.381MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Solana blockchain, manage accounts and tokens, and develop and deploy smart contracts end-to-end.4MIT
- AlicenseNot gradedqualityCmaintenanceProvides basic Solana RPC methods and prompts for AI models to interact with the Solana blockchain. Enables developers to fetch balances, account info, and transactions through natural language.1MIT